Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
camlp4 stream parser syntax
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Joel Reymont <joelr1@g...>
Subject: Re: [Caml-list] camlp4 stream parser syntax

On Mar 7, 2009, at 11:52 PM, Jon Harrop wrote:

> The [< .. >] denote a stream when matching over one using the  
> "parser" keyword
> and the tick ' denotes a kind of literal to identify a single token  
> in the
> stream. So:
>    | [< 'Kwd "if"; p=parse_expr; 'Kwd "then"; t=parse_expr;
>         'Kwd "else"; f=parse_expr >] ->

Should I be using camlp4 grammars as Matthieu suggested?

It seems there are are far more and better resources on doing this  
than the stream parsing approach. This includes your OCaml Journal.

Do I loose anything when going with camlp4 grammars and NOT parsing  
into an OCaml AST? Do I gain a lot with grammars over stream parsing?

	Thanks, Joel

Mac, C++, OCaml