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

From Leon
Subject Re: [HACKERS] Postgres' lexer
Date
Msg-id 37CFEA48.4AA9EB19@udmnet.ru
Whole thread Raw
In response to Re: [HACKERS] Postgres' lexer  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> 
> I think it would be a really bad idea for the lexical analysis to depend
> on whether or not particular operator names are defined, for the same
> reasons that lexical analysis of word tokens doesn't depend on whether
> there are keywords/table names/field names that match those tokens.

101% correct :)

> You get into circularity problems very quickly if you do that.
> Language designers learned not to do that in the sixties...
> 

All that should be carved in stone and then erected as a monument :)
It is a good idea to explicitly state where and how to divide 
functions amongst components - though it places some (minor) 
restrictions, it introduces an conceivable order, which one can
abide by. E.g. no semantics is allowed in lexer. Even unary minus
in numbers is semantics and isn't proper for lexer. 

-- 
Leon.



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] Postgres' lexer
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] main tree is (slightly) damaged