Date: Fri, 29 Mar 1996 14:56:36 -0700 (MST) From: Terry Lambert <terry@lambert.org> To: DARREND@novell.com (Darren Davis) Cc: DARREND@novell.com, leisner@sdsp.mc.xerox.com, hackers@freebsd.org, narvi@haldjas.folklore.ee, terry@lambert.org Subject: Re: Flex - Reply - Reply Message-ID: <199603292156.OAA06249@phaeton.artisoft.com> In-Reply-To: <s15bc5c7.012@fromGW> from "Darren Davis" at Mar 29, 96 10:47:33 am
next in thread | previous in thread | raw e-mail | index | archive | help
> 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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199603292156.OAA06249>
