[antlr-interest] A postmortem of my use of antler

Andy Tripp antlr at jazillian.com
Tue Mar 11 12:08:26 PDT 2008


Darien Hager wrote:
> Andy: I agree. Perhaps examples involving embedding application code 
> into a grammar should be introduced after all of the basics for 
> creating an AST. This de-emphasizes knowing the inner workings of the 
> code generation, and is less threatening to new 
> users (e.g. those with no language-parsing experience beyond simple regular expressions.) 
>
>
> The reason I say "less threatening" is because--perceptually--it 
> provides better encapsulation. While it doesn't show off all that 
> ANTLR can do, it provides a nice understandable set of boundaries to 
> start learning with: "Text goes in, tree structure comes out". Leading 
> off with "Here is how basically your entire calculator program is 
> implemented in ANTLR" is a comparatively creepy example. It triggers 
> instinctual fear of lock-in and needing weirdly re-implement existing 
> code inside a grammar file.
Right. The newbie doesn't understand "this example is just showing me 
the power of ANTLR so that later, if I get
stuck, I'll see how I can pass values around in the generated code to 
solve some other problem". He reads that
example and says "Oh, wow, ANTLR is for more than just parsing. I'm 
supposed to do my actual work right here
in ANTLR!"  A language guru would salivate at that point, feeling that 
this is an amazingly powerful new tool that
will be fun to learn. But the non-language newbie guru who wants to 
spend no more than a day learning ANTLR
and just needs to parse his simple DSL, is not drooling...he's breaking 
out in a cold sweat.


More information about the antlr-interest mailing list