|Keyword implemetation. firstname.lastname@example.org (Thomas Fjellstrom) (2001-06-28)|
|Re: Keyword implementation. email@example.com (Matthew J. Lockner) (2001-07-01)|
|Re: Keyword implementation. firstname.lastname@example.org (Alex Colvin) (2001-07-02)|
|From:||Alex Colvin <email@example.com>|
|Date:||2 Jul 2001 12:30:16 -0400|
|Posted-Date:||02 Jul 2001 12:30:16 EDT|
> In a compiler/translator I've been writing I implemented the
> Reserved/Key words with a sorted table and searched using bsearch. I
> was wondering what every ones preference was for implementing
> keywords? using the symbol table, a method just like mine or
> something else all togeter?
In most cases you're also going to have an identifier symbol table.
Add a token field to the symbols, and load it up with the reserved
words and their token values.
Return to the
Search the comp.compilers archives again.