ANTLR Mega Tutorial
I last played around with ANTLR in 2012 (when it was version 3) and I discovered that there's a "bigger picture" to the parser generator universe that most tutorials don't talk about:<p>1) ANTLR is a good tool for generating "happy path" parsers.  With a grammar specification, it easily generates a parser that accepts or rejects a piece of source code.  However, it's not easy to use the hooks to generate high quality diagnostic error messages.<p>2) ANTLR was not good for speculative parsing or probabilistic parsing which would be the basis of today's generation of tools such as "Intellisense" not giving up on parsing when there's an unclosed brace or missing variable declaration.<p>The common theme to the 2 bullet points above is that a high quality compiler written by hand will hold multiple "states" of information and an ANTLR grammar file doesn't really have an obvious way to express that knowledge.  A pathological example would be the numerous "broken HTML" pages being successfully parsed by browsers.  It would be very hard to replicate how Chrome/Firefox/Safari/IE doesn't choke on broken HTML by using ANTLR to generate an HTML parser.<p>In short, ANTLR is great for <i>prototyping</i> a parser but any industrial-grade parser released into the wild with programmers' expectations of helpful error messages would require a hand-written parser.<p>Lastly, the lexing (creating the tokens) and parsing (creating the AST) is a <i>very tiny percentage</i> of the total development of a quality compiler.  Therefore, ANTLR doesn't save as much time as one might think.<p>I welcome any comments about v4 that makes those findings obsolete.