parse tree has symbols not in the grammar?

Chad Whitacre chad at zetaweb.com
Wed Apr 27 10:32:33 EDT 2005


Terry,

Thanks for the reply.

> Did you not find them in grammar.txt, which you referenced, or 
> Grammar/Grammar is the source, which you did not.

I didn't find them in grammar.txt. I didn't find Grammar/Grammar because 
I was looking in an installed Python rather than the source (my mistake; 
I've found it now). I assumed that the two would the same.


> Guido has said that the 
> grammar in the ref manual, meant for human consumption, is equivalent to 
> but not quite the same as the grammar used to generate the parser, which 
> has to meet LL1 constraints.

Ok, thanks for the info. While I found a comment re: the ref manual 
being for human consumption[1], I didn't take this to mean that its 
grammar was actually not the same as the implementation grammar, only 
that it was set forth in English (hence, my assumption above).

Would there be any value, I wonder, in posting Grammar/Grammar with the 
rest of the docs, e.g., at doc/ref/grammar-parser.txt?

Thanks again for the sanity check!



chad

----------

[1] http://python.org/doc/ref/introduction.html




More information about the Python-list mailing list