Tree Traversal-based Evaluation


- Evaluates attributes during parse/syntax tree traversal
- Makes attribute grammar less expressive
- But often sufficient in practice
For computing synthesized attributes: postorder traversal of the parse/syntax tree

[S-attributed grammar](https://texonom.com/s-attributed-grammar-ae6502619b6b4727bd7b56647bcde470)


[L-attributed grammar](https://texonom.com/l-attributed-grammar-102c2ba3b2ad47f79a1f59887c9182b8)




### **Depends on the attribute types (inherited vs. synthesized)**
For synthesized attributes: postorder traversal of the tree
For inherited attributes: preorder traversal with children ordering







