Derivations and Parse Tree
What is a Parse Tree?
Parse tree is a hierarchical representation of terminals or non-terminals.
- The terminals or Non-terminals (Symbols) represent the derivation of the grammar to yield input strings.
- The root of the parse tree must be the starting symbol of the grammar.
- The terminals are the roots of the parse tree.
- The inner nodes are the grammar productions.
The rules for drawing a Parse Tree
- All leaf nodes need to be terminals
- All inner nodes need to be non-terminals.
- In-order traversal gives the original input string.
Reference Link
