Version française
Home     About     Download     Resources     Contact us    
Browse thread
How to Write a Pretty Printer for a DSL Using camlp4
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Nicolas Pouillard <nicolas.pouillard@g...>
Subject: Re: [Caml-list] How to Write a Pretty Printer for a DSL Using camlp4
Excerpts from echinuz echinuz's message of Sun Nov 25 09:46:22 +0100 2007:
> Hi,
>      I'm writing a DSL where I'd like to leverage camlp4 for parsing and
> printing.  Right now, I'm having trouble with the pretty printer.  As an
> example, let's take the simple calculator example.  With the following code, I
> can replace the OCaml toplevel and and print the AST for a simple algebraic
> expression:

[...]

> module Make (Syntax : Camlp4.Sig.Syntax) : Camlp4.Sig.Printer(Syntax.Ast).S =

module Make (Syntax : Camlp4.Sig.Camlp4Syntax) : Camlp4.Sig.Printer(Syntax.Ast).S =

[...]

> module M = Camlp4.Register.Printer(Id)(Make)

module M = Camlp4.Register.OCamlPrinter(Id)(Make)

HTH,

-- 
Nicolas Pouillard aka Ertai