Re: Keyword implementation.

Alex Colvin <>
2 Jul 2001 12:30:16 -0400

          From comp.compilers

Related articles
Keyword implemetation. (Thomas Fjellstrom) (2001-06-28)
Re: Keyword implementation. (Matthew J. Lockner) (2001-07-01)
Re: Keyword implementation. (Alex Colvin) (2001-07-02)
| List of all articles for this month |

From: Alex Colvin <>
Newsgroups: comp.compilers
Date: 2 Jul 2001 12:30:16 -0400
References: 01-06-079 01-07-005
Keywords: lex
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.

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.