On Wed, Aug 1, 2012 at 8:12 AM, Dmitry Olshansky <dmitry.o...@gmail.com> wrote: > On 01-Aug-12 02:01, Philippe Sigaud wrote: >> >> On Tue, Jul 31, 2012 at 11:38 PM, Dmitry Olshansky >> <dmitry.o...@gmail.com> wrote: >> >>>> I guess creating a tree of symbol tables according to scope visibility >>>> is then more the job of the parser, but I'm not sure. >>>> >>> Parser can use constant IDs for nested tables, IDs point to string table. >>> String table is populated by lexer. >> >> >> The latter, I get. The former, not so much. > > > Okay. Say lexer maps all unique strings that are not keywords to some ID. > > Then parser creates a stack of scoped symbol tables. > These nested symbol tables use only IDs not strings themselves. > (Though I expect that only semantic analysis require the use of these > tables)
Ah, that! This I know, I misunderstood your initial post. The symbol table can also be pre-charged with keywords, if needed.