re-cursing lex

DanKarron at UCBVAX.BERKELEY.EDU DanKarron at UCBVAX.BERKELEY.EDU
Mon Apr 29 16:56:24 AEST 1991


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 at 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> <your-number-here>  |



More information about the Comp.sys.sgi mailing list