Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!ucsd!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: <8180@paris.ics.uci.edu> Date: 24 Feb 89 18:26:14 GMT References: <32240@auc.UUCP> <9580001@hpcuhb.HP.COM> <1989Feb15.200741.15963@utzoo.uucp> <412@chem.ucsd.EDU> <1989Feb23.164129.8672@utzoo.uucp> <416@chem.ucsd.EDU> Sender: news@paris.ics.uci.edu Reply-To: nagel@paris.ics.uci.edu (Mark Nagel) Organization: University of California, Irvine - Dept of ICS Lines: 18 In-reply-to: tps@chem.ucsd.edu (Tom Stockfisch) In article <416@chem.ucsd.EDU>, tps@chem (Tom Stockfisch) writes: | |I must be missing something. Looking at lex.yy.c on my machine shows that |input() is defined as | |# define input() (((yytchar=yysptr>yysbuf?U(*--yysptr):getc(yyin))==10? \ | (yylineno++,yytchar):yytchar)==EOF?0:yytchar) | |so if I re-#define input(), don't I have to use yytchar,yysptr, and yysbuf? |I would assume one of these would be more likely to change than yyin. If you redefine input() in lex, you'd most likely redefine it in such a way that you'd manage the input entirely yourself. So you would have no need for lex's internal input management. 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