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.0 required=5.0 tests=DNS_FROM_RFC_ABUSE, NO_REAL_NAME 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 D49D5BC6B for ; Mon, 9 Jul 2007 16:22:33 +0200 (CEST) Received: from prairienet.org (monarch.prairienet.org [192.17.3.5]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l69EMWxe000654 for ; Mon, 9 Jul 2007 16:22:33 +0200 Received: (qmail 29005 invoked from network); 9 Jul 2007 14:22:32 -0000 Received: from localhost (HELO mail.prairienet.org) ([127.0.0.1]) (envelope-sender ) by localhost (qmail-ldap-1.03) with SMTP for ; 9 Jul 2007 14:22:32 -0000 Received: from 192.17.3.107 (SquirrelMail authenticated user dsb) by mail.prairienet.org with HTTP; Mon, 9 Jul 2007 09:22:32 -0500 (CDT) Message-ID: <47259.192.17.3.107.1183990952.squirrel@mail.prairienet.org> Date: Mon, 9 Jul 2007 09:22:32 -0500 (CDT) Subject: sequence parser, revised syntax From: dsb@prairienet.org To: caml-list@inria.fr User-Agent: SquirrelMail/1.4.5 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Miltered: at discorde with ID 469244A8.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; parser:01 syntax:01 parsers:01 pcaml:01 expr:01 parsers:01 syntax:01 def:01 expr:01 pcaml:01 seq:01 seq:01 cmo:01 ocamlc:01 -pp:01 I have a noobie question about parsers. The output of Grammar.Entry.print Pcaml.expr;; contains several things that appear to be parsers (this example in the revised syntax): | "let"; "module"; UIDENT; module_binding; "in"; SELF | "let"; OPT "rec"; LIST1 let_binding SEP "and"; "in"; SELF | "fun"; "["; LIST0 match_case SEP "|"; "]" | "fun"; ipatt; fun_def | "while"; SELF; "do"; "{"; sequence; "}" | "while"; SELF; "do"; LIST0 [ expr; ";" ]; warning_sequence; "done" | "object"; OPT class_self_patt; class_structure; "end" ] but don't seem to be documented. My current interest happens to be sequence: open Pcaml; EXTEND expr: LEVEL "top" [ [ "when"; test = expr; "do"; "{"; seq = sequence; "}" -> <:expr< if $test$ then ($list:seq$) else () >> ]]; END; but it doesn't seem to work: $ make stdlibr.cmo ocamlc -pp "camlp4r pa_extend.cmo q_MLast.cmo" \ -I +camlp4 -c stdlibr.ml File "stdlibr.ml", line 20, characters 40-48: Unbound value Pcaml.sequence make: *** [stdlibr.cmo] Error 2 How are these parsers supposed to be used? Thanks. --Dan Bensen www.prairienet.org/~dsb/