4 (Camlp4OCamlRevisedParser.Make
5 (Camlp4.OCamlInitSyntax.Make(Ast)(Gram)(Quotation)));;
8 "[1; 2; 3]" (* ... do some real code on str *)
10 let patt_quotexpander loc _loc_name_opt str =
11 Gram.parse_string Caml.patt loc (quotexpander str)
13 let expr_quotexpander loc _loc_name_opt str =
14 Gram.parse_string Caml.expr loc (quotexpander str)
16 let str_item_quotexpander loc loc_name_opt str =
17 <:str_item@loc< $exp: expr_quotexpander loc loc_name_opt str$ >>
20 Syntax.Quotation.add "" Syntax.Quotation.DynAst.expr_tag expr_quotexpander;
21 Syntax.Quotation.add "" Syntax.Quotation.DynAst.str_item_tag str_item_quotexpander;
22 Syntax.Quotation.add "" Syntax.Quotation.DynAst.patt_tag patt_quotexpander