* Camlp4: How to reset a Camlp4Syntax into pristine state?
@ 2008-04-07 21:05 Hendrik Tews
2008-04-08 12:32 ` [Caml-list] " Nicolas Pouillard
0 siblings, 1 reply; 2+ messages in thread
From: Hendrik Tews @ 2008-04-07 21:05 UTC (permalink / raw)
To: caml-list
Hi,
I want to reuse a Camlp4Syntax module (obtained from
Camlp4.OCamlInitSyntax.Make) for parsing different files with
possibly different parsers or extensions loaded. How do I reset a
Camlp4Syntax module into its initial state such that it is ready
to get applied to the next set of syntax extensions for the next
file to parse?
Bye,
Hendrik
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Caml-list] Camlp4: How to reset a Camlp4Syntax into pristine state?
2008-04-07 21:05 Camlp4: How to reset a Camlp4Syntax into pristine state? Hendrik Tews
@ 2008-04-08 12:32 ` Nicolas Pouillard
0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Pouillard @ 2008-04-08 12:32 UTC (permalink / raw)
To: Hendrik Tews; +Cc: caml-list
[-- Attachment #1: Type: text/plain, Size: 656 bytes --]
Excerpts from Hendrik Tews's message of Mon Apr 07 23:05:38 +0200 2008:
> Hi,
>
> I want to reuse a Camlp4Syntax module (obtained from
> Camlp4.OCamlInitSyntax.Make) for parsing different files with
> possibly different parsers or extensions loaded. How do I reset a
> Camlp4Syntax module into its initial state such that it is ready
> to get applied to the next set of syntax extensions for the next
> file to parse?
You have to make a functor that clears all entries of the grammar. All
entries for the OCaml likes grammars are in camlp4/Camlp4/OCamlInitSyntax.ml
and you can clear them with Gram.Entry.clear.
--
Nicolas Pouillard aka Ertai
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 194 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-04-08 12:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-07 21:05 Camlp4: How to reset a Camlp4Syntax into pristine state? Hendrik Tews
2008-04-08 12:32 ` [Caml-list] " Nicolas Pouillard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox