help-bison
[Top][All Lists]
Advanced

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

#include in lex.yy.c


From: cwhite
Subject: #include in lex.yy.c
Date: Wed, 19 Sep 2007 17:55:47 -0700 (PDT)

Hi, I'm using Flex 2.5.4a and Bison 2.1. I'd like to know how to #include my
classes in flex generated lex.yy.c. I need it for the %union part. When I
put #include MyClass I get a hundred of these kinds of errors:

c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\cstdio(18) :
error C2143: syntax error : missing '{' before ':'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\cstdio(18) :
error C2059: syntax error : ':'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\cstdio(18) :
error C2143: syntax error : missing '{' before ':'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\cstdio(18) :
error C2059: syntax error : ':'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\cstdio(18) :
error C2143: syntax error : missing '{' before ':'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\cstdio(18) :
error C2059: syntax error : ':'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\cstdio(19) :
error C2143: syntax error : missing '{' before ':'
...

When I put extern "C++" around the includes I get this:
fatal error C1189: #error :  "eh.h is only for C++!"

Googling this, the suggested solution was to compile lex.yy.c as C++ file. I
did that and it compiled without errors but when I run it, it doesn't
tokenize anymore.

Thanks. 

(I tried posting this in Flex-Help but for some reason my email disappeared.
I don't know if it's a problem with Gmail or their mailing list.)


-- 
View this message in context: 
http://www.nabble.com/-include-in-lex.yy.c-tf4484640.html#a12788915
Sent from the Gnu - Bison - Help mailing list archive at Nabble.com.





reply via email to

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