> ANTLR uses an algorithm [...] called ALL. Why is the tool called ANT LR if it uses an LL algorithm? Did earlier versions use LR, or is it just a confusing name?
Why not to use (f)lex, yacc or bison
41–50 of 91 posts
Re: Why not to use (f)lex, yacc or bison
#42Is it not the case that most serious parser implementations are hand-written? In part because it makes it so much easier to provide good diagnostic messages. I feel like every other project moves from parser-generators to hand-rolled parsers and levels.
Basically the key insight is that you can use the parsing automaton state to classify syntax errors, which makes it as easy as falling off a log to produce good messages. The paper originating this technique is Clinton Jeffery's TOPLAS 2003 paper “Generating LR Syntax Error Messages from Examples.” This is what go uses, and OCaml uses a more advanced version of this technique introduced by Francois Pottier in his CC 2016 paper "Reachability and Error Diagnosis in LR(1) Parsers".
Re: Why not to use (f)lex, yacc or bison
#43Re: Why not to use (f)lex, yacc or bison
#44Re: Why not to use (f)lex, yacc or bison
#45> ANTLR uses an algorithm [...] called ALL. Why is the tool called ANT LR if it uses an LL algorithm? Did earlier versions use LR, or is it just a confusing name?
I think officially it is "ANother Tool for Language Recognition", unofficially it is "Anti LR", which usually is the mindset of ANTLR adherents.
Re: Why not to use (f)lex, yacc or bison
#46I tried to read this article, but unfortunately the lack of grammar was too distracting and I just couldn't get through it. A lot of these are things that Google Docs or Microsoft Word will notice and ask you to change. I highly recommend using one of those to write (especially if English is not your first language) and trying to understand the suggestions it makes. Your articles will come out much more readable to o…
lack of "proper" grammar
or bad grammar
How ironic x 2!Re: Why not to use (f)lex, yacc or bison
#47Is it not the case that most serious parser implementations are hand-written? In part because it makes it so much easier to provide good diagnostic messages. I feel like every other project moves from parser-generators to hand-rolled parsers and levels.
Also note the amazing architecture behind the Golang template parser/lexer A talk by Rob Like: https://talks.golang.org/2011/lex.slide
- Grammar documentation: https://golang.org/pkg/text/template/
- Code: https://golang.org/src/text/template/parse/lex.go
Edit: His name is Rob Pike
Re: Why not to use (f)lex, yacc or bison
#48> Can you even imagine the quality of code that was written and fixed for 30 years? Total nonsense. Bison is very reliable, Flex can be a bit finicky to set up but is also reliable. PostgreSQL uses bison ...
Re: Why not to use (f)lex, yacc or bison
#49"ANTLR instead is more actively developed. It has been re-written from scratch a few times during the years, so the code has is of good quality." ... rewrites improve code quality ... right ... right???
Re: Why not to use (f)lex, yacc or bison
#50"ANTLR instead is more actively developed. It has been re-written from scratch a few times during the years, so the code has is of good quality." ... rewrites improve code quality ... right ... right???
But every time I take a new look at Antlr there's a huge amount of issues related to the fact that they have a huge new rewrite deprecating old versions while the new version is not ready: entirely new ways of doing things with missing documentation and examples, incomplete or missing language backends, and missing packaging for various Linux distributions.
What I get from it is: Antlr is a very powerful project... if you're in the Java ecosystem and if you're willing to use old no longer supported versions.
Otherwise, questionable choice.