Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site sjuvax.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!princeton!astrovax!sjuvax!armstron From: armstron@sjuvax.UUCP (L. Armstrong) Newsgroups: net.lang Subject: Complex/Simple scanners - More hashing! Message-ID: <2394@sjuvax.UUCP> Date: Wed, 16-Oct-85 08:56:23 EDT Article-I.D.: sjuvax.2394 Posted: Wed Oct 16 08:56:23 1985 Date-Received: Sat, 19-Oct-85 05:49:14 EDT Distribution: net Organization: St. Joseph's University, Phila. PA. Lines: 31 *** YUM YUM - EAT EM' UP *** I have a question that has bugging me for quite some time lately, and I was wondering what some of the opinions of others were on the subject. My question is this: Do you think it would be faster for a compiler to have a more complex scanner that could recognize key-words/reserved identifiers immediately (i.e., simply by keeping a record of each inputted character) and not have to hash and search for those key-words each time one is encountered, or would it be better to keep the scanner simple, recognizing each key-word as simply an identifier, and then search the symbol table to determined wether or not your identifier was reserved. It is not immediately obvious to me which one would be quicker, although I have a tendency to think it may be the former. Lex allows for one to design a scanner of the first type very simply. Thanks, -Len -- NAME Len Armstrong UUCP {astrovax | bpa | burdvax | allegra }!sjuvax!armstron ORGANIZATIONS RCA Advanced Technology Labs St. Joseph's University PHONES (WORK) (609) 866-6647