Mail Archives: djgpp/1997/06/06/03:22:34
On Thu, Jun 05, 1997 at 11:06:56AM -0700, Tron Thomas wrote:
> I reading the book "Lex and Yacc" by John R. Levine, Tonay Mason, and
> Doug Brown. I am using Flex version 2.5.3 and Bison version 1.25 for
> MS-DOS to run their examples, and I'm compiling the programs using
> Visual C++ 4.2 on Windows '95.
>
> I created the program in example 1-7 (a Yacc Parser) of chapter one, but
> I'm not sure how I'm supposed to run it. When I just try to launch it,
> the program crashes. This is because the main function in the file
> ch1-05.y is defined as follows:
>
#include <stdio.h> <<<<<<<<<<<<
> extern FILE *yyin;
>
> main( )
> {
yyin=stdin; <<<<<<<<<<<<
> while(!feof(yyin)){
> yyparse( );
> }
> }
>
> When I trace through this code yyin = 0 causing the program to crash on
> the call to feof.
>
> Can somebody tell me what I need to do to get this program to run?
You have to decide what yyin is suppposed to be somewhere in your program,
whether the parser reads from a file or stdin for example.
--
--
Chris Christoph P. U. Kukulies kuku AT gil DOT physik DOT rwth-aachen DOT de
- Raw text -