3 ms·
It is context free. Just because two tokens (INDENT, OUTDENT) are different to lex doesn't mean the grammar isn't context free. The only reason same-line brace
by lucian1900 13y ago
It is context free. Just because two tokens (INDENT, OUTDENT) are different to lex doesn't mean the grammar isn't context free.
The only reason same-line braces are required is semicolon insertion. There are other ways to express the grammar of a language without semicolons and remain context-free.
- chimeracoder 13y ago> There are other ways to express the grammar of a language without semicolons and remain context-free. Yes, you could use s-expressions, for example. I never said that this was the only way; I just explained part of the reason for the choice.
- lucian1900 13y agoNo, there are other ways to express the exact same syntax with a context-free grammar, for example making newlines a significant token.