[antlr-interest] Can Lexer Rules Have "returns" Clauses?

Randall R Schulz rschulz at sonic.net
Wed Nov 22 07:45:27 PST 2006


Hi,

I gather the following rule is not valid, but it produces no complaint 
from ANTLR v3.0b5.

DistinctObject
returns [ String do ]
  : '"' ( ~( '"' | '\\' ) | '\\' '"' | '\\' '\\' )* '"'
    {
      $do = getText().substring(1, getText().length() - 1);
    }
  ;



Randall Schulz


More information about the antlr-interest mailing list