Re: Fwd: Re: grammars and indentation of input

2016-09-13 Thread Bennett Todd
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.

Re: Fwd: Re: grammars and indentation of input

2016-09-13 Thread Aaron Sherman
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

Re: Fwd: Re: grammars and indentation of input

2016-09-13 Thread Bennett Todd
Hostile or not, thanks for your informative reply.

Re: Fwd: Re: grammars and indentation of input

2016-09-13 Thread Bennett Todd
Thank you, very much. Yes, I'm disappointed, but I'd rather know.

Re: Fwd: Re: grammars and indentation of input

2016-09-13 Thread Aaron Sherman
> > 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

Re: Fwd: Re: grammars and indentation of input

2016-09-13 Thread Patrick R. Michaud
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.

Re: Fwd: Re: grammars and indentation of input

2016-09-13 Thread Theo van den Heuvel
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

Re: Fwd: Re: grammars and indentation of input

2016-09-13 Thread Bennett Todd
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.

Fwd: Re: grammars and indentation of input

2016-09-13 Thread Theo van den Heuvel
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