NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Separate grammar from BEGIN blocks? (Score:2)
1) They're safe to execute.
2) The tools can be made aware of grammar changes.
It might not even need to be as restrictive as all that, maybe just that grammar changes happen in a "Safe" compartment which doesn't allow access to the outside world. This allows some flexibility when defining the grammar while still making it safe to run.
It might already work this way, I haven't looked.
Reply to This
Re: (Score:1)
Re: (Score:1)
If "=" is mapped to sub equals, you shouldn't need to run equals while parsing, right?
Re: (Score:1)
Re: (Score:1)
And so they don't present a decidability problem, at least for the parsing primitives that are available out the box.
If we DO allow arbitrary grammar modifications, and those modifications will result in the execution of arbitrary code, well then we're back into the decidability quagmire again.
In fact, if arbitrary grammar chances are trivially associational with arbitrary compile-time execution then that should pretty much clearly
Re: (Score:1)
However, as long as this is trusted code, which you can determine by introspecting it, I don't think this is a problem.