Discussion
Which one of the following statements is TRUE?
Answer: D
The true statement is LR(1) parsing is sufficient for deterministic context-free languages.
Every deterministic context-free language has an LR(1) grammar, and the languages accepted by deterministic pushdown automata are exactly those LR(1) parsers recognise, so an LR(1) parser suffices for any of them.
The others are false. LALR(1) is built by merging LR(1) states with the same core, and the merge can create reduce-reduce conflicts that the LR(1) parser did not have (it cannot create new shift-reduce conflicts). The symbol table is used throughout compilation, by the parser, semantic analysis and code generation, not only by the lexer. Data flow analysis is a compile-time technique for optimisation; run-time memory management, such as heap allocation and garbage collection, does not depend on it.
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development