Mail Archives: djgpp/1997/06/05/20:20:20
From: | Tron Thomas <tron DOT thomas AT sierra DOT com>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Can't get YACC parser to run
|
Date: | Thu, 05 Jun 1997 11:06:56 -0700
|
Organization: | Sierra On-Line
|
Lines: | 23
|
Message-ID: | <33970040.7AF0@sierra.com>
|
NNTP-Posting-Host: | 198.107.212.165
|
Mime-Version: | 1.0
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
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:
extern FILE *yyin;
main( )
{
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?
- Raw text -