Question:

Which of the following statements is/are FALSE?}

Show Hint

Remember that L-attributed grammars are designed for top-down parsing, while synthesized attributes are naturally evaluated in bottom-up parsing.
Updated On: Jan 23, 2025
  • An attribute grammar is a syntax-directed definition (SDD) in which the functions in the semantic rules have no side effects
  • The attributes in an L-attributed definition cannot always be evaluated in a depth-first order
  • Synthesized attributes can be evaluated by a bottom-up parser as the input is parsed
  • All L-attributed definitions based on LR(1) grammar can be evaluated using a bottom-up parsing strategy
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is B

Solution and Explanation

Option (A): This is true. In attribute grammars, functions in semantic rules are required to have no side effects, as they must not interfere with other computations.
Option (B): This is false. L-attributed definitions allow evaluation in a depth-first order since inherited attributes are passed only along the parse tree edges and are computable in one depth-first pass.
Option (C): This is true. Synthesized attributes are computed from the values of the children nodes and can be evaluated in a bottom-up parsing strategy.
Option (D): This is false. While L-attributed definitions can be evaluated using top-down parsing, they are not inherently suitable for bottom-up parsing strategies. Final Answer: \[ \boxed{\text{(B), (D)}} \]
Was this answer helpful?
0
0

Top Questions on Indexed Address

View More Questions

Questions Asked in GATE CS exam

View More Questions