help-flex
[Top][All Lists]
Advanced

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

Flexing old code


From: Johan Glimming
Subject: Flexing old code
Date: Sun, 13 Feb 2005 19:38:21 +0100

Hi,

I am trying to brush up some good old theorem prover/specification language implementation. This is some 10-year-old lex/yacc code from SUN and the new target platform modern Solaris (and also a Mac OS X BSD) with flex/bison. I have never before tried to use yacc/flex and I therefore wonder if someone can advise me on the following error.

The error is actually from yacc:

cc  y.tab.c -c -o yacc.o
yacc.y: In function `yyparse':
yacc.y:292: error: `yytext' undeclared (first use in this function)
yacc.y:292: error: (Each undeclared identifier is reported only once
yacc.y:292: error: for each function it appears in.)
In file included from yacc.y:302:
modlex.c: At top level:
modlex.c:267: error: `yytext' used prior to declaration
make: *** [yacc.o] Error 1

(identical error on both platforms, with gcc 3.3 in the Mac OS X case)

But I thought that it perhaps could be traced back to the file modlex.l for which the following command is performed:

   lex -t modlex.l > modlex.c

The file modlex.l contains, at the very end:

  .               {return yytext[0];}

which seems related.

Many thanks for any advise on this,

Johan Glimming





reply via email to

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