Attribute Grammars

CS 432 — Synthesized attributes · Postorder evaluation · Parse trees
Generated with the assistance of Claude Code (Opus 5.5)
— Enter to evaluate · ← / → to step · click a node to jump to it

Attribute Grammar

Each production has a rule that computes the node's cost from its children's. The boxed constants can be edited.

Changing a constant changes the rules, not the tree.

Current Step

Postorder: a node is evaluated only after all of its children

Highlights

Parse Tree

Only nonterminals carry a cost; terminals are leaves. The chips list the nodes in evaluation order.

being evaluatedvalue its rule reads evaluatednot yet evaluated