Re: [I|S]CONST/[I|S]const in gram.y

Поиск
Список
Период
Сортировка
От Michael Meskes
Тема Re: [I|S]CONST/[I|S]const in gram.y
Дата
Msg-id 20081111120610.GC22087@feivel.credativ.de
обсуждение исходный текст
Ответ на Re: [I|S]CONST/[I|S]const in gram.y  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Mon, Nov 10, 2008 at 01:41:23PM -0500, Tom Lane wrote:
> I experimented with doing this and found that things seemed noticeably
> uglier; for example in createdb_opt_item we have (ignoring the actions)
> 
>             | TEMPLATE opt_equal name
>             | TEMPLATE opt_equal DEFAULT
>             | ENCODING opt_equal Sconst
>             | ENCODING opt_equal Iconst
>             | ENCODING opt_equal DEFAULT
>             | COLLATE opt_equal Sconst
>             | COLLATE opt_equal DEFAULT
> 
> which'd become
> 
>             | TEMPLATE opt_equal name
>             | TEMPLATE opt_equal DEFAULT
>             | ENCODING opt_equal SCONST
>             | ENCODING opt_equal ICONST
>             | ENCODING opt_equal DEFAULT
>             | COLLATE opt_equal SCONST
>             | COLLATE opt_equal DEFAULT
> 
> which at least to me seems confusing --- the ICONST and SCONST
> occurrences look like literal keywords rather than token classes.
> So I find I have a mild preference for the mixed-case spelling.

Fine with me too. Actually I don't think we'll waste a lot of cpu cycles when
keeping the Iconst/Sconst rules as they are.

> One possible way to shave the cycles and still have it look nice
> is to rename the actual tokens produced by scan.l to Iconst and Sconst;
> but this might be more trouble than it's worth.  Thoughts?

I agree that this is not worth it. After all the mixed-case spelling looks like
a non-terminal and at some point people will spend time looking to the rules
defining these non-terminals.

Michael
-- 
Michael Meskes
Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
Michael at BorussiaFan dot De, Meskes at (Debian|Postgresql) dot Org
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes@jabber.org
Go VfL Borussia! Go SF 49ers! Use Debian GNU/Linux! Use PostgreSQL!


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Michael Meskes
Дата:
Сообщение: Re: gram.y=>preproc.y
Следующее
От: Zdenek Kotala
Дата:
Сообщение: Re: pg_upgrade project status