[antlr-interest] "return" in rule code

Terence Parr parrt at jguru.com
Thu Nov 7 12:18:42 PST 2002


Hi Paul,

I strongly recommend not to do this.  Pretend it's not a method in this 
case and make ANTLR do the "right thing". :)

Ter

On Thursday, November 7, 2002, at 11:46  AM, Paul J. Lucas wrote:

> Is it "OK" to have a "return" statement in a rule?
>
> 	FOO
> 		: "foo" { if ( cond ) return; } "bar"
> 		;
>
> Will the above match only "foo" if cond is true, i.e., abort the 
> matching?
>
> - Paul
>
>
>
>
> Your use of Yahoo! Groups is subject to 
> http://docs.yahoo.com/info/terms/
>
>
--
Co-founder, http://www.jguru.com
Creator, ANTLR Parser Generator: http://www.antlr.org
Lecturer in Comp. Sci., University of San Francisco


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list