[antlr-interest] [C target] #define clashes: would itbe possible to add ANTLR_ prefix to automatically generated macros?

Jim Idle jimi at temporal-wave.com
Tue Aug 5 10:22:51 PDT 2008


On Tue, 2008-08-05 at 08:45 +0200, Martin Hans wrote:
> Hi,
> 
> I think ANTLR could be more helpful than it is in this situation,
> simply by issuing an clear error message if the grammar uses a
> reserved word. 

Well, that would mean that the the target independent code generator
would have to cal the target code generator to ask about keywords, but
as this is sometimes context sensitive it would be bound to get it wrong
sometimes. We need to document this more clearly. The C compiler usually
gives you a strong hint as to what is going on, but other compilers may
not be so good. 


> It took me a while to figure out that “match” is reserved when using
> the python target because the parser base class uses that method name
> for something else. Without the error message we are left to debugging
> the name clashes from obscure syntax errors or parsers that don’t work
> as expected.
> 
>  
> 
> As a newbie this was the largest hurdle in getting started with ANTLR.


This needs to go into the getting started docs basically, because
everybody reads those right? ;-)

Jim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080805/3d75c570/attachment.html 


More information about the antlr-interest mailing list