Standalone Parser for PL/pgSQL - Mailing list pgsql-general

From Matt Miller
Subject Standalone Parser for PL/pgSQL
Date
Msg-id 1121286839.8246.49.camel@dbamm01-linux
Whole thread Raw
Responses Re: Standalone Parser for PL/pgSQL
List pgsql-general
I'd like (to find or make) a utility that inputs the code of a Pl/pgSQL
function (e.g. from a text file or from STDIN, and then parses the
function definition, building a complete symbol table.  I would then
write C code that walks that symbol table and does stuff.  As a starting
point I'd be happy if I could just visit each node in the symbol table
and dump that node out to another file.

I'm thinking that the code in src/pl/plpgsql/src is where to start, but
I need some guidance sorting through that stuff.  I understand (in
theory, anyway) how flex and bison work, so maybe I just need a bit of
hand-holding to get a simple standalone PL/pgSQL parser up and running.

I want to analyze/transform some Oracle PL/SQL procs, and PL/pgSQL is so
close to PL/SQL that I figured that a PL/pgSQL parser would be a good
starting point.

pgsql-general by date:

Previous
From: David Fetter
Date:
Subject: Re: To Postgres or not
Next
From: Bob
Date:
Subject: Re: Transparent encryption in PostgreSQL?