Getting some more info about from ParseError.

4 views
Skip to first unread message

Václav Haisman

unread,
Nov 29, 2006, 3:42:33 AM11/29/06
to pyggy
Hi,
I am using Pyggy to parse our simple DSL. Most of the time it is just
simple expressions. While the expressions are by the grammar everything
works fine. The problem is that when the expression is bad i.e. '(1 + 2'
or '1 + / 2' the thrown ParseError exception has very little info about
the error except the bad token and its text. It would be very useful if
I could get list of expected tokens following the last good token.

Is it possible to get the information somewhere from the internals of
the parser's GLR class? I tried several hacks but since I do not really
understand the algorithm I was never able to get what I wanted. The main
problem seems to be to get the list of last good states from the parser.
After that I think it should be possible to get the list of expected
tokens from the acttab's keys or from goto tab's maybe.

It would be really really nice to have this feature :)

--
Vaclav Haisman

Václav Haisman

unread,
Jan 26, 2007, 3:22:12 AM1/26/07
to pyggy
No activity at all :(
C'mon, somebody say something...

--
VH

Reply all
Reply to author
Forward
0 new messages