Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!lll-crg!lll-lcc!pyramid!voder!apple!mikes From: mikes@apple.UUCP (Mike Shannon) Newsgroups: comp.unix.questions,comp.unix.wizards,comp.lang.c Subject: Re: argv ==> stdin (fast) Message-ID: <347@apple.UUCP> Date: Tue, 2-Dec-86 20:29:53 EST Article-I.D.: apple.347 Posted: Tue Dec 2 20:29:53 1986 Date-Received: Wed, 3-Dec-86 00:02:57 EST References: <2972@rsch.WISC.EDU> Reply-To: mikes@apple.UUCP (Mike Shannon) Organization: Apple Computer Inc., Cupertino, USA Lines: 10 Keywords: make the commandline look like a file? Xref: mnetor comp.unix.questions:222 comp.unix.wizards:221 comp.lang.c:214 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}