Browse thread
[Caml-list] camlp4 vs. ocamllex/yacc?
-
Daniel Andor
- Jacques Carette
- Jean-Christophe Filliatre
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: | 2003-01-24 (15:23) |
From: | Jean-Christophe Filliatre <Jean-Christophe.Filliatre@l...> |
Subject: | Re: [Caml-list] camlp4 vs. ocamllex/yacc? |
> What are the advantages/disadvantages of using camlp4 vs. a combination of > ocamllex and ocamlyacc? For having used both of them intensively, I see (at least) the following advantages of camlp4: - it comes with a lexer, saving you the burden of writing one (this lexer conforms to ocaml lexical conventions; for prototype implementations, it is usually fine) - it offers high level grammar constructors such as LIST0, LIST1, OPT, ... It results in cleaner and more concise grammars. Another advantage of camlp4, not of common use, is to propose an ocaml datatype for grammars: thus grammars can be extended dynamically. This is not possible with ocamlyacc grammars. The (sole?) advantage of ocamlyacc is when you already have a YACC grammar. Turning it into an ocamlyacc grammar is almost immediate. > Is there already a translator like this out there (to save me the effort)? There are probably many (Ocaml is, in particular, a good tool to write compilers) but this really depends on your input syntax (there are really *many* ways to write mathematics using ASCII :-). -- Jean-Christophe ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners