Re: Keyword implementation.

Alex Colvin <acolvin@bbn.com>
2 Jul 2001 12:30:16 -0400

          From comp.compilers

Related articles
Keyword implemetation. tfjellstrom@home.com (Thomas Fjellstrom) (2001-06-28)
Re: Keyword implementation. lockner@chaos.cns.uni.edu (Matthew J. Lockner) (2001-07-01)
Re: Keyword implementation. acolvin@bbn.com (Alex Colvin) (2001-07-02)
| List of all articles for this month |

From: Alex Colvin <acolvin@bbn.com>
Newsgroups: comp.compilers
Date: 2 Jul 2001 12:30:16 -0400
Organization: ir.bbn.com
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.