[antlr-interest] Support for .* tree rewrite rules

Michael LeBlanc Mike at LeBlanc-Engineering.com
Wed Nov 21 10:59:40 PST 2007


The fix is to avoid mixing lexer constructs in a parser rule.  Your  
phrase

	'{' (options {greedy=false;} : .)* '}'

should be recast as a lexer rule like

	FBODY: '{' (options {greedy=false;} : .)* '}' ;

Your parser rule becomes

	function:    'function' f=ID '(' ID? (',' ID)* ')' FBODY -> ^ 
(FUNCTION $f);


More information about the antlr-interest mailing list