Paper1 Flashcards

1
Q

Diagrammatically Representation of various phases of compiler construction

A

Source program->Lexical Analyzer-> Syntax Analyzer-> Semantic Analyzer-> Intermediate Code Generator-> Code Optimizer->Code Generator-> Target Program
Acronym:
SLSSICCT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what are the types of errors in the lexical analysis phase?

A
  1. Spelling Error
  2. Exceeding length of character or numeric constants
  3. Appearance of illegal characters
  4. Remove or Replace the character that should be present
  5. Transposition of characters

Basically, Misspellings of identifiers, keywords, or operators
Example: missing quotes from string

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what are the errors in the syntax analysis phase?

A
  1. Error in structure
  2. Unabalanced Parenthesis
  3. Missing operators

Misplaced Semicolons, extra or missing braces

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

what are the errors of the Semantic phase?

A
  1. Mismatches between the operators and operands

example: return statement of a void function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Logical errors:

A

anything from the incorrect reasoning on the part of the programmer
for example to use the assignment operator ‘=’
instead of “==” comparison operator

How well did you know this?
1
Not at all
2
3
4
5
Perfectly