Discussion
Consider the following two sets:
| Set X | Set Y | ||
|---|---|---|---|
| P. | Lexical Analyzer | 1. | Abstract Syntax Tree |
| Q. | Syntax Analyzer | 2. | Token |
| R. | Intermediate Code Generator | 3. | Parse Tree |
| S. | Code Optimizer | 4. | Constant Folding |
Which one of the following options is the CORRECT match from Set X to Set Y ?
Answer: B
The correct match is P - 2; Q - 3; R - 1; S - 4.
- The lexical analyzer reads characters and produces tokens (P-2).
- The syntax analyzer checks the token stream against the grammar and builds a parse tree (Q-3).
- The intermediate code generator works from the abstract syntax tree (R-1), a condensed form of the parse tree.
- Constant folding, evaluating constant expressions at compile time, is a code optimization (S-4).
The option P - 2; Q - 1; R - 3; S - 4 swaps the parse tree and the abstract syntax tree. Options pairing the lexical analyzer with constant folding misplace both, since a lexer only produces tokens.
No comment is present. Be the first to comment.
Loading…
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