Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!sun!pitstop!sundc!seismo!uunet!mcvax!ukc!reading!cf-cm!sme From: sme@computing-maths.cardiff.ac.uk (Simon Elliott) Newsgroups: comp.lang.c Subject: Re: LEX Question Summary: yytchar etc confined to i/o macros Message-ID: <640@cf-cm.UUCP> Date: 7 Mar 89 20:06:16 GMT References: <32240@auc.UUCP> <9580001@hpcuhb.HP.COM> <416@chem.ucsd.EDU> Organization: University of Wales College of Cardiff, Cardiff, WALES, UK. Lines: 19 In article <416@chem.ucsd.EDU>, tps@chem.ucsd.edu (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. But if you look again, you will notice that this and unput() are the only uses of these variables, so there is no objection to using other variables in your own input macros/functions. -- -------------------------------------------------------------------------- Simon Elliott Internet: sme%v1.cm.cf.ac.uk@cunyvm.cuny.edu UWCC Computer Centre JANET: sme@uk.ac.cf.cm.v1 40/41 Park Place UUCP: {backbones}!mcvax!ukc!reading!cf-cm!sme Cardiff, Wales PHONE: +44 222 874300