Discussion
Assertion (A): Terminals in a syntax directed definition have synthesised attributes but never inherited ones.
Reason (R): A terminal has no children and its value is supplied by the lexical analyser rather than computed by any rule.
Answer: D
Correct answer: Both A and R are true, and R is the correct explanation of A
Both are true and the reason gives the mechanism. A terminal is a leaf, so there is nothing below it to inherit from and nothing to synthesise from either - its value simply arrives from the lexical analyser and is treated as synthesised. Inherited attributes would require a rule computing them, and no production has a terminal on its left.
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