Mail Archives: djgpp/1997/04/16/21:04:04
From: | "Huang Chee Thong" <sg7537006 AT ntuvax DOT ntu DOT ac DOT sg>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | STDIN redirection
|
Date: | 16 Apr 1997 06:07:45 GMT
|
Organization: | Subscriber, Pacific Internet, Singapore
|
Lines: | 59
|
Message-ID: | <01bc4a2c$dd16b2c0$0100a8c0@hal9000>
|
NNTP-Posting-Host: | 202.42.136.129
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Hello,
I am using DJGPP v2.01 and I am learning to use flex (2.5.4) and bison
(1.25) for a school project. I compiled the example program from the ORA
lex & yacc book (the last example in chapter 1). When I try to run in a dos
box or under bash in win95 the program would only run once a while. For
exapmle the following: eng is the executable and input is a text file I
created using emacs. The output should
also be "Parsed a simple sentence." and "Parsed a compound sentence." the
last line of the input file never got to the program (I tried using redir -
same thing).
[cth d:/cth/source/lexyacc 10$] eng <input
[cth d:/cth/source/lexyacc 11$] eng <input
[cth d:/cth/source/lexyacc 12$] eng <input
[cth d:/cth/source/lexyacc 13$] eng <input
[cth d:/cth/source/lexyacc 14$] eng <input
[cth d:/cth/source/lexyacc 15$] eng <input
Parsed a simple sentence.
[cth d:/cth/source/lexyacc 16$] eng <input
[cth d:/cth/source/lexyacc 17$] eng <input
[cth d:/cth/source/lexyacc 18$] eng <input
Parsed a simple sentence.
Running the program without redirection it run ok with the same input as
the input file. However the program which should start up in to read in
stdin would also not run sometime. For example (the input I type when eng
runs are the same as the input file):
[cth d:/cth/source/lexyacc 50$] eng
[cth d:/cth/source/lexyacc 51$] eng
[cth d:/cth/source/lexyacc 52$] eng
verb is am are were was be being been do does did will would
verb should can could has have had go eat
adv very simply gently quietly calmly angrily
prep to from behind above below between
conj if then and but or
adj their my your his her its
pron I you he she it we they
noun school apple pie pies plane
she eat pie.
Parsed a simple sentence.
she eat pie or she go school.
Parsed a compound sentence.
^Z
parse error
[cth d:/cth/source/lexyacc 53$] eng
[cth d:/cth/source/lexyacc 54$] eng
[cth d:/cth/source/lexyacc 55$] eng
^Z
parse error
Note that I have to run eng several time before it will run.
Any solutions?.
Thanks.
Chee Thong.
- Raw text -