Fwd: Re: Yacc / Bison difficulties

Поиск
Список
Период
Сортировка
От Robert Schrem
Тема Fwd: Re: Yacc / Bison difficulties
Дата
Msg-id 01041218294300.30379@pc-robert
обсуждение исходный текст
Список pgsql-hackers

----------  Forwarded Message  ----------
Subject: Re: Yacc / Bison difficulties
Date: Thu, 12 Apr 2001 13:01:40 +0200
From: Robert Schrem <robert.schrem@wiredminds.de>
To: Mark Butler <butlerm@middle.net>


On Thursday 12 April 2001 03:38, you wrote:
> I was trying to make a minor change today to the gram.y file to make
> PostgreSQL recognize "DOUBLE" as a data type the way DB2 does.  I ran into
> reduce / reduce conflicts using both of the methods I tried.
>
> Having fought extensively with  Bison before on a SQL oriented language
> translation project, I am amazed that you were able to get a grammar as
> complex as PostgreSQL to work without major difficulty.
>
> I was wondering about what the sense of the list would be to someday
> accepting a rewrite using a hand-coded LL(k) recursive descent parser.
> Anyone?

I think writing a parser by hand is inadequate these days.
Look at http://www.antlr.org for probably the best LL(k) parser
generator software you can think of. It's much better than
bison (and hand written parsers anyway):

1. Easier to maintain (much easier)
2. Clever syntax error detection for meanigfull error messages
3. Less testing than for a hand written parser
4. A hand written parser that is usually less efficient

The only drawback for the porstgresql project is, that
ANTLR only generates C++ and JAVA source code. But there
is also an older Version of ANTLR that can also generate C
sources.

If you are interested in this area have a look at the following
pages for even more tools for compiler/interpreter construction:

http://www.compilerconstruction.org/
http://www.idiom.com/free-compilers/

If you researche on all parser generators on these web sites
(and recognize how much brainwork already done in this field
of software development) you will probably agree, that it's
adviceable, to not write parsers by hand anymore these
days (my two euro :) ...

Robert Schrem

>  - Mark Butler
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html

--

Robert Schrem
Software Development
WiredMinds Informationssysteme GmbH
Am Wilhelmsplatz 11, 70182 Stuttgart
e: Robert.Schrem@WiredMinds.de
v: ++49 +711 4 90 48 212
f: ++49 +711 4 90 48 111
w: http://www.WiredMinds.de

The nice thing about standards is that there are so many of them
to choose from.   -- Andrew S. Tanenbaum

-------------------------------------------------------

-- 

Robert Schrem
Software Development
WiredMinds Informationssysteme GmbH
Am Wilhelmsplatz 11, 70182 Stuttgart
e: Robert.Schrem@WiredMinds.de
v: ++49 +711 4 90 48 212
f: ++49 +711 4 90 48 111
w: http://www.WiredMinds.de

The nice thing about standards is that there are so many of them 
to choose from.   -- Andrew S. Tanenbaum


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

Предыдущее
От: Patrick Welche
Дата:
Сообщение: Re: Call for platforms
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: age() function documentation