English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] otags problem
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-02-05 (09:34)
From: Xavier Leroy <xavier.leroy@i...>
Subject: Re: [Caml-list] LL, LR, and camlp4 (was Re: syntax change)
> My question is just why did you hand-write the parser, rather than
> using a tool like yacc?  Was it because of the extensibility and hooks
> you needed in camlp4 and there's no way to make an extensible
> generated parser?

Yacc-generated parsers (LALR automata) are certainly not extensible --
or at least not without having to recompute most of the automata at
each extension.

> Are parser generators not all they're cracked up to be?  If so, why
> does caml use yacc?

Like all tools, parser generators work well for what they've been
designed to do.  In the case of Yacc, it works well for fixed grammars
(non extensible) of a certain kind (LALR(1) plus precedences for

The Caml compilers (OCaml, Caml Light, and even the original
LeLisp-based Caml) use Yacc-generated parsers because that's the
technology we had available at the time they were written, and it
works relatively well -- some efforts are required to disambiguate the
grammar, but at least Yacc tells you where the ambiguities are.

- Xavier Leroy
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr