| Parse Trees and Ambiguity |

P and
is the
string of labels found on the node N's children.
A
and
y = 

where

Vt*,
,

(Vt U Vn)* and ( A,
)
P
we say that y can be directly derived leftmost from x.
In this case we write x
y .
A
and
y = 

where

Vt*,
, 
(Vt U Vn)* and ( A,
)
P
we say that y can be directly derived rightmost from x.
In this case we write x
y .
0,
1,
2, ... ,
m all in
(Vt U Vn)*
such that
i
i+1 ,
0 , and
m .
y .
0,
1,
2, ... ,
m all in
(Vt U Vn)*
such that
i
i+1 ,
0 , and
m .
y .
Intuitively, a derivation is rightmost (leftmost) if at each step it is
the rightmost (leftmost) non-terminal that is replaced by the
right-hand side
of some production.
The first derivation shown earlier happens to be a leftmost derivation of x a x z y y in G.
| Parse Trees and Ambiguity |