4 ms·
I think you hit the nail on the head there. "Context-free" is more of a requirement than LALR or LL. The author clearly isn't a parser writer. I am, but I've ye
by binaryfinery 16y ago
I think you hit the nail on the head there. "Context-free" is more of a requirement than LALR or LL. The author clearly isn't a parser writer. I am, but I've yet to try a PEG grammar because ANTLR does such a great job.
But this doesn't change his point (or mine): languages should be created that are easy to write parsers for, so that its easier to write good tools.
And I think this applies to the grammar too: ANTLR's .g files are a good grammar language because its easy to write tools for - hence AntlrWorks.
- beza1e1 16y agoI'm the author and i did write some parsers. However i'm more in the write-parser-by-hand camp and context-free is not so hard here. ANTLR needs strange hacks to parse Python with its whitespace indentation. A handwritten parser just needs some context within the lexer. In my eyes a parser generator is the solution, if you want to trade efficiency for cross-language-portability. ANTLR is probably the best solution at this point, though the C backend is quite wierd.
- binaryfinery 16y agoI like to get shit working first, and then downcode if the PG does a horrible job. Nothing better than a hand-written anything, but I like the options of tools. Stange hacks for python supports your original argument I believe.