Discussion
The parse tree and the abstract syntax tree differ in that the syntax tree
Answer: B
Correct answer: omits the nodes that carry no meaning beyond the grammar itself
A parse tree records every production applied, including the chains of single-child nodes that grammars need to express precedence and associativity. Most of those nodes convey nothing about the program.
An abstract syntax tree keeps only what matters - operators and operands - so it has fewer nodes, not more, and is the form later phases actually walk. Types are added by semantic analysis afterwards, and both trees are built by or from the parser.
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