[antlr-interest] ANTLR3.0b2 - rule STRING uses rewrite syntax or operator with no output option

Oliver Zeigermann oliver.zeigermann at gmail.com
Thu Jul 27 01:56:14 PDT 2006


2006/7/20, Terence Parr <parrt at cs.usfca.edu>:
>
> On Jul 18, 2006, at 8:57 AM, David CROSSON wrote:
>
> > I got a grammar  with this rule :
> > ...
> > options {
> >     filter=true;
> >     output=AST;
> > }
> > ...
> > STRING : '"'! (~'"')* '"'! ;
> > ...
> >
> > Using latest release of ANTLR I now got this error :
> > "jrockit.g:246:13: rule STRING uses rewrite syntax or operator with
> > no output option"
> > I'm using the ! operator elsewhere without any problem but within a
> > lexer rule I got this strange
> > errormessage, no error with ea8.
>
> Wow!  Oh, that's a lexer rule with ! in it.  Illegal.  Remove and it
> should work.

But what about the effect David wanted to have, namely strip the
quotes from the lexer token. How to achieve that? Is it possible to
send single charactes to a different (e.g. 99) channel?

Oliver


More information about the antlr-interest mailing list