[DGD] Re: parse_string() and ambiguity
S. Foley
zeppo1 at mindspring.com
Fri Oct 24 22:48:41 CEST 2003
Erwin Harte writes:
> But there is only one way to match the tokens to the rules and that's
> what is what you're talking about with respect to 'ambiguous'.
Assuming a certain definition of 'way', yes.
Consider the string input to parse string 'I run' and the same lame grammar:
SENTENCE : SUBJECT PREDICATE /* rule 1*/
SUBJECT : word /* rule 2*/
PREDICATE : word /* rule 3*/
'I run' is tokenized to ({ word, word }) which can be arrived at first by
application of rule #1, then #2, and then #3, or via application of #1, #3,
and then #2. The bottom line is that the difference in order of application
isn't relevant?
Is it the case then that parse trees only differ from other parse trees with
respect to differences in the combinations of the applied production rules?
That is to say, any permutation of the same combination of production rules
necessarily leads to the same parse tree?
Thanks. I really appreciate the help.
_________________________________________________________________
List config page: http://list.imaginary.com/mailman/listinfo/dgd
More information about the DGD
mailing list