You just call them spreadsheets.
Change a number on either side. Watch everything update.
Every concept in a spreadsheet has a direct parallel in an attribute grammar.
| Spreadsheet | Attribute Grammar | |
|---|---|---|
| Cell | = | Node in a tree |
| Formula | = | Equation |
| Cell value | = | Attribute value |
| Formula dependencies | = | Attribute dependencies |
| Auto-recalculation | = | Evaluation |
| "The spreadsheet figures out what order to calculate" |
= | "The framework figures out what order to evaluate" |
The analogy only gets stronger at scale.
A spreadsheet with 5 cells is easy. A spreadsheet with 50,000 cells needs Excel.
A tree with 3 nodes is easy to hand-code. A tree with 50,000 nodes needs an AG framework.
As trees grow, hand-coded complexity explodes. Framework complexity stays flat.
Spreadsheets mostly compute bottom-up. But attribute grammars can also pass information down the tree. These are called inherited attributes.
depth is an inherited attribute: each parent tells its children "you are one level deeper than me." It flows downward.
size is a synthesized attribute: each node reports its subtree size upward to its parent.
Information flowing both ways at once — that is what makes attribute grammars more powerful than a flat spreadsheet. And the framework handles all of it automatically.