Connect Speed
Ron Srodawa
srodawa at vela.acs.oakland.edu
Fri May 3 15:00:23 AEST 1991
In article <1991May2.233629.25541 at cse.uta.edu> rahim at cse.uta.edu (Khalid Rahim) writes:
>YACC code. I want to open up a file and should
>be able to read it from YACC code.
YACC code normally reads from standard input. It calls a routine named
yylex to read each token. If you wrote your own, then the solution
would be obvious. I assume you used lex to generate this. List the
entries in the library gotten by -ll (the lex library). One of these
will obviously be the read routine. Write your own with the same name.
Now that can open your file.
BTW, the source code for the -ll and -ly routines is quite trivial.
Some of it is given in the lex and yacc documentation verbatim. You
can also look at the lex documentation for a description of how lex
reads characters.
As a university, we have a source code license for Unix so we just modify
the library code (a copy of it) when we need to do this. You might look
to flex and bison for freely available equivalent code.
--
| Ronald J. Srodawa | Internet: srodawa at vela.oakland.edu |
| School of Engineering and CS | UUCP: srodawa at vela.UUCP |
| Oakland University | Voice: (313) 370-2247 |
| Rochester, Michigan 48309-4401 | |
More information about the Comp.unix.programmer
mailing list