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

From Ansley, Michael
Subject RE: [HACKERS] Postgres' lexer
Date
Msg-id 1BF7C7482189D211B03F00805F8527F70ED114@S-NATH-EXCH2
Whole thread Raw
List pgsql-hackers
>> Hi!
Hi, Leon

>> I'm currently fooling around with Postgres's parser, and I must admit
>> some things puzzle me completely. Please tell me what these things in
>> lexer stand for:
>> 
>> {operator}/-[\.0-9]    {
>>                     yylval.str = pstrdup((char*)yytext);
>>                     return Op;
>>                 }
>> Is it an operator followed by mandatory '-' and (dot or digit) ?
I think this is used to recognize an operator followed by a minus or any
single character (the period is escaped, the character can be used to denote
the base of the number) or a single digit.
But check this, I'm not totally sure.

>> And what this stands for:
>> 
>> {identifier}/{space}*-{number}
An identifier followed by any number of spaces, and then a minus, or a
number.  Again, double check this with a reference of some sorts.

>> 
>> What's the meaning of all these?
>> 
You really should get a reference that deals with regular expressions.  My
understanding is (anybody feel free to comment here) that flex uses normal
regular expressions to generate scanners.


Cheers...

MikeA


pgsql-hackers by date:

Previous
From: Richard Bouska
Date:
Subject: pg_log >> groving to infinity in 6.5.1
Next
From: "Ansley, Michael"
Date:
Subject: RE: [HACKERS] Problem with query length