Re:Show HN: How to write a recursive descent parser
by bd82 on Tuesday March 21, 2017 @08:17AM
(#13921483)
Or you could take the middle ground and use a library meant
to make it easier to create hand built parsers.
as opposed to a library that generates a parser for you.
* Repo: https://github.com/SAP/chevrotain
* Online Playground: http://sap.github.io/chevrotain/playground/
This handles the repetitive parts such as lookahead functions creation or Parse Tree building, while also providing advanced features such as error recovery or syntactic content assist (auto complete).
* ECMAScript family of languages supported (JavaScript/TypeScript/CoffeeScript).
Re:Show HN: How to write a recursive descent parser
by fooker on Tuesday March 21, 2017 @06:13AM
(#13920942)
Not really, it is rather easy to hack features into a recursive descent parser.
That is is the main reason almost all production compilers are written that way.
With a parser generator, it quickly becomes a game of designing your language and its semantics around the limitations of the generator you are using.
Maybe, but if you want all of the features mentioned above (incremental parsing etc.), then writing a parser becomes much more complicated.