Topic: HELP ! lex / Flex and and the link library


Author: een1n3cs@sun.leeds.ac.uk (B Millett)
Date: Tue, 14 Feb 1995 13:29:41 +0000 (GMT)
Raw View
I have a problem using the lexical analyser generator flex which is the Free software foundations version of lex.
 Up to now I have been compiling the code generated by flex in a linux enviroment using the command "gcc ****.c -lfl" where the -lfl mode includes the link library needed to compile flex.  However, I need to compile the code on a PC using the Microsofts Visual C++ compiler.  I therefore need to write/obtain the code of the flex library.  Is it available ?  If not, is it easy to write?

  Any suggestions appreciated.

   BEN MILLETT.







Author: vern@daffy.ee.lbl.gov (Vern Paxson)
Date: 15 Feb 95 00:01:39 GMT
Raw View
In article <1995Feb14.132941.4520@leeds.ac.uk>,
B Millett <een1n3cs@sun.leeds.ac.uk> wrote:
> I therefore need to write/obtain the code of the flex library.  Is it
> available ?  If not, is it easy to write?

It is available, it comes with the flex sources (which you can get from
ftp.ee.lbl.gov if for some reason you don't already have them).  If you
are using the latest flex release, 2.4.7, then the library is completely
trivial.  As a matter of fact, I've appended it in its entirety.

  Vern


/* libmain - flex run-time support library "main" function */

/* $Header: /home/daffy/u0/vern/flex/RCS/libmain.c,v 1.3 93/04/14 22:41:55 vern
Exp $ */

extern int yylex();

int main( argc, argv )
int argc;
char *argv[];
 {
 return yylex();
 }

/* libyywrap - flex run-time support library "yywrap" function */

/* $Header: /home/daffy/u0/vern/flex/RCS/libyywrap.c,v 1.1 93/10/02 15:23:09 ver
n Exp $ */

int yywrap()
 {
 return 1;
 }