Excerpts from Conglun Yao's message of Fri Apr 04 09:59:09 +0200 2008:
> Hi,
Hi,
> While doing my little camlp4 (3.10) practice, I had the following questions:
>
[...]
> (2) How to extend operators like '@', for example if I want to change the
> expression
> list_1 @ list_2 => List.append list_1 list_2
>
> In 3.09, it could be achieved by deleting rules
> DELETE_RULE Gram expr: SELF; "@"; SELF END
>
> however, in 3.10, it seems I can't find the above grammar, only can find in
> Camlp4OCamlParser.ml
> expr: AFTER "^"
> [ "::" RIGHTA
> [ e1 = SELF; "::"; e2 = SELF -> <:expr< [$e1$ :: $e2$] >> ]
> ];
You should have to also check in Camlp4OCamlRevisedParser.ml, since
Camlp4OCamlParser.ml is now just an extension of the former.
> Furthermore, if I want to extend the expr: "["; sem_expr_for_list; "]",
> where to find the rule definition.
> In 3.09, all of these exist in pa_o.ml
Same answer.
Regards,
--
Nicolas Pouillard aka Ertai