simpleparse - what is wrong with my grammar?

Mike C. Fletcher mcfletch at vrplumber.com
Mon Feb 25 15:55:22 CET 2008


Laszlo Nagy wrote:
...
> Is there any way I can specify precedence tables? Or do I have to use 
> a different parser generator then?
You normally specify them as 
top_precedence/second_precedence/last_precedence sets.  SimpleParse' 
limitation is with ambiguity, not with precedence.  SimpleParse will 
wind up "overparsing" noticeably for each operation, that is, it will 
parse "expr" and "word" once for each level of precedence.  SimpleParse 
is normally fast enough that you don't really care, but optimising those 
cases is something that's sat on my "would be nice" list for a long 
time.  Unlike separate lexing/parsing systems, it's a little more 
involved for SimpleParse to do that without losing the generality of the 
parsing approach (i.e. the flexibility of a non-lexed approach).

HTH,
Mike




More information about the Python-list mailing list