help-flex
[Top][All Lists]
Advanced

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

RE: Flex/gcc compatibility


From: STEINBERG, PETER
Subject: RE: Flex/gcc compatibility
Date: Wed, 19 Nov 2003 14:33:25 -0600

As a start:
        There is a missing "typedef" for the "Equ" type used on line 8.

        The identifier "CurrentChar" is never defined.

        The identifier "CurrentLine never defined.

I know knowing about the SUN implementation of lex, but I would start by including the proper header file(s) or definitions in the "%{" "%}" section at the top of your ".l" file.

Peter Steinberg

-----Original Message-----
From: Gordon (Jake) Jacobs [mailto:address@hidden]
Sent: Wednesday, November 19, 2003 1:51 PM
To: address@hidden
Cc: Jacobs, Gordon
Subject: Flex/gcc compatibility


Hi,
 I'm trying to port some 10-year-old lex/yacc code from SUN
to a RedHat Linux8 machine which comes with flex/bison. I can
run flex on either the SUN or Linux box without any errors being
reported, yet when I try to compile the resulting c code, lex.yy.c,
I get tons of errors some examples of which are shown below:

asmLex.l:8: parse error before '*' token
asmLex.l:8: warning: data definition has no type or storage class
asmLex.l: In function `yylex':
asmLex.l:39: parse error before '<' token
asmLex.l: At top level:
asmLex.l:43: parse error before '|' token
asmLex.l:43: redefinition of `yy_start'
etc...

The errors occur with either gcc 2.95 or gcc 3.2 on either platform.

I've read the incompatibilities with lex and I use the -l flag yet I
still
get lots of basic parse errors. The lex code is fairly short and
attached below. Can anyone suggest why these problems are occurring or
any solutions for porting this simple lex script?

Thank you very much,
Gordon Jacobs


reply via email to

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