Compiler Design
Lexical Analysis & Parsing
GATE 2018
Medium
Which one of the following statements is FALSE?
- AContext-free grammar can be used to specify both lexical and syntax rules
- Type checking is done before parsing
- CHigh-level language programs can be translated to different Intermediate Representations
- DArguments to a function can be passed using the program stack
Explanation
Type checking is a semantic-analysis activity that happens AFTER parsing (syntax analysis) produces a parse/syntax tree — not before. The other three statements are all true: CFGs technically can specify lexical rules too (regular is a subset of context-free); different back-ends can target different IRs; function arguments are commonly passed via the call stack.
Source: GATE CS 2018 (2018)
This question is part of a 15-day revision cycle — sign in and Project Forge will bring it back the day before you'd forget it.