Path: utzoo!utgpu!watmath!clyde!ima!compilers-sender From: holt@turing.toronto.edu (Ric Holt) Newsgroups: comp.compilers Subject: Re: Lex surrogates Message-ID: <3332@ima.ima.isc.com> Date: 13 Feb 89 22:02:58 GMT References: <3324@ima.ima.isc.com> Sender: compilers-sender@ima.ima.isc.com Reply-To: Ric Holt Organization: /usr/local/lib/organization Lines: 25 Approved: compilers@ima.UUCP In reply to Henry's comments .... >The stuff lex puts in yytext[] also changes for each terminal, and hence >also must be saved immediately if you want to use it. I don't understand >why the lack of copying makes a practical difference. > > Henry Spencer at U of Toronto Zoology > uunet!attcan!utzoo!henry henry@zoo.toronto.edu In a FAST scanner, every machine instruction counts. I'd like to know how fast, on an instruction basis, FLEX and LEX are. The scanner for the new Turing compiler (written in Turing Plus) seems to execute about 129 machine instructions per token, including hashing identifiers and entering them into buckets (as well as skipping white space and comments). These are MC680x0 instructions. A token is something like a keyword, an operator, an identifier, etc. In a scanner like this, copying extra bytes appreciably slows down things. Ric Holt [From Ric Holt ] -- Send compilers articles to ima!compilers or, in a pinch, to Levine@YALE.EDU Plausible paths are { decvax | harvard | yale | bbn}!ima Please send responses to the originator of the message -- I cannot forward mail accidentally sent back to compilers. Meta-mail to ima!compilers-request