Error handling

4 views
Skip to first unread message

manu...@gmail.com

unread,
Oct 7, 2008, 6:19:26 PM10/7/08
to gazelle-users
Parser used in IDE editors are given incomplete inputs to read when
the programmer is typing its program.
And the incompleteness is generally in the middle of the program.

Is there plans in Gazelle to handle errors and recovering from them,
so that the IDE can resume parsing the rest of the input and finding
interesting information or errors.

Is there ideas on what to do with these errors: putting then in the
AST or putting them aside?

Joshua Haberman

unread,
Oct 7, 2008, 8:43:59 PM10/7/08
to gazelle-users
These are great questions. My current thinking on the subject is
this:

I think that error recovery of the sort you need for IDEs is very
similar to the error recovery you want in a compiler. In other words,
I think that each grammar should have one error recovery strategy that
is used by any program that uses the grammar.

I think that error recovery will be as simple as a function that has
full access to the parse state and can manipulate that parse state as
best as it can to recover from the error. And I think that they will
be stored off to the side.

There are several features I want to tackle before error recovery,
though. The biggest one is a way to ignore whitespace.

Josh
Reply all
Reply to author
Forward
0 new messages