From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 5C53CBC6B for ; Wed, 28 Nov 2007 10:57:59 +0100 (CET) X-IronPort-AV: E=Sophos;i="4.23,223,1194217200"; d="scan'208";a="19762401" Received: from peray.inria.fr (HELO ausone.inria.fr) ([128.93.8.98]) by mail4-relais-sop.national.inria.fr with SMTP; 28 Nov 2007 10:57:59 +0100 Received: by ausone.inria.fr (sSMTP sendmail emulation); Wed, _d Nov 2007 10:57:10 +0100 From: "Nicolas Pouillard" Cc: caml-list Subject: Re: [Caml-list] Building a parser with Camlp4 To: David Teller References: <1196234040.6361.7.camel@Blefuscu> In-Reply-To: <1196234040.6361.7.camel@Blefuscu> Date: Wed, 28 Nov 2007 10:57:10 +0100 Message-Id: <1196243387-sup-4653@port-ext2.ensta.fr> User-Agent: Sup/0.2 Content-Type: text/plain; charset=UTF-8 X-Spam: no; 0.00; parser:01 camlp:01 parser:01 camlp:01 lexer:01 cduce:01 javascript:98 plug-in:98 rewrite:01 caml-list:01 slower:02 dynamic:03 epsilon:04 aka:04 yacc:06 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