On Wed, 09 Aug 2000, Dan Sugalski wrote:
> I've not seen a pragma yet that affects lexing, though I may have missed
> some. (I don't consider the lexical/package thing a lexer issue, since it's
> not) They change the behaviour of the generated code, yes, but not the
> lexing/parsing/whatever of the perl source.
Funny you should mention that....
I just had a most interesting/horrible dream.
Nick (who I've never meet, seen, nor heard) spoke to me in a voice very
reminiscent of Obi-Wan Kenobi, and said, "Luke, you are an idiot."
Anyway, down in my dream-state, I realized that I was not making a
distinction between lexing and parsing, which apparently is a common
problem among people who a) are heavily drugged, and b) don't know what
they're talking about.
I was hoping to get back to the list before some caught my error, but
alas, I did not. :-( But, I'm awake now, so I might as well get back
to work.
So, ignore my entire post on lexing, and consider it to be a spewage on
parsing, with a sidetrack on whatever it is I actually wrote.
What I was trying to say, is that I think most of the language RFCs
could be addressed (in one way) by affecting whether and how the parser
interprets what the lexer gives to it.
There are some internal issues, like how lexical scoping would be
handled, but for the most part parser extensions would simply limit
what standard opcodes (or their ilk) would be generated.
Examples, I hope:
POP (Plain Old Perl):
$a = "foo";
my $b = "bar";
Lexes and Parses without an issue. The optree the interpreter
generates is (roughly) "foo" to global scalar a. "bar" to this block's
scalar b.
Perl with Perl Parser Pragma Module NaziRules::Scopage
$a = "foo";
my $b = "bar";
The Parser will error out with "Must have explicit scope for $a, line
#..."
Once it's fixed, "$main::a, or our $a, or
Scopage::SuperGlobalInUmpteenDifferentInterpreters::global $a = "foo";
the optree it spits out will *still* be valid Perl.... whatever that is.
Regardless of whether this is any clearer, I've still no idea how this
could be done. And I'm sure TMTOWTDI outside of all this.
--
Bryan C. Warnock
([EMAIL PROTECTED])