1.

In a bottom-up evaluation of a syntax directed definition its inherited attributes can do which of the following?(a) Always evaluated(b) Can beevaluatedif the definition is L attributed(c) Can beevaluatedif the definition has synthesized attributes(d) Never be evaluatedI got this question in semester exam.My enquiry is from Top-Down Parsing topic in chapter Topdown Parsing of Compiler

Answer»

Right answer is (b) Can beevaluatedif the definition is L attributed

For EXPLANATION I would SAY: A Syntax Directed Definition (SDD) is called S Attributed if it has only synthesized attributes. Also the L-Attributed Definitions contain both synthesized and INHERITED attributes but do not NEED to build a dependency graph to evaluate them.



Discussion

No Comment Found

Related InterviewSolutions