Question
Which one of the following statements is FALSE?
Official answer and solution
- Official answer
- B
- From
- Official GATE 2018 answer key
Solution
Trace the sequence of standard compiler phases to evaluate the position of type checking relative to parsing.
The standard compiler front-end phases operate in the following order:
- Lexical Analysis (Scanning)
- Syntax Analysis (Parsing)
- Semantic Analysis (Type checking, scope resolution)
- Intermediate Code Generation
Type checking requires the syntax tree or abstract syntax tree produced by the parser. Therefore, type checking is performed after parsing, not before parsing. Statement B is FALSE.
Statements A, C, and D are all standard, valid facts about grammars, intermediate representations, and call stacks.
B
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2018 Computer Science and Information Technology (CS)
- Question
- 18 of 65, printed as CS Q.8
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.