argv ==> stdin (fast)

Mike Shannon mikes at apple.UUCP
Wed Dec 3 11:29:53 AEST 1986


To people using yacc & lex and trying to read from a file, not stdin,
you should note that in the code generated by lex for reading a character,
a call is made to getc(yyin).
	yyin is simply a variable statically initialized to be stdin, but
you can *easily* re-assign it via a call to fopen(), as in
	yyin = fopen(argv[1])
	or some such.
	Look at the code generated by these tools!  It's easy to change it!
-- 
			Michael Shannon {apple!mikes}



More information about the Comp.unix.questions mailing list