Paper1 Flashcards
Diagrammatically Representation of various phases of compiler construction
Source program->Lexical Analyzer-> Syntax Analyzer-> Semantic Analyzer-> Intermediate Code Generator-> Code Optimizer->Code Generator-> Target Program
Acronym:
SLSSICCT
what are the types of errors in the lexical analysis phase?
- Spelling Error
- Exceeding length of character or numeric constants
- Appearance of illegal characters
- Remove or Replace the character that should be present
- Transposition of characters
Basically, Misspellings of identifiers, keywords, or operators
Example: missing quotes from string
what are the errors in the syntax analysis phase?
- Error in structure
- Unabalanced Parenthesis
- Missing operators
Misplaced Semicolons, extra or missing braces
what are the errors of the Semantic phase?
- Mismatches between the operators and operands
example: return statement of a void function
Logical errors:
anything from the incorrect reasoning on the part of the programmer
for example to use the assignment operator ‘=’
instead of “==” comparison operator