Re: Parser Cruft in gram.y - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Parser Cruft in gram.y
Date
Msg-id 50D0ED1F.7090809@gmx.net
Whole thread Raw
In response to Re: Parser Cruft in gram.y  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Parser Cruft in gram.y  (Robert Haas <robertmhaas@gmail.com>)
List 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.



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Parser Cruft in gram.y
Next
From: "anarazel@anarazel.de"
Date:
Subject: Re: logical decoding - GetOldestXmin