* Building a parser with Camlp4
@ 2007-11-28 7:14 David Teller
2007-11-28 9:57 ` [Caml-list] " Nicolas Pouillard
0 siblings, 1 reply; 4+ messages in thread
From: David Teller @ 2007-11-28 7:14 UTC (permalink / raw)
To: Caml
Hi list (Nicolas Pouillard, in particular),
I'll probably need to rewrite my (not-fully-complete-yet) parser for
JavaScript 2 and I'm considering using Camlp4 as a parser generator for
a completely-non-OCaml target language. Now, before I do that, I have a
few questions in mind:
* What is the power of Camlp4 ? The documentation says LL(1+epsilon) but
the examples look like LL(k) with a possibly large k.
* How do I plug-in a lexer written with ULex ?
* Camlp4 looks relatively slow -- is it much slower than Yacc ?
Thanks,
David
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Caml-list] Building a parser with Camlp4
2007-11-28 7:14 Building a parser with Camlp4 David Teller
@ 2007-11-28 9:57 ` Nicolas Pouillard
2007-11-28 12:38 ` Yitzhak Mandelbaum
0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Pouillard @ 2007-11-28 9:57 UTC (permalink / raw)
To: David Teller; +Cc: caml-list
Excerpts from David Teller's message of Wed Nov 28 08:14:00 +0100 2007:
> Hi list (Nicolas Pouillard, in particular),
Hi,
> I'll probably need to rewrite my (not-fully-complete-yet) parser for
> JavaScript 2 and I'm considering using Camlp4 as a parser generator for
> a completely-non-OCaml target language. Now, before I do that, I have a
> few questions in mind:
>
> * What is the power of Camlp4 ? The documentation says LL(1+epsilon) but
> the examples look like LL(k) with a possibly large k.
Yes `k' is the number of terminals at the beginning of a rule.
> * How do I plug-in a lexer written with ULex ?
It don't remember but cduce does that, and is updated to the new version of Camlp4.
> * Camlp4 looks relatively slow -- is it much slower than Yacc ?
Yes, that's the cost of dynamic extensibility.
--
Nicolas Pouillard aka Ertai
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Caml-list] Building a parser with Camlp4
2007-11-28 9:57 ` [Caml-list] " Nicolas Pouillard
@ 2007-11-28 12:38 ` Yitzhak Mandelbaum
2007-12-08 14:02 ` David Teller
0 siblings, 1 reply; 4+ messages in thread
From: Yitzhak Mandelbaum @ 2007-11-28 12:38 UTC (permalink / raw)
To: Nicolas Pouillard; +Cc: David Teller, caml-list
[-- Attachment #1: Type: text/plain, Size: 404 bytes --]
A more important question (IMHO) : does it matter? I.e. how fast do
you need the parser to be?
On Nov 28, 2007, at 4:57 AM, Nicolas Pouillard wrote:
>> * Camlp4 looks relatively slow -- is it much slower than Yacc ?
>
> Yes, that's the cost of dynamic extensibility.
--------------------------------------------------
Yitzhak Mandelbaum
AT&T Labs - Research
http://www.research.att.com/~yitzhak
[-- Attachment #2: Type: text/html, Size: 3066 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Caml-list] Building a parser with Camlp4
2007-11-28 12:38 ` Yitzhak Mandelbaum
@ 2007-12-08 14:02 ` David Teller
0 siblings, 0 replies; 4+ messages in thread
From: David Teller @ 2007-12-08 14:02 UTC (permalink / raw)
To: Yitzhak Mandelbaum; +Cc: Nicolas Pouillard, caml-list
Well, with my current parser, parsing the standard library of JavaScript
2 (a few thousand lines) several minutes (with debugging code on). Which
is a bit too much. So, no, I can't answer your question but yes,
performance does matter.
Cheers,
David
On Wed, 2007-11-28 at 07:38 -0500, Yitzhak Mandelbaum wrote:
> A more important question (IMHO) : does it matter? I.e. how fast do
> you need the parser to be?
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-12-08 14:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-28 7:14 Building a parser with Camlp4 David Teller
2007-11-28 9:57 ` [Caml-list] " Nicolas Pouillard
2007-11-28 12:38 ` Yitzhak Mandelbaum
2007-12-08 14:02 ` David Teller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox