
expr ? trueval : falseval

if expr evaluated is true, the entire expression is trueval evaluated,
otherwise it is falseval evaluated.

Is it possible to have this sort of grammar logic in the parser?

--brett

Fri, 20 Mar 1998 00:07:03 -0800 (PST)
Brett McCormick <brett@work.chicken.org>
expr ? trueval : falseval
Brett McCormick wrote:
> 
> expr ? trueval : falseval
> 
> if expr evaluated is true, the entire expression is trueval evaluated,
> otherwise it is falseval evaluated.
> 
> Is it possible to have this sort of grammar logic in the parser?

I suspect that this is covered in the SQL92 CASE expression, which we
don't yet support.

              - Tom

Fri, 20 Mar 1998 17:02:55 +0000
"Thomas G. Lockhart" <lockhart@alumni.caltech.edu>
Re: [HACKERS] expr ? trueval : falseval
> 
> 
> expr ? trueval : falseval
> 
> if expr evaluated is true, the entire expression is trueval evaluated,
> otherwise it is falseval evaluated.
> 
> Is it possible to have this sort of grammar logic in the parser?

Good question.  Answer is no, I think, unless you can do some fancy
things with functions.

-- 
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)

Fri, 20 Mar 1998 12:03:31 -0500 (EST)
Bruce Momjian <maillist@candle.pha.pa.us>
Re: [HACKERS] expr ? trueval : falseval