
416 Appendix A
show direction in which the expansion or replacement takes place. Expansion starts from the LHS and
proceeds generally towards RHS.
Syntax Trees
A grammar can also be represented by an abstract syntax
tree. For example, the example grammar of an arithmetic
expression is shown in Fig. A.7.
In this tree, a node is either a NT symbol, a bullet (•)
or a T symbol. The interpretation of the tree is as follows:
NT The branches denote alternative productions; if it is a
leaf-node, then it is subject to further replacements by
the sub-tree under it.
• Denotes concatenation operation of its branches.
T The Terminal symbol stands for itself ...