RE: [HACKERS] Postgres' lexer

Поиск
Список
Период
Сортировка
От Ansley, Michael
Тема RE: [HACKERS] Postgres' lexer
Дата
Msg-id 1BF7C7482189D211B03F00805F8527F70ED11C@S-NATH-EXCH2
обсуждение исходный текст
Ответы Re: [HACKERS] Postgres' lexer  (Brook Milligan <brook@biology.nmsu.edu>)
Список 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 по дате отправления:

Предыдущее
От: "Ansley, Michael"
Дата:
Сообщение: RE: [HACKERS] Postgres' lexer
Следующее
От: Brook Milligan
Дата:
Сообщение: Re: [HACKERS] Postgres' lexer