Standalone Parser for PL/pgSQL

From: Matt Miller <mattm(at)epx(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Standalone Parser for PL/pgSQL
Date: 2005-07-13 20:33:59
Message-ID: 1121286839.8246.49.camel@dbamm01-linux
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bob 2005-07-13 20:38:50 Re: Transparent encryption in PostgreSQL?
Previous Message David Fetter 2005-07-13 20:30:30 Re: To Postgres or not