Re: Status report: getting plpgsql to use the core lexer - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Status report: getting plpgsql to use the core lexer
Date
Msg-id 17357.1247785852@sss.pgh.pa.us
Whole thread Raw
In response to Re: Status report: getting plpgsql to use the core lexer  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
List pgsql-hackers
"Kevin Grittner" <Kevin.Grittner@wicourts.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


pgsql-hackers by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: Status report: getting plpgsql to use the core lexer
Next
From: Tom Lane
Date:
Subject: Re: Docbook toolchain interfering with patch review?