From: Pietro Abate <Pietro.Abate@anu.edu.au>
To: caml-list@yquem.inria.fr, caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] camlp4 char stream
Date: Tue, 13 Sep 2005 08:31:09 +1000 [thread overview]
Message-ID: <20050912223109.GA11662@pulp.anu.edu.au> (raw)
In-Reply-To: <43251497.1090905@univ-savoie.fr>
If I understand you problem correctly,
here there is a small example to parse string of the type
TEST ------ END
where ----- can be whatever you want.
http://caml.inria.fr/pub/ml-archives/caml-list/2005/07/244afe98fd8ddfb6aff6f0bcda52d9ac.en.html
read the thread further as you need to add Stream.junk strm to the
function test.
this way you can basically switch to an other parser (to parse "----" )
and get back to camlp4.
hope it helps.
:)
p
On Mon, Sep 12, 2005 at 07:39:35AM +0200, Christophe Raffalli wrote:
>
> OK, I found it (quote from your tutorial):
>
> let operator_rparen =
> Grammar.Entry.of_parser gram "operator_rparen"
> (fun strm ->
> match Stream.npeek 2 strm with
> | [("", s); ("", ")")] when is_operator s ->
> begin
> Stream.junk strm;
> Stream.junk strm;
> s
> end
> | _ -> raise Stream.Failure)
>
> OK, I read your tutorial, but did not get the point ... thks
>
> and what is the first member of the tuple ?
> Why is the second member a string and not a char ?
>
> >
> >See paragraph "Do it yourself" at
> >http://wwwtcs.inf.tu-dresden.de/~tews/ocamlp4/camlp4-undoc.html#power
> >
> >
> >
> >Martin
> >
> >--
> >Martin Jambon, PhD
> >http://martin.jambon.free.fr
>
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
--
++ Blog: http://blog.rsise.anu.edu.au/?q=pietro
++
++ "All great truths begin as blasphemies." -George Bernard Shaw
++ Please avoid sending me Word or PowerPoint attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html
prev parent reply other threads:[~2005-09-12 22:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-11 20:19 Christophe Raffalli
2005-09-11 21:51 ` [Caml-list] " Martin Jambon
2005-09-12 5:39 ` Christophe Raffalli
2005-09-12 6:40 ` Martin Jambon
2005-09-12 13:27 ` Olivier Andrieu
2005-09-12 22:31 ` Pietro Abate [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050912223109.GA11662@pulp.anu.edu.au \
--to=pietro.abate@anu.edu.au \
--cc=caml-list@inria.fr \
--cc=caml-list@yquem.inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox