Let’s see another example of parse tree. As another example, consider the following grammar:
S ::= ( L )| a
L ::= L , S | S
Under this grammar, the parse tree of the sentence (a,((a, a), a)) is:
S
/ | \
( L )
/ | \
L , S
| / | \
S ( L )
| / | \
a L , S
| |
S a
/ | \
( L )
/ | \
L , S
| |
S a
|
a
Wednesday, June 27, 2007
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment