First page Back Continue Last page Summary Graphic
Adding Builders
Start with the language grammar from the book
- exp = term | exp + term | exp - term
- term = fac | fac * atom | fac / atom
- atom = id | ( exp )
Add builder symbols; points during parsing where tree nodes are built
- exp = term | exp + term OP | exp - term OP
- term = fac | fac * atom OP | fac / atom OP
- atom = id | ( exp ) BR
This needs doing first, otherwise you lose info, eg about associativity