using lex with strings, not files

Will Leavitt leavitt at mordor.hw.stratus.com
Tue May 7 02:35:27 AEST 1991




Thank you for all the suggestions.  I had come up with various kludges using 
freopen, but this is much cleaner:

from: Bradley White <bww+ at K.GP.CS.CMU.EDU>

%%
char *instr;

#undef  input
#define input()         (*instr ? *instr++ : *instr)

#undef  unput
#define unput(c)        ((c), --instr)

--
...............................................................................
this content-free posting has been brought to you by:
                                           Will Leavitt     508-490-6231
                                           leavitt at mordor.hw.stratus.com 



More information about the Comp.lang.c mailing list