`error' element in parser

1 view
Skip to first unread message

Werner LEMBERG

unread,
Jun 21, 2005, 8:39:14 AM6/21/05
to py...@googlegroups.com

Tim,


bison and other parsers provide an `error' token to gracefully handle
syntax errors. How can this be emulated in pyggy?


Werner

David Vallejo Fernández

unread,
Jun 21, 2005, 10:10:17 AM6/21/05
to py...@googlegroups.com
Hello! As the error token does not exist in PyGgy, I could not control
this error kinds. I though that a rule that catch all would be a
'solution', but it will generate a lot of ambiguities.

I think the best solution will be create a reserved token which controls
this topic. I would like to help, but I currently have not time.
However, if the idea is good for you, I will help with it.

David Vallejo.

Tim Newsham

unread,
Jun 22, 2005, 5:31:05 PM6/22/05
to py...@googlegroups.com
> bison and other parsers provide an `error' token to gracefully handle
> syntax errors. How can this be emulated in pyggy?

I dont have a good answer for this right now. GLR parsers
operate a little differently in that they will explore
several different possible parses and drop a parse if
it turns out to be erroneous. This could make error handling
more difficult (although maybe not). I'll have to think
about this a little more before coming up with a solution.
Unfortunately I am very busy at the moment and I dont
expect to be able to get around to this for at least a few
weeks.

If anyone has ideas, I'd be glad to hear them. Off the
top of my head I think a scheme with an error token
that gets invoked only when there is a single viable
parse (ie. all other parallel parses have already
been discarded) might work.

> Werner

Tim Newsham
http://www.lava.net/~newsham/

Tim Newsham

unread,
Jun 22, 2005, 6:56:04 PM6/22/05
to py...@googlegroups.com
> I dont have a good answer for this right now.

I just reviewed the bison error recovery mechanism and I
think it should be fairly straight forward to apply it
to pyggy. This is high on my TO DO list.

Tim Newsham
http://www.lava.net/~newsham/
Reply all
Reply to author
Forward
0 new messages