This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: inherited idlist.type := type.spectype vardcl ::= idlist : type Problem 2. (ii) Decorated tree for A, B, C : real. Red lines are inherited. Blues line are synthesized. vardcl idlist type: REAL type spectype: REAL : stype spectype: REAL real idlist type: REAL ID type: REAL , ID type: REAL , idlist type: REAL ID type: REAL Problem 2. (iii) The solution neither S-attributed nor L-attributed. S-attributed grammars have no inherited attributes at all. The solution has inherited attributes. L-attributed grammars have left-to-right dataﬂow. The solution has right-to-left dataﬂow. Notice if the top level production rule was vardcl::= type : idlist then the dataﬂow would be left to right, and could be implemented using a L-attributed grammar....
View Full Document
- Spring '10
- Grammar, Left-wing politics, Bi-directional text, ID type, stype spectype