LEX behavior when given "large" automata.
johnl at ima.UUCP
johnl at ima.UUCP
Wed Mar 23 06:20:44 AEST 1988
In article <917 at ima.ISC.COM>, sargas.usc.edu!tli at oberon.usc.edu (Tony Li) writes:
> In fact, another cute trick is to toss in a simple hashing function.
> Unless you've got lots of keywords, you usually can get away with
> doing only one strcmp.
I'm very pleased to see many people confirming that what I've
done and told my students to do is reasonably widely accepted
(despite not appearing in any compiler textbook I know of)...
recognizing keywords and identifiers by a single DFA rule and
then using symbol table lookup techniques to determine the
type of the lexeme.
My question is simply: what is this technique officially
called and does anyone know of a formal reference for it?
Since the Compilers Course Notes I wrote back at Polytechnic
University in 1983, I've been refering to it as "atomic
lexical analysis" because it closely resembles the way in
which Lisp recognizes atoms and then looks 'em up to determine
their type... but that's just my name for it.
[I've never seen it called anything, most likely because it's only recently
that automatic DFA generators have made it possible to do tokenizing any
other way. -John]
--
Send compilers articles to ima!compilers or, in a pinch, to Levine at YALE.EDU
Plausible paths are { ihnp4 | decvax | cbosgd | 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
More information about the Comp.unix.questions
mailing list