4 ms·
When I switched from ANTLR to hand written for Adama ( http://www.adama-lang.org/ http://www.adama-lang.org/ ), I felt way better about things. I was able to ge
by mathgladiator 5y ago
When I switched from ANTLR to hand written for Adama ( http://www.adama-lang.org/ http://www.adama-lang.org/ ), I felt way better about things. I was able to get sane error messages, and I could better annotate my syntax tree with comments and line/char numbers.
A killer feature for a parser generator would be the ability to auto-generate a pretty printer which requires stuffing comments into the tree as a "meta token".
- fjfaase 5y agoI implemented an unparse function in IParse, which is not a parser generator, but a parser that interprets a grammar. See for example https://github.com/FransFaase/IParse/blob/master/software/c_pp.gr https://github.com/FransFaase/IParse/blob/master/software/c_... where symbols starting with a back slash are a kind of white space terminals during the unparse. For example, \inc stands for incrementing the indentation where \dec decrements it. The \s is used to indicate that at given location a space should be included.
- jwlato 5y agoHave you seen BNFC (http://bnfc.digitalgrammars.com/ http://bnfc.digitalgrammars.com/)? I've used it with the Haskell bindings and really appreciated it. Parser, pretty-printer, and AST skeleton all auto-generated. I've only used it with Haskell though, can't speak to the other languages.
- mbrodersen 5y agoSomebody unfortunately chose to use ANTLR on a project I am now maintaining. ANTLR is really really bad. Run don’t walk away.