Version française
Home     About     Download     Resources     Contact us    
Browse thread
camlp4 char stream
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Christophe Raffalli <christophe.raffalli@u...>
Subject: Re: [Caml-list] camlp4 char stream

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