[antlr-interest] The AST thus far before an error

Paul J. Lucas pauljlucas at mac.com
Mon Nov 22 16:56:32 PST 2004


On Mon, 22 Nov 2004, Terence Parr wrote:

> You can probably toss in an exception handler on each rule which 
> prevents it from rippling back up the call chain.  Would that work?

	Maybe, but that means I have to do it for every single rule in
	the grammar (there are 190 of them for XQuery).

> Or I think an option will simply turn off all automatic recovery.

	Turning it on helps, but my point is that the Java code
	generated by ANTLR adds to the AST upon returning from a
	function via returnAST.  What it ought to do is add to the AST
	*immediately*, i.e., as soon as it has enough information to
	create the current AST node, do so and add it to the tree
	immediately.  Then whatever error-handing is (or isn't) in
	place is irrelevant.

	- Paul




 
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