Difference between revisions of "Attribute Grammars"

From Wiki**3

(Exercises)
(Exercises)
Line 17: Line 17:
 
* [[Attribute Grammars/Exercise 4: Expressions with bases (1)|Exercise 4: Expressions with bases (1)]]
 
* [[Attribute Grammars/Exercise 4: Expressions with bases (1)|Exercise 4: Expressions with bases (1)]]
 
* [[Attribute Grammars/Exercise 5: Expressions with bases (2)|Exercise 5: Expressions with bases (2)]]
 
* [[Attribute Grammars/Exercise 5: Expressions with bases (2)|Exercise 5: Expressions with bases (2)]]
* [[Attribute Grammars/Exercise 6: Expressions with bases percentages|Exercise 5: Expressions with percentages]]
+
* [[Attribute Grammars/Exercise 6: Expressions with bases percentages|Exercise 6: Expressions with percentages]]
 
* [[Attribute Grammars/Exercise 7: Lines, characters, and CRCs|Exercise 7: Lines, characters, and CRCs]] (Teste 2, 2009/2010)
 
* [[Attribute Grammars/Exercise 7: Lines, characters, and CRCs|Exercise 7: Lines, characters, and CRCs]] (Teste 2, 2009/2010)
 
* [[Attribute Grammars/Exercise 8: Arithmetic|Exercise 8: Arithmetic]] (Teste 2, 2010/2011)
 
* [[Attribute Grammars/Exercise 8: Arithmetic|Exercise 8: Arithmetic]] (Teste 2, 2010/2011)

Revision as of 18:46, 29 March 2017

Compiladores
Introdução ao Desenvolvimento de Compiladores
Aspectos Teóricos de Análise Lexical
A Ferramenta Flex
Introdução à Sintaxe
Análise Sintáctica Descendente
Gramáticas Atributivas
A Ferramenta YACC
Análise Sintáctica Ascendente
Análise Semântica
Geração de Código
Tópicos de Optimização

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