RE: cloning precompiled parsers or mixing with non-precompiled
[email protected] ("Orton, Yves")
| Newsgroups | perl.recdescent |
|---|---|
| Message-ID | <71B318898201D311845C0008C75DAD1C06F1E40C@defra1ex2> |
Dave McD wrote:
> It seems that the namespace for pre-compiled parsers
> (ie. compiled into a perl module) have hard-coded
> namespaces (IE. namespace00001).
Hmm. well line 1692 reads:
my $nextnamespace = "namespace000001";
So if you find that then I think that if you add the following
sub set_namespace {
local $_=$_[1];
croak "$_ is not a legal namespace." if /[^\w]/;
$_.="00" unless /\d+$/;
$nextnamespace=$_;
}
Then you can call
Parse::RecDescent->set_namespace("MyNameSpace");
And it will start counting in the new namespace.
HTH for now...
Yves