[antlr-interest] Antlr 3 doesn't like '%' operator in actions?

Jim Idle jimi at temporal-wave.com
Thu Jun 21 11:12:56 PDT 2007



> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of Wincent Colaiuta
> Sent: Thursday, June 21, 2007 10:43 AM
> To: Bernardo Elayda
> Cc: antlr-interest at antlr.org
> Subject: Re: [antlr-interest] Antlr 3 doesn't like '%' operator in
> actions?
> 
> El 21/6/2007, a las 19:18, Bernardo Elayda escribió:
> 
> > invalid StringTemplate % shorthand syntax '%'
> 
> 
> I think it would be nice if ANTLR shielded grammar authors from that
> particular implementation detail, but it's the way things are for now.

Well, short of having a parser for every possible action target I don't see what it could do.

> 
> Be aware that there are some lexer-related cases in which even
> escaping the special characters doesn't work (see <http://
> www.antlr.org/pipermail/antlr-interest/2007-June/021212.html>).

This isn't what you think it is. It isn't a string template reference, it is because the search for $reference in the action code is being applied to that @lexer::header text for some reason, but not to the @header text. I thinks you are trying to reference $Id and then gives an error that you are trying to reference this outside a rule.

This probably needs a bug report Ter?

Jim


More information about the antlr-interest mailing list