[antlr-interest] joy! (tree parsing)

Sebastian Mies sebastian.mies at gmx.net
Wed Jun 29 02:31:13 PDT 2005


Hi Terence,

TP> So tree parsing error messages pretty much suck in ANTLR 2.x. I am
TP> building a simple C tree parser and I got a parse error:

TP> [program, declaration, block, stat, forStat, expr]: line 8:8  
TP> decision=<<57:1: expr : ( ^( EQEQ expr expr ) | ^( LT expr expr ) | ^
TP> ( PLUS expr expr ) | atom );>> state 0 (decision=7) no viable alt;
TP> token=[@45,76:76='=',<16>,8:8]
Nice!! :-)
So, if the stack track is available - next step whould be a
incremental parsing engine? at least it would be nice to save the
parser/lexer state at certain positions to restart parsing from
there until it matches another saved state.
Thats not incremental parsing in the common sense, but it would be
enough for most cases.

Sebastian.









More information about the antlr-interest mailing list