help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Enum for token '0', EOF


From: Frans Englich
Subject: Enum for token '0', EOF
Date: Wed, 28 Jun 2006 15:01:38 +0000
User-agent: KMail/1.8.50

I am using a hand-written tokenizer unfortunately(would be more practical to 
use Flex), and is using yytokentype in order to increase type safety of the 
code.

A problem arrives when I need to return EOF, the '0' token. It requires me to 
engage in static_cast'ing 0 to yytokentype, which is ugly and error prone.

Is there any clean solution to this on the Bison side? E.g, can I somehow 
generate a token(such as with %token) for EOF?


Cheers,

                Frans




reply via email to

[Prev in Thread] Current Thread [Next in Thread]