Attribute Grammars

Given CFG $G = (N,T,P,S)$, Attribute grammar is \((G,S,I,R)\)



Meaning of Attribute Grammars



APS syntax (part 1)



APS syntax (part 2)



Tiny example


\begin{program}
\par module TINY[] begin
phylum Wood;
\par constructor branch(x...
...b=branch(?x,?y) begin
b.leaves := x.leaves + y.leaves;
end;
end;
\end{program}



John Tang Boyland
2004-09-30