Re: Name clash with token type BEGIN

2009-12-31 Thread Luca
Il 29/12/2009 21.28, Joel E. Denny ha scritto: On Tue, 29 Dec 2009, August Karlstrom wrote: Joel E. Denny wrote: I'm guessing your parser.h is included in a scanner generated by Flex, which defines the macro BEGIN. Yes, that's the case. Do you know if there is there a way around this or do

Name clash with token type BEGIN

2009-12-29 Thread Karl Landström
Hi, According to section 1.2 in the Bison manual "A terminal symbol that stands for a particular keyword in the language should be named after that keyword converted to upper case". When I follow this convention however, I get a syntax error and a warning in parser.h where the token type for t

Re: Name clash with token type BEGIN

2009-12-29 Thread August Karlstrom
Joel E. Denny wrote: [...] I agree. Of course, we're probably a few decades too late to change the default Flex behavior, which is inherited from Lex and specified by POSIX. However, it would be nice if Flex provided an option to avoid namespace pollution. (If there's something already, I mi

Re: Name clash with token type BEGIN

2009-12-29 Thread Joel E. Denny
On Tue, 29 Dec 2009, August Karlstrom wrote: > Joel E. Denny wrote: > > I'm guessing your parser.h is included in a scanner generated by Flex, which > > defines the macro BEGIN. > > Yes, that's the case. Do you know if there is there a way around this or do I > have to add a prefix to the token (

Re: Name clash with token type BEGIN

2009-12-29 Thread August Karlstrom
Joel E. Denny wrote: I'm guessing your parser.h is included in a scanner generated by Flex, which defines the macro BEGIN. Yes, that's the case. Do you know if there is there a way around this or do I have to add a prefix to the token (or all tokens for sake of consistency)? Obviously, the

Re: Name clash with token type BEGIN

2009-12-29 Thread Joel E. Denny
On Tue, 29 Dec 2009, August Karlstrom wrote: > When I follow this convention however, I get a syntax error and a > warning in parser.h where the token type for the keyword BEGIN is defined: > > error: expected identifier before ‘(’ token > warning: "BEGIN" redefined > > If I change > > %token B

Name clash with token type BEGIN

2009-12-29 Thread August Karlstrom
Hi, According to section 1.2 in the Bison manual "A terminal symbol that stands for a particular keyword in the language should be named after that keyword converted to upper case". When I follow this convention however, I get a syntax error and a warning in parser.h where the token type for th