SEMANTIC ANALYSIS
ATTRIBUTE GRAMMARS
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
S-attributed
|
|
Inherited attributes
|
|
Both a and b
|
|
Syntax directed definition
|
Detailed explanation-1: -A parse tree showing the values of attributes at each node is called an Annotated parse tree. The process of computing the attributes values at the nodes is called annotating (or decorating) of the parse tree. Of course, the order of these computations depends on the dependency graph induced by the semantic rules.
Detailed explanation-2: -Attribute grammar is a medium to provide semantics to the context-free grammar and it can help specify the syntax and semantics of a programming language. Attribute grammar (when viewed as a parse-tree) can pass values or information among the nodes of a tree.
Detailed explanation-3: -Dependency graphs are used to determine an evaluation order for instances of attributes in a parse tree.