Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!ames!elroy!orion.cf.uci.edu!uci-ics!paris.ics.uci.edu From: nagel@paris.ics.uci.edu (Mark Nagel) Newsgroups: comp.lang.c Subject: Re: LEX Question Message-ID: <7701@paris.ics.uci.edu> Date: 17 Feb 89 19:08:52 GMT References: <32240@auc.UUCP> <9580001@hpcuhb.HP.COM> <1989Feb15.200741.15963@utzoo.uucp> Sender: news@paris.ics.uci.edu Reply-To: nagel@paris.ics.uci.edu (Mark Nagel) Organization: University of California, Irvine - Dept of ICS Lines: 15 In-reply-to: henry@utzoo.uucp (Henry Spencer) In article <1989Feb15.200741.15963@utzoo.uucp>, henry@utzoo (Henry Spencer) writes: |In article <9580001@hpcuhb.HP.COM> najmi@hpcuhb.HP.COM (Farrukh Najmi) writes: |>... one can make it read from a file (using file pointer) |>by declaring the file pointer variable and then assigning |>it to yyin... | |Be careful: this is not a documented feature, at least not in all versions |of lex, and therefore should not be relied on too heavily in portable code. Is there any reason (other than losing stdin) that you couldn't just freopen stdin to the new input file? That should be portable enough... Mark Nagel @ UC Irvine, Dept of Info and Comp Sci ARPA: nagel@ics.uci.edu | Charisma doesn't have jelly in the UUCP: {sdcsvax,ucbvax}!ucivax!nagel | middle. -- Jim Ignatowski