News for hackers. Stuff that matters.
Re:A Working Mathematician’s Guide to Parsing by RiversHaveWings on Friday May 03, 2019 @05:47AM (#19816895)
My go-to library for parsing in Python is https://github.com/pyparsing/pyparsing, a https://en.wikipedia.org/wiki/Parsing_expression_grammar -based https://en.wikipedia.org/wiki/Parser_combinator library. I generally find it much easier to get my head around parser combinators than parser generators.
Re:A Working Mathematician’s Guide to Parsing by vorg on Friday May 03, 2019 @12:28PM (#19819791)
As the author says:

> because the parser generator knows about all patterns you want to match in advance, it will match longer terminals before shorter—more ambiguous—terminals

If you don't mind manually ordering your choices in your alt operators, then PEG and parser combinators are OK.

Oh, and you often need to restructure your grammar to avoid left recursion.