Path: utzoo!attcan!uunet!aplcen!haven!mimsy!chris From: chris@mimsy.umd.edu (Chris Torek) Newsgroups: comp.lang.c Subject: Re: Using Lex (and Yacc) on a string. Message-ID: <26012@mimsy.umd.edu> Date: 14 Aug 90 11:58:30 GMT References: <1990Aug10.012927.5558@basho.uucp> <174@ittc.wec.com> <25996@mimsy.umd.edu> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 25 In article <25996@mimsy.umd.edu> I suggested: >#define unput(c) (mystring--) (and then eventually) >#define unput(c) ((c) ? mystr-- : 0) The first of these will fail because lex uses unput as unput(*--yylastch) and unput(*yylastch--) Thanks to Brad White for noticing this error. The first one should be `#define unput(c) ((c), mystring--)'. (This is what I get for making changes to lex things based on theoretical arguments without checking to see whether lex uses good programming practises :-) .) -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@cs.umd.edu Path: uunet!mimsy!chris (New campus phone system, active sometime soon: +1 301 405 2750)