Lec 01. Grammar, Derivations, Parse Tree
Lec 01. Grammar, Derivations, Parse Tree
L(G) = {w | w ϵ ∑*, s ⇨* W}
be generated in this manner.
RMD
E→E+E E
E→E*E E*E
E→E=E E+E *E
E → I’D I’D + E * E
E → I’D I’D + I’D * E
E → I’D I’D + I’D * I’D
Parse Tree
A parse Tree is a graphical representation of a derivation that filters
out the order in which productions are applied to replace non
terminals.
Each interior nod of a parse tree represents the application of a
production.
The interior node is labeled with the non terminal A in the head of
the productions.
The children of the node are labeled, from left to right, by the
symbol in the body of the production by which this A was replaced
during the derivations.
Parse Tree
Example: -(I’d + I’d )
E
- E
( + )
I’d I’d
The leaves of a parse tree are labeled by non terminal or terminal, and read from
left to right constitute a sectional form, called the yield or frontier of the tree.
Any Question?