RE: [HACKERS] Postgres' lexer - Mailing list pgsql-hackers

From Ansley, Michael
Subject RE: [HACKERS] Postgres' lexer
Date
Msg-id 1BF7C7482189D211B03F00805F8527F70ED11C@S-NATH-EXCH2
Whole thread Raw
Responses Re: [HACKERS] Postgres' lexer
List 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@udmnet.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.
>> 
>> 
>> ************
>> 


pgsql-hackers by date:

Previous
From: "Ansley, Michael"
Date:
Subject: RE: [HACKERS] Postgres' lexer
Next
From: Brook Milligan
Date:
Subject: Re: [HACKERS] Postgres' lexer