Attribute Grammars: Difference between revisions
From Wiki**3
No edit summary |
|||
Line 22: | Line 22: | ||
* [[Attribute Grammars/Exercise 9: Text relevance|Exercise 9: Text relevance]] (Teste 2, 2011/2012) | * [[Attribute Grammars/Exercise 9: Text relevance|Exercise 9: Text relevance]] (Teste 2, 2011/2012) | ||
* [[Attribute Grammars/Exercise 10: Expressions and bases|Exercise 10: Expressions and bases]] | * [[Attribute Grammars/Exercise 10: Expressions and bases|Exercise 10: Expressions and bases]] | ||
* [[Attribute Grammars/Exercise 11: Operadores Lógicos|Exercise 11: Operadores Lógicos]] (Teste 2, 2014/2015) | |||
* [[Attribute Grammars/Exercise 12: Operadores Lógicos|Exercise 12: Operadores Lógicos]] (Teste 2, 2014/2015) | |||
[[category:Compiladores]] | [[category:Compiladores]] | ||
[[category:Ensino]] | [[category:Ensino]] |
Revision as of 17:53, 22 June 2015
Topics: attributes in grammar symbols; syntax-directed evaluation.
Synthesized attributes: passed from child nodes to parent nodes.
Inherited attributes: may be passed from parent- to child nodes or between siblings.
S-attributed grammars: only synthesized attributes.
L-attributed grammars: inherited attributes are only dependent on the parents' attributes or on the older siblings' (i.e., when evaluating left-to-right, only previously seen attributes are needed).
Exercises
- Exercise 1: Traffic Light
- Exercise 2: Numbers
- Exercise 3: Expressions
- Exercise 4: Expressions with bases (1)
- Exercise 5: Expressions with bases (2)
- Exercise 5: Expressions with percentages
- Exercise 7: Lines, characters, and CRCs (Teste 2, 2009/2010)
- Exercise 8: Arithmetic (Teste 2, 2010/2011)
- Exercise 9: Text relevance (Teste 2, 2011/2012)
- Exercise 10: Expressions and bases
- Exercise 11: Operadores Lógicos (Teste 2, 2014/2015)
- Exercise 12: Operadores Lógicos (Teste 2, 2014/2015)