RE: [HACKERS] Postgres' lexer

From: "Ansley, Michael" <Michael(dot)Ansley(at)intec(dot)co(dot)za>
To: "'Leon'" <leon(at)udmnet(dot)ru>, hackers <pgsql-hackers(at)postgreSQL(dot)org>
Subject: RE: [HACKERS] Postgres' lexer
Date: 1999-08-20 14:34:30
Message-ID: 1BF7C7482189D211B03F00805F8527F70ED11C@S-NATH-EXCH2
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Leon, if you manage to find a replacement for this, please let me know.
I'll probably only pick it up after the weekend.

I think that we need to find another way to tokenise the minus. First of
all, though, how is the parser supposed to tell whether this:
a -2
means this:
(a - 2)
or this:
a (-2)

i.e.: does the unary - operator take precedence over the binary - operator
or not? Is there even a difference. If the parser runs into this: 'a -2',
perhaps we could replace it with 'a + (-2)' instead.

How does a C compiler tokenize this? Or some other standard SQL parser?

MikeA

>> -----Original Message-----
>> From: Leon [mailto:leon(at)udmnet(dot)ru]
>> Sent: Friday, August 20, 1999 3:34 PM
>> To: hackers
>> Subject: Re: [HACKERS] Postgres' lexer
>>
>>
>> Ansley, Michael wrote:
>> >
>> > Leon, I see that you have been running into the vltc
>> problem ;-) I just run
>> > a flex -p, and went to line 314.
>>
>> I got it. It is done to prevent minus from sticking to number in
>> expressions like 'a -2'. Dirty, but it works.
>>
>> --
>> Leon.
>> ---------
>> "This may seem a bit weird, but that's okay, because it is weird." -
>> Perl manpage.
>>
>>
>> ************
>>

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Brook Milligan 1999-08-20 14:57:31 Re: [HACKERS] Postgres' lexer
Previous Message Ansley, Michael 1999-08-20 14:02:13 RE: [HACKERS] Postgres' lexer