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=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 2B924BC69 for ; Fri, 20 Oct 2006 18:52:52 +0200 (CEST) Received: from pilet.ens-lyon.fr (pilet.ens-lyon.fr [140.77.167.16]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id k9KGqnAs002074 for ; Fri, 20 Oct 2006 18:52:51 +0200 Received: from localhost (localhost [127.0.0.1]) by pilet.ens-lyon.fr (Postfix) with ESMTP id AD89015BADA for ; Fri, 20 Oct 2006 18:52:39 +0200 (CEST) Received: from pilet.ens-lyon.fr ([127.0.0.1]) by localhost (pilet [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 14513-35 for ; Fri, 20 Oct 2006 18:52:39 +0200 (CEST) Received: from webmail.ens-lyon.fr (mouette.ens-lyon.fr [140.77.167.4]) by pilet.ens-lyon.fr (Postfix) with ESMTP id 27E6A15BAC9 for ; Fri, 20 Oct 2006 18:52:39 +0200 (CEST) Received: from lal69-2-82-224-38-89.fbx.proxad.net (lal69-2-82-224-38-89.fbx.proxad.net [82.224.38.89]) by webmail.ens-lyon.fr (Horde MIME library) with HTTP for ; Fri, 20 Oct 2006 18:52:39 +0200 Message-ID: <20061020185239.5bm4tlwmty50koso@mouette.ens-lyon.fr> Date: Fri, 20 Oct 2006 18:52:39 +0200 From: Emmanuel Onzon To: caml-list@yquem.inria.fr Subject: dypgen : a generator of dynamically extensible parsers for OCaml MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) H3 (4.0.3) X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at ens-lyon.fr X-Miltered: at discorde with ID 4538FEE1.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; ens-lyon:01 parsers:01 ocaml:01 parser:01 parsers:01 ens-lyon:01 expr:01 expr:01 node:01 node:01 dynamically:01 dynamically:01 extensible:01 extensible:01 define:01 Hello, dypgen is a GLR parser generator for Objective Caml. It can generate dynamically extensible parsers. The program is available at : http://perso.ens-lyon.fr/emmanuel.onzon Here is are two examples of extension of a small language. This is the example included with the program. define list_content := expr(x) = List(x,Nil) and list_content := expr(x);list_content(y) = List(x,y) and expr := [] = Nil and expr := [list_content(x)] = x and expr := expr(x)::expr(y) = List(x,y) in match [1;2;3] with | a::[b;c] -> b | _ -> 4 define expr := | expr(x) | = Node(Leaf,x,Leaf) and expr := expr(x) | expr(y) | = Node(x,y,Leaf) and expr := | expr(x) | expr(y) = Node(Leaf,x,y) and expr := expr(x) | expr(y) | expr(z) = Node(x,y,z) in match Node(Leaf,3,Node(Node(Leaf,7,Leaf),5,Node(Leaf,1,Leaf))) with | (|3|((|7|)|a|(|1|))) -> a | _ -> 8