[wg-camlp4] A new branch to experiment with extension points

Alain Frisch alain.frisch at lexifi.com
Thu Feb 28 21:04:07 GMT 2013


Dear all,

Since there seemed to be a consensus about extending the OCaml grammar 
with attributes and extension nodes in various syntactic categories, 
I've started an experimental branch on the OCaml SVN to try some syntax.
The branch is called extension_points ( 
http://caml.inria.fr/cgi-bin/viewvc.cgi/ocaml/branches/extension_points/ ).

Currently, the following are supported:

  - Extension node as a structure item:

       &(foo expr)

  - Extension node as an expression:

       (&foo expr)

  - Extension node as a type expression:

       (&foo expr)

  - Attribute on a structure item, postfix notation:

       .... :: foo expr

  - Attribute on a type expression, postfix notation:

       .... (/foo expr)

In all cases, foo denotes a lowercase unprefixed identifier (LIDENT) and 
expr is an optional expression (it can be omitted).

(The parser has more commented-out syntax for attributes on expressions 
with prefix and postfix notation, and attributes on type expression with 
prefix notation.)


Alain


More information about the wg-camlp4 mailing list