Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Limiting scope of grammar extension
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2009-02-04 (13:58)
From: Pietro Abate <Pietro.Abate@p...>
Subject: Re: [Caml-list] Limiting scope of grammar extension
On Wed, Feb 04, 2009 at 02:54:53PM +1100, Paul Steckler wrote:
>   I have a camlp4 grammar extension that I want to apply to some parts
>   of a .ml file, but not others.  Most of the file uses normal OCaml
>   syntax.
>   Is there a way to mark the parts that I want transformed according
>   to the grammar extension, while the other parts are left alone?

A very simple way might be to use simple delimiters like << my_stm >>
and write you extension to expand only statements within these
delimiters. This will effectly leave everything else alone... I think.