Re: [HACKERS] Postgres' lexer

From: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Brook Milligan <brook(at)biology(dot)nmsu(dot)edu>, Michael(dot)Ansley(at)intec(dot)co(dot)za, leon(at)udmnet(dot)ru, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Postgres' lexer
Date: 1999-08-31 04:09:37
Message-ID: 37CB5581.517CBD91@alumni.caltech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> But it'd be good to get an opinion from the other tgl first ;-).

Sadly, the former "tgl" ;)

Sorry, I was away on vacation. I've waded through ~300 mail messages
already, but have ~700 to go, so I apologize if I've missed some more
developments.

I added the <xm> exclusive state to accomodate the possibility of a
unary minus. The change was provoked by Vadim's addition of CREATE
SEQUENCE, which should allow negative numbers for some arguments. But
this just uncovered the tip of the general problem...

There are several cases which need to be handled (I'm doing this from
memory, so may miss a few):

o Positive and negative numbers as standalone arguments, with and
without spaces between the "-" and the digits.

o Positive and negative numbers as first arguments to binary
operators, with and without spaces at all possible places.

o Positive and negative numbers as second arguments to binary
operators, or as arguments to unary operators.

o Positive and negative numbers in the presence of operators
containing minus signs, including a trailing minus sign where
possible.

'taint easy to do it completely right. Perhaps trying to do less in
the scanner is the right thing to do, but istm that it may put
restrictions on the grammar which are not currently there. Not a good
trade for a longer query length...

- Thomas

--
Thomas Lockhart lockhart(at)alumni(dot)caltech(dot)edu
South Pasadena, California

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hiroshi Inoue 1999-08-31 04:49:32 RE: [HACKERS] File descriptor leakage?
Previous Message Tom Lane 1999-08-31 01:53:29 Re: libpq drops error messages received just before backend crash