[antlr-interest] |! in antlr2

The Researcher researcher0x00 at gmail.com
Thu Apr 14 07:30:54 PDT 2011


Hi Ben,

I don't do ANTLR 2 any more, but found this.

http://www.antlr2.org/doc/lexer.html#lexicalrules


As a shorthand notation, you may suffix an alternative or rule with '!' to
indicate the alternative or rule should not pass any text back to the
invoking rule or parser (if nonprotected):

// ! on rule: nothing is auto added to text of rule.
rule! : ... ;

// ! on alt: nothing is auto added to text for alt
rule : ... |! ...;

Hope this helps, Eric


More information about the antlr-interest mailing list