[antlr-interest] Can Lexer Rules Have "returns" Clauses?
Kay Roepke
kroepke at classdump.org
Wed Nov 22 10:49:05 PST 2006
On 22. Nov 2006, at 16:45 , Randall R Schulz wrote:
> I gather the following rule is not valid, but it produces no complaint
> from ANTLR v3.0b5.
That's right, lexer rules cannot have arbitrary return values.
Getting an error message would be nice, but I think that might have
to wait until the rewrite of ANTLR's grammars in v3. I added a bug
report nonetheless, so it's no going to be forgotten.
You really are in bugreporting mood ;) <http://www.antlr.org:8888/
browse/ANTLR-48>
Thanks!
> DistinctObject
> returns [ String do ]
> : '"' ( ~( '"' | '\\' ) | '\\' '"' | '\\' '\\' )* '"'
> {
> $do = getText().substring(1, getText().length() - 1);
> }
> ;
>
--
Kay Röpke
http://classdump.org/
More information about the antlr-interest
mailing list