yacc guru needed

From: Michael Meskes <meskes(at)postgresql(dot)org>
To: PostgreSQL Hacker <pgsql-hackers(at)postgresql(dot)org>
Subject: yacc guru needed
Date: 2000-10-04 15:16:08
Message-ID: 20001004171608.A3320@feivel.credativ.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I would like to allow variables in ECPG at all positions the backend allows
constants. But I wonder how to get this done in the parser.

1) I need to allow :variable:indicator in AexprConst since this is the only
position where NULL is a possible constant.
2) :variable should be allowed whereever Iconst, FCONST and Sconst are used.

This would finally allow us to use something like "exec sql move :number ...".

Anyway, the problem is that some rules expand to either Iconst, FCONST or
Sconst. So do I have to change all these rules?

Just changing the rule for Iconst and Sconst e.g doesn't work since
AexprConst expands to the variable in two different ways. And bison
certainly does not like that.

But just adding a combined Const rule won't do either, since there are also
rules just asking for a special constant like in the aformentioned MOVE
command.

Finally bison cannot distinguish between character and numerical variables.
I can implement such a check but is it a good idea? How about I want to
store my numerical passwords in an int since it's calculated? etc.

Any ideas anyone?

Michael

--
Michael Meskes
Michael(at)Fam-Meskes(dot)De
Go SF 49ers! Go Rhein Fire!
Use Debian GNU/Linux! Use PostgreSQL!

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2000-10-04 15:29:48 Re: postgres functions and C++
Previous Message Tom Lane 2000-10-04 15:08:13 Re: I want tips for debugging deadlocks