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: Martin Jambon <martin_jambon@e...>
Subject: Re: [Caml-list] camlp4 char stream
On Mon, 12 Sep 2005, 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

It's not my tutorial, it's a page by Hendrik Tews.
And it's my mistake: you don't have access to the char stream like this, 
but to the token stream.

Why not define a quotation expander?


Martin

--
Martin Jambon, PhD
http://martin.jambon.free.fr