Mail Archives: djgpp/1997/04/18/03:57:27
On Thu, 17 Apr 1997 13:42:53 GMT, Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
wrote:
>
>
>On Thu, 17 Apr 1997, Programmed to death wrote:
>
>> I want to be able use c++ classes in both the lexer and the parser,
>> and possibly pass objects of a particular class back and forth between
>> the two.
>
>Caveat: I have never used flex with C++, so the advice below might be
>nothing but a wild goose.
>
>What version of flex did you use? The latest port of flex 2.5.4
>(v2gnu/flx254b.zip) comes with a program flexpp.exe that should be used
>for creating C++ lexers. A header file FlexLexer.h should also be used
>in C++ lexers. I believe this is all explained in the flex docs.
I am using Flex 2.5.2, Bison 1.24, and gcc v2.7.2.1. I took a
look at FlexLexer Scanner class, it looks interesting but i haven't
heard about anyone swearing by it yet.
I am trying to keep the whole project compilable using
gcc, lex, and yacc. So i would rather not delve into the Flex scanner
Class right now. I have the yacc compatiblity option on in Bison
and am trying to keep to standard lex.
Everyone should have gcc though... so I will use c++ freely
where it doesn't get in the way of lex and yacc compatibility.
By the way, Chris Croughton's suggestions worked... I have
uploaded the fixed code in reply to his post.
Programming the fun way
- Raw text -