Version française
Home     About     Download     Resources     Contact us    
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: [Caml-list] Re: camlp4 stream parser syntax

On Mar 8, 2009, at 3:32 PM, Matthieu Wipliez wrote:

> I'd say duplicate Static, and redefine "using". Seems like the  
> simplest solution to me, certainly not the cleanest though (but is  
> there an alternative?).


I don't think this will work elegantly.

Static first makes a Structure (is make the right term?) and then  
makes a bunch of other modules using it. A custom Structure will be  
needed to downcase the keywords before inserting them into the hash  
table, so Static will need to be duplicated as well.

I'm learning modules, functors, etc. Perhaps someone more experienced  
in this and camlp4 can weight in.

	Thanks, Joel

-- Static.ml --- 

module Make (Lexer : Sig.Lexer)
: Sig.Grammar.Static with module Loc = Lexer.Loc
                         and module Token = Lexer.Token
= struct
   module Structure = Structure.Make Lexer;
   module Delete = Delete.Make Structure;
   module Insert = Insert.Make Structure;
   module Fold = Fold.Make Structure;
   include Structure;

---
http://tinyco.de
Mac, C++, OCaml