[wg-camlp4] My uses of syntax extension

Hongbo Zhang hongboz at seas.upenn.edu
Mon Jan 28 15:14:20 GMT 2013


On Mon, Jan 28, 2013 at 10:03 AM, Alain Frisch <alain at frisch.fr> wrote:

> Unfortunately, I'm not sure to know what quasi-quotations are (compared to
> just "quotations" in camlp4 parlance).
>
> Can you elaborate on which kinds of non-trivial optimizations in stream
> parser depend on ast lifting?
http://caml.inria.fr/cgi-bin/viewvc.cgi/ocaml/trunk/camlp4/Camlp4Parsers/Camlp4OCamlRevisedParserParser.ml?view=markup

 Compilers have implemented optimizations
> based on AST rewriting for decades without going meta, and I suspect that
> can probably be done for stream parser optimizations as well, but I might be
> proven wrong.
That's true, but some domain specific optimizations are not implemented in
the compiler(and should not be).


let's keep it simple, suppose in the normal parsing phase
let a = 3  --> will be translated to an normal Parsetree A
<:str_item< let a = 3>> ---> will be translated to a Parsetree B
encoding the Parsetree A, is this the quotation you mean? if so, would
you mind elaborating a bit how to implement it?
>

>
> Alain



-- 
-- Regards, Hongbo


More information about the wg-camlp4 mailing list