Re: Status report: getting plpgsql to use the core lexer

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Status report: getting plpgsql to use the core lexer
Date: 2009-07-16 23:10:52
Message-ID: 17357.1247785852@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov> writes:
> ...
> We were able to get to much cleaner code by rewriting the parser to
> have a "dumb" phase to get the overall structure into an AST, and then
> use a tree-walker phase to do all the lookups and type resolution
> after we had the rough structure, writing another AST to walk for code
> generation. Besides making the code cleaner and easier to maintain,
> it helped us give better error messages pointing more accurately to
> the source of the problem. I don't know if a similar approach is
> feasible in flex/bison, but if it is, refactoring for an extra pass
> might be worth the trouble.

That's actually what we have in the core parser. plpgsql is trying to
take shortcuts, and this whole project is exactly about weaning it away
from that. The bottom line is I tried to tackle the sub-projects in the
wrong order...

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-07-16 23:25:52 Re: Docbook toolchain interfering with patch review?
Previous Message Kevin Grittner 2009-07-16 22:55:39 Re: Status report: getting plpgsql to use the core lexer