Browse thread
camlp4 question
-
Christophe Raffalli
-
Christophe Raffalli
-
Martin Jambon
- Christophe Raffalli
-
Martin Jambon
- Martin Jambon
-
Christophe Raffalli
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Christophe Raffalli <christophe.raffalli@u...> |
| Subject: | Re: [Caml-list] Re: camlp4 question |
Martin Jambon a écrit : > On Thu, 8 Sep 2005, Christophe Raffalli wrote: > >> Yet another question .... >> >> I was assuming you oculd ask the type of an expression in camlp4 to do >> an induction over it (the type) .... > > > You can't, Camlp4 is only about parsing and transforming the syntax tree. > > I imagine you could use a (complicated) 3-step approach: > 1) preprocess the file with camlp4 and ignore the syntax extensions > 2) compile the result with -dtypes > 3) fetch the type information from the .annot file and reparse the > original file with camlp4. This time you can get the type of each > identifier and expand your special syntax constructs > >> I do not see that in the manual ! >> >> (you can only construct trees with camlp4, but you cannot match them ?) > > > You can use quotations in patterns to read the syntax tree. Is it what > you mean? Yes I saw that later (after acually using the type in MLast t odo the same ...) All that lacks a lot of documentation, but in one day, I found my way ;-) > > Martin > > -- > Martin Jambon, PhD > http://martin.jambon.free.fr