RE: [HACKERS] Postgres' lexer

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

Leon took it out with a patch that he sent in about ten days ago. I did
some (very) basic testing, and it seemed to remove the problem of limiting
the token size, which is what I was after.

MikeA

>> -----Original Message-----
>> From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
>> Sent: Tuesday, August 31, 1999 3:58 PM
>> To: Thomas Lockhart
>> Cc: Brook Milligan; 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
>>
>>
>> Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu> writes:
>> > 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...
>>
>> It seems awfully hard and dangerous to try to identify unary minus in
>> the lexer. The grammar at least has enough knowledge to
>> recognize that
>> a minus *is* unary and not binary. Looking into gram.y, I
>> find that the
>> CREATE SEQUENCE productions handle collapsing unary minus all by
>> themselves! So in that particular case, there is still no
>> need for the
>> lexer to do it. AFAICT in a quick look through gram.y, there are no
>> places where unary minus is recognized that gram.y won't try
>> to collapse
>> it.
>>
>> In short, I still think that the whole mess ought to come out of the
>> lexer...
>>
>> regards, tom lane
>>

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 1999-08-31 14:14:51 Re: [HACKERS] Postgres' lexer
Previous Message Tom Lane 1999-08-31 13:57:53 Re: [HACKERS] Postgres' lexer