Which one of the following statements is FALSE?
GATE CSE 2018Compiler Design › Lexical Analysis, Compilation Phases & LinkingVerified
GATE CSE 2018 PYQ: Which one of the following statements is FALSE?
- AContext-free grammar can be used to specify both lexical and syntax rules
- BType checking is done before parsingCorrect answer
- CHigh-level language programs can be translated to different Intermediate Representations
- DArguments to a function can be passed using the program stack
Answer
(B) Type checking is done before parsing
Approach
This is a 'which statement is FALSE' question from compiler design. Evaluate each statement against the standard phases of compilation: lexical analysis, syntax analysis (parsing), semantic analysis (type checking), intermediate code generation, code optimization, and code generation. The statement contradicting the correct ordering of these phases is the answer.
Type checking is a semantic-analysis activity that depends on the parse tree; it therefore happens after parsing, making statement B the false statement. The dominant community answer (weight 0.8) agrees, and the two lower-weight answers reinforce the same reasoning.
Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.