Larry Wall wrote in perl.perl6.language :
> 
> Such a grammar switching routine could operate either over a lexical
> scope or over the rest of the file.  The only restriction is that
> one module not clobber the grammar of a different module.
> 
> Basically, we're trying to make the opposite mistake of the one
> we made with source filters.  :-)

I see that. But should it be possible to import grammar rules,
to allow :

    use Some::Module::That::Modifies::A::Grammar::Rule;
    # continue to parse the perl program with the modified grammar

or even :
    {
        use Some::Module::That::Modifies::A::Grammar::Rule;
        # continue to parse the block with the modified grammar
    }

And what about switching to a different or modified tokenizer ?

Reply via email to