[antlr-interest] Parse tree in the debugger

Loring Craymer lgcraymer at yahoo.com
Wed Sep 24 10:19:03 PDT 2008


Andy--

DSLs can be extraordinarily simple; in this case, the solution could be "spend a couple of days codifying (and writing the language processor in a couple of hours--as I said, simple) the output" or adopting Gerald's suggestion (if it covers the profiling output--which it might).  Right now, the protocol is in an "it just grew" state where it is probably easier to do a quick re-design rather than repeated patching.  Sometimes, you just need to find out what you have done, do it right, and move on.

Besides, if you are only using ANTLR for heavy-duty translators, you are unlikely even to be building those efficiently; constructing small DSLs for automation can markedly decrease development time.  It's all about good design practice.

--Loring



----- Original Message ----
> From: Andy Tripp <antlr at jazillian.com>
> Cc: antlr mailing list <antlr-interest at antlr.org>
> Sent: Wednesday, September 24, 2008 10:03:36 AM
> Subject: Re: [antlr-interest] Parse tree in the debugger
> 
> Loring Craymer wrote:
> > Why hack?  Why not specify a DSL for the debugger/profiler/whatever and make 
> the output conform.  That's a whole lot more maintainable over the long run.
> > 
> > --Loring
> > 
> 
> In other words, make your famous quote more general:
> 
> "Why spend writing it by hand when you can spend 
> automating it?"
> 
> ...where in the original quote you had "5 days" and "5 years", now we have "5 
> minutes"
> and "5 weeks" (5 minutes to just fix the space problem, or 5 weeks to invent a 
> real DSL
> for ANTLR-interacting tools).
> 
> And please, going forward, don't just write out plain English statements such as 
> "Why spend 5 days...".
> Instead, provide them as formal assertions in a formal language that can be 
> added to the
> appropriate ontology. This makes them much more useful and maintainable.
> 
> What's that? The suggestion is not to "automate" but rather to "create a new 
> DSL?" Great!
> Since you've creating this cute saying as a formal statement in a flexible DSL, 
> we can replace
> the word "automating" with a more general placeholder, which can have 
> instantiations such
> as "automating" or "creating a DSL for", etc. And then it's a simple matter to 
> enhance
> the semantic analysis to validate it. Isn't that a lot easier than just writing 
> out
> a plain English sentence?
> 
> There's really no job so small that a new DSL shouldn't be invented for it.
> For example, I've now decided that just signing emails "Andy" is just not 
> maintainable.
> What if I change my name? What if people want to know my official name? What if 
> people
> want to see my name in their native language? So starting now, I'm going to sign
> email in XML. I'll be publish the DTD along with a parser any day now.
> 
> 
>   
>     
>         Andrew
>         H.
>         Tripp
>     
>     Andy
>   
> 
> 
> 
> Andy ;)
> 
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: 
> http://www.antlr.org/mailman/options/antlr-interest/your-email-address



      


More information about the antlr-interest mailing list