Well put.
The clearest description of Python's approach I've read, explained it as a
lexer that tracked indentation level, and inserted appropriate tokens when it
changed.
Oh, a side point: there's some confusion introduced by the lack of a
scanner/lexer in modern all-in-one-parsers.
Python, for example, uses a scanner and so its grammar is nominally not
context sensitive, but its scanner very much is (maintaining a stack of
indentation exactly as OP was asking abou
Hostile or not, thanks for your informative reply.
Thank you, very much. Yes, I'm disappointed, but I'd rather know.
>
> Having the minutia of the programmatic run-time state of the parse then
> influence the parse itself, is at the heart of the perl5 phenomenon "only
> Perl can parse perl"
I don't mean to be hostile, but you're demonstrably wrong, here. (also it's
"only perl can parse Perl" as in, only the "pe
On Tue, Sep 13, 2016 at 10:35:01AM -0400, Bennett Todd wrote:
> Having the minutia of the programmatic run-time state of the parse then
> influence the parse itself, is at the heart of the perl5 phenomenon "only
> Perl can parse perl", which I rather hope isn't going to be preserved in
> perl6.
Hi Bennett,
There are many situations that require non-contextfree languages. Even
though much of these could be solved in the AST-building step (called
'transduction' in my days) instead of the parsing step, that does not
solve all cases. I am just wondering if and to what extent we can parse
Having the minutia of the programmatic run-time state of the parse then
influence the parse itself, is at the heart of the perl5 phenomenon "only Perl
can parse perl", which I rather hope isn't going to be preserved in perl6.
Thanks Timo and Brian,
both examples are educational. However, they have a common limitation in
that they both perform their magic after a Match object has been
created. I was trying to influence the parsing step itself.
I am experimenting to find if I can influence the parsing process
progr