help-flex
[Top][All Lists]
Advanced

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

Re: about using yacc and lex in Visual C++ enviroment


From: John W. Millaway
Subject: Re: about using yacc and lex in Visual C++ enviroment
Date: Thu, 6 Jun 2002 20:53:43 -0700 (PDT)

> I am participating a project, in which I need to use Yacc and Lex in the
> Visual C++ 6.0 environment. But there're always errors when I try to
> generate the EXE file. I am told to add "/TC" option in "Project Settings"
> dialog. But then I found I can't use the the good features of C++. I can
> only write code in C, not C++!
> 
> My Yacc version is bison++ 1.21-5, and my Lex version is flex 2.5.4.

flex scanners are meant to compile cleanly by both C and C++ compilers. You
should have no problems using C++ in your flex scanner actions. I don't know if
this is true for bison parsers.

Note: flex-2.5.4 scanners #include the file "<unistd.h>", which is NOT present
on Microsoft systems. There is a simple solution: create an empty file named,
"unistd.h", and add that file to your project. Insert the following line in
your .l file:
    %option noread always-interactive

-John

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com



reply via email to

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