Re: scanner/parser minimization

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: scanner/parser minimization
Дата
Msg-id CA+TgmoZjTU7xPUcW=WpSVD0fh_Vj3AEn_q5-_V_BB5OEmf+Zmg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: scanner/parser minimization  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: scanner/parser minimization  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Thu, Feb 28, 2013 at 4:09 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> I believe however that it's possible to extract an idea of which
> tokens the parser believes it can see next at any given parse state.
> (I've seen code for this somewhere on the net, but am too lazy to go
> searching for it again right now.)  So we could imagine a rule along
> the lines of "if IDENT is allowed as a next token, and $KEYWORD is
> not, then return IDENT not the keyword's own token".
>
> This might be unworkable from a speed standpoint, depending on how
> expensive it is to make the determination about allowable next symbols.
> But it seems worth looking into.

Interesting idea.  But wouldn't that change the semantics of the
grammar in some places?  In particular, keywords would generally
become less-reserved than they are now, but in a context-dependent
way.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: scanner/parser minimization
Следующее
От: Tom Lane
Дата:
Сообщение: Re: scanner/parser minimization