Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!elroy.jpl.nasa.gov!swrinde!mips!pacbell.com!att!ucbvax!UCBVAX.BERKELEY.EDU!"Dan Karron From: Dan Karron@UCBVAX.BERKELEY.EDU Newsgroups: comp.sys.sgi Subject: re-cursing lex Message-ID: <9104290656.AA16311@karron.med.nyu.edu> Date: 29 Apr 91 06:56:24 GMT Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: karron@cmcl2.nyu.edu Organization: The Internet Lines: 33 How do I get lex to: 1) read from a user provided buffer instead of a file ? 2) Get lex to throw away output it can't match (instead of sinking OUTPUT to /dev/null ?) Better still would be to write a catchall pattern that would make an error string for stuff it could not match otherwise. 3) Get lex to recurse, i.e., call lex again with input from another buffer. I don't want to get involved with yacc, as that is too complicated for my simple mind. All that I want to do is identify strings like VARIABLE="value" from a file or the environment string and -VARIABLE="value" from the command line argument vector. Once recognized, then parse out the value, or if in error, say something about it. I would like to take a uniform approach to reading values from a file, environment string, and command line argument. | karron@nyu.edu (e-mail alias ) Dan Karron, Research Associate | | Phone: 212 263 5210 Fax: 212 263 7190 New York University Medical Center | | 560 First Avenue Digital Pager <1> (212) 397 9330 | | New York, New York 10016 <2> 10896 <3> |