[antlr-interest] Parse tree in the debugger

Andy Tripp antlr at jazillian.com
Wed Sep 24 10:54:55 PDT 2008


Yes, a DSL can be trivial, but not using a DSL can be even more trivial.
If it takes just days to create a DSL, it might take just seconds to just "hack it".

The "protocol" might be something so simple that it could be described in a
sentence or two, or as trivial data structure or two. I have no idea
how simple the ANTLR/Antlrworks interface is, but if it can be described
in email that's shorter than this one, a DSL is overkill, IMO.

And even if it's a non-trivial interface, a DSL might not be the simplest/
most maintainable solution. Just having a couple of methods like:

ANTLRInfo getANTLRInfo(SomeCriteria p);
void sendANTLRInfo(SomethingElse p);

...and using RMI might be the easiest. No DSL, no parsing engine, no
validation. Just passing around simple Java objects.

DSLs have their place, but they're not the best solution in a lot of cases,
like trivial communications within or between Java programs.

Andy

Loring Craymer wrote:
> 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


More information about the antlr-interest mailing list