Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!snorkelwacker!paperboy!meissner From: meissner@osf.org (Michael Meissner) Newsgroups: comp.lang.c++ Subject: Re: zortech problem with lex Message-ID: Date: 26 Feb 90 19:56:38 GMT References: <6300008@ux1.cso.uiuc.edu> <2347@dataio.Data-IO.COM> <741@ns-mx.uiowa.edu> Sender: news@OSF.ORG Organization: Open Software Foundation Lines: 37 In-reply-to: csu025@umaxc.weeg.uiowa.edu's message of 26 Feb 90 18:39:43 GMT In article <741@ns-mx.uiowa.edu> csu025@umaxc.weeg.uiowa.edu (Kent Williams) writes: | >I'm afraid I don't understand. Is the *compiler* not working right or the | >*run-time library*? Please reduce the problem to a few lines of code | >which exhibit the problem. I know very little about lex/flex. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | | Yipes! | If you don't mind my asking, do you USE any automated compiler writing | tools? Maybe I got into the game a little later that you did, but a | compiler author who knows little about lex is a little like a auto mechanic | who doesn't know about socket wrenches -- I've no doubt he can do his | job, but isn't he working a little bit too hard? I have supported three compilers in the last 10 years (DG/L, Data General C, and now GNU C), and none of them use any automatic tools for lexing. First of all, UNIX lex is too general purpose, and too slow to be used in a production compiler (yes I know flex fixes at least some of the speed problems). You don't need backtracing, or even generalized regular expressions, and such for most computer languages to lex stuff, just simple one character lookahead. Second of all, lex-ing is fairly simple. It took me a day or so, to write from scratch the lexer for Data General C. It would have taken more time to come up to speed with lex (ignoring the problem that we didn't have lex at the time) than to just write the code. IMHO if you think writing a lexer is too hard, you have no business writing compilers. -- Michael Meissner email: meissner@osf.org phone: 617-621-8861 Open Software Foundation, 11 Cambridge Center, Cambridge, MA Catproof is an oxymoron, Childproof is nearly so