Re: Parser Cruft in gram.y

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Dimitri Fontaine <dimitri(at)2ndquadrant(dot)fr>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Kevin Grittner <kgrittn(at)mail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Parser Cruft in gram.y
Date: 2012-12-18 22:24:31
Message-ID: 50D0ED1F.7090809@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 12/18/12 5:10 PM, Robert Haas wrote:
> I can't help but suspect that the way we handle keywords today is
> monumentally inefficient. The unreserved_keyword products, et al,
> just seem somehow badly wrong-headed. We take the trouble to
> distinguish all of those cases so that we an turn around and not
> distinguish them. I feel like there ought to be some way to use lexer
> states to handle this - if we're in a context where an unreserved
> keyword will be treated as an IDENT, then have the lexer return IDENT
> when it sees an unreserved keyword.

The problem would be the lookahead. You need to know the next token
before you can decide what context the current one is in.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message anarazel@anarazel.de 2012-12-18 22:25:05 Re: logical decoding - GetOldestXmin
Previous Message Robert Haas 2012-12-18 22:10:29 Re: Parser Cruft in gram.y