Neil Conway <neilc(at)samurai(dot)com> writes:
> Considering that the Bison manual suggests that it implements
> mid-rule actions by introducing an implicit bogus non-terminal (),
Indeed ... and the reason that they bothered to do that is that mid-rule
actions are more understandable ;-). A nonterminal that is not intended
to represent any real input, ever, is just plain weird.
> Unless we want two contiguous mid-rule actions
> (which is even _less_ readable), we'll need to futz with adding another
> member to %union to hold the two varnos the mid-rule action will
Not at all. The right way to do this, I think, is for the mid-rule
action to palloc the PLpgSQL_exception_block, fill the variables into
that, and return the block as its semantic value. The end-of-rule
action then picks up the block and adds what it needs to.
One reason this is cleaner is that it scales to more SQLERRx variables
without further renumbering of the rule components.
regards, tom lane
In response to
pgsql-patches by date
|Next:||From: Volkan YAZICI||Date: 2005-06-10 07:34:29|
|Subject: PQmakeEmptyPGresult() will return NULL if allocation fails|
|Previous:||From: Neil Conway||Date: 2005-06-10 04:24:33|
|Subject: Re: final light versions of Oracle compatibility (SQLSTATE,|