[antlr-interest] sometimes ya just gotta smile

Don Caton dcaton at shorelinesoftware.com
Fri Nov 26 07:47:01 PST 2004


> -----Original Message-----
> From: Bryan Ewbank [mailto:ewbank at synopsys.com] 
> Sent: Wednesday, November 24, 2004 2:58 PM
> To: antlr-interest at yahoogroups.com
> Subject: [antlr-interest] sometimes ya just gotta smile
> 
> 
> How many other people have been bit by having a grammar 
> production named "operator" while using C++?  I stared at the 
> code for quite a while before realizing that:
> 	public: void operator()
> is an illegal class member attempting to overload the 
> function interface to the class object.
> 

Yep.  So will a rule like this in a lexer:

  LT: '<' ;

because of a name clash with Antlr's internal LT() method.

It would be real nice if Antlr had the option of adding an underscore or
some configurable prefix to all generated method names, i.e.:

  options
  {
     methodPrefix = "rule_";
  }

--
Regards,
 
Don Caton
Shoreline Software, Inc.
 




 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
    antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 





More information about the antlr-interest mailing list