yacc guru needed - Mailing list pgsql-hackers

From Michael Meskes
Subject yacc guru needed
Date
Msg-id 20001004171608.A3320@feivel.credativ.de
Whole thread Raw
Responses Re: yacc guru needed  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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@Fam-Meskes.De
Go SF 49ers! Go Rhein Fire!
Use Debian GNU/Linux! Use PostgreSQL!


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: I want tips for debugging deadlocks
Next
From: Ashley Cambrell
Date:
Subject: Re: Version data type. - DONE