Let's stop parser Hell
Dmitry Olshansky
dmitry.olsh at gmail.com
Tue Jul 31 23:12:28 PDT 2012
On 01-Aug-12 02:01, Philippe Sigaud wrote:
> On Tue, Jul 31, 2012 at 11:38 PM, Dmitry Olshansky
> <dmitry.olsh at 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)
--
Dmitry Olshansky
More information about the Digitalmars-d
mailing list