2080 12

CSC376 · 2080 · 5 marks

What is annotated parse tree? Define S-attributed grammar with an example.

What is annotated parse tree? Define S-attributed grammar with an example. [5]

Compiler Design and ConstructionChapter 2: Lexical, Syntax and Semantic AnalysisAnnotated Parse Tree

--- An annotated parse tree is a parse tree in which each node is labeled with its grammar symbol along with the values of its associated attributes. In Syntax-Directed Translation (SDT), semantic rules are used to compute attribute values at each node of the parse tree. When these computed attri...