From owner-freebsd-hackers Fri Mar 29 14:02:21 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id OAA23164 for hackers-outgoing; Fri, 29 Mar 1996 14:02:21 -0800 (PST) Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.211]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id OAA23150 for ; Fri, 29 Mar 1996 14:02:15 -0800 (PST) Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id OAA06249; Fri, 29 Mar 1996 14:56:36 -0700 From: Terry Lambert Message-Id: <199603292156.OAA06249@phaeton.artisoft.com> Subject: Re: Flex - Reply - Reply To: DARREND@novell.com (Darren Davis) Date: Fri, 29 Mar 1996 14:56:36 -0700 (MST) Cc: DARREND@novell.com, leisner@sdsp.mc.xerox.com, hackers@freebsd.org, narvi@haldjas.folklore.ee, terry@lambert.org In-Reply-To: from "Darren Davis" at Mar 29, 96 10:47:33 am X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > Yes, I allready tried the -l option with about the same effect. > bash$ lex -V > lex version 2.4.7 > bash$ > > bash$ make > lex -l -n -t ./scanner.l >scanner.c > cc -c -O -DBSD -ansi -w scanner.c > ./scanner.l: In function `yylex': > ./scanner.l:113: `yysptr' undeclared (first use this function) Looks like a bogus %union in your yacc grammer, or your yacc not being done before your lex. %union { char *yysptr; char yytcharl char yysbuf[ SOMEBUFSIZE]; %} Might be a partial fix... > ./scanner.l:113: (Each undeclared identifier is reported only once > ./scanner.l:113: for each function it appears in.) > ./scanner.l:400: `yytchar' undeclared (first use this function) > ./scanner.l:400: `yysbuf' undeclared (first use this function) > ./scanner.l: At top level: [ ... ] > ./scanner.l:932: parse error before `=' > ./scanner.l:937: conflicting types for `yy_c_buf_p' > scanner.c:203: previous declaration of `yy_c_buf_p' I've seen these exact warning in an uncorrected "parse a command line" lexer in the O'Reilly "lex & yacc" book; fixes are in appendix E of that same book... [ ... type conflicts ... ] generally the result of '=' constructs in the yacc grammar. See the differences in the O'reilly sample code for flex vs. lex for the chapter 5 examples. Sample code may be obtained from uunet in the O'Reilly publication section. > I do not get a single error while compiling this under UnixWare 2.1 (no > surprise.) Yeah; flex also does not support yylineno -- it's undocumented and it's not POSIX. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.