[antlr-interest] yet more thoughts on error handling / recovery
Monty Zukowski
monty at codetransform.com
Mon Jun 28 21:19:31 PDT 2004
>
> Rather than print the grammar out as a string for use by the error
> reporting, perhaps the entire tree structure (i.e., the processed
> grammar) should be made available to the running parser. The grammar
> position would map to an actual AST node. The cost would be a slightly
> larger string (flattened AST as string) compared to the original
> grammar, but would potentially provide more grammar information to a
> reporting facility. Hmm...actually, since the trees have down/right
> pointers (not up/left) it would be hard to walk backwards to print out
> a larger portion of the grammar. Ok, forget that.
It's not _that_ big a deal to implement up/left pointers. See my GCC
grammar :) Just jump up to the enclosing alt and you're set.
Monty
ANTLR & Java Consultant -- http://www.codetransform.com
ANSI C/GCC transformation toolkit --
http://www.codetransform.com/gcc.html
Embrace the Decay -- http://www.codetransform.com/EmbraceDecay.html
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/antlr-interest/
<*> To unsubscribe from this group, send an email to:
antlr-interest-unsubscribe at yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list