caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* sequence parser, revised syntax
@ 2007-07-09 14:22 dsb
  2007-07-10  9:27 ` [Caml-list] " Daniel de Rauglaudre
  0 siblings, 1 reply; 3+ messages in thread
From: dsb @ 2007-07-09 14:22 UTC (permalink / raw)
  To: caml-list

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/



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-07-10 13:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-09 14:22 sequence parser, revised syntax dsb
2007-07-10  9:27 ` [Caml-list] " Daniel de Rauglaudre
2007-07-10 13:18   ` Nicolas Pouillard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).