Flex: token value more than what regexp matches

2005-07-07 Thread Frans Englich
Hi, I have the problem that the value of a token appears to be more than what the regexp matches. Here's my (snipped) flex file: %} %option 8bit %option noyywrap %option nounput QName [a-zA-Z-]+:[a-zA-Z-]+ NCName [a-zA-Z-]+ Digit [0-9] %% {NCName}{

Re: %union, C++, symbol types

2005-07-07 Thread Hans Aberg
On 6 Jul 2005, at 11:40, Evan Lavelle wrote: I'd like to pass a token class from Flex to Bison (ideally, a tr1::shared_ptr - a reference counted smart pointer class). However, in Bison itself I need to deal with a number of symbol types - tokens, AST nodes, and so on. This means that I n

Re: %union, C++, symbol types

2005-07-07 Thread Laurence Finston
On Wed, 6 Jul 2005, Evan Lavelle wrote: > Is there anything new in Bison that could help with this (I'm on > 1.875c)? Or can anyone suggest a work-around? > I like using 'void*' as one of the types in the '%union'. I then use 'static_cast' in the rules, since the actual type is known at compile-t

Re: %union, C++, symbol types

2005-07-07 Thread Tim Van Holder
Evan Lavelle wrote: > I'd like to pass a token class from Flex to Bison (ideally, a > tr1::shared_ptr - a reference counted smart pointer class). However, in > Bison itself I need to deal with a number of symbol types - tokens, AST > nodes, and so on. > > This means that I need to use a %union, bu