[antlr-dev] Re: [stringtemplate-interest] ST/ANTLR debugging

Kay Roepke kroepke at dolphin-services.de
Sun May 21 15:56:35 PDT 2006


On 21. May 2006, at 21:15 Uhr, Kay Roepke wrote:

> The basic idea is to provide a point where ST registers decisions  
> taken, templates instantiated, attributes set, and output written.  
> Add a couple of helper classes to serialize
> important objects like Rule from v3 and a separated application  
> that listens for these events and then puts them in the right  
> order. Do some analysis on the data and you can do
> a hell of lot for the poor guy figuring out where that dreaded  
> attribute is coming from. All in one place, even with templates  
> instantiated in the CodegenTreeWalker. Thanks to
> the included stacktraces in the events you know instantly where to  
> look. No find dialog and single stepping required, unless you need  
> to know exactly what happens.

Ok. Just FYI Ter and I have spoken earlier about this thing and came  
to the agreement that it would be a nice thing to integrate this into  
ST. As Jean Bovet is currently busy, we will
have to wait for him to integrate it into ANTLRWorks but both like to  
see it integrated.

I'm currently reading the code to identify the spots which need to  
emit tracing events. The goal is to integrate this into some future  
ST release.
The preliminary list is:
1) set attribute event - comes in different flavors depending on what  
the type of the value is
2) instantiate template event - also different flavors (call of anon  
template, call of name template, separate instantiate but set as an  
attribute)
3) boolean expression event - aka if condition
4) template write events - show the actual uses of attributes (#3 is  
a special case of this as I suddenly realize ;))

The list may not be complete or even may be obese at the moment, but  
I'm still reading.

My initial implementation will be Mac OS X only, but the relevant  
code will be separate and I will try to provide reasonable  
documentation for the protocol used, so that it shall be
easy for folks to implement a different client/transportation mode  
(sockets or whatever).
I'll also provide the separate Debug/Tracer application in source and  
binary, so people can play with it/enhance it/port it. I hope Jean  
comes back into the action soon, so he can integrate this
in ANTLRWorks.

Aah, and the serialized form of the attributes will be string-based  
for now, because it's pretty hard to do a general case mechanism for  
each and every object people can stuff into
ST. I'm thinking about providing such serialization classes to all  
important v3 classes that might be interesting, but first things  
first ;)

-k


More information about the stringtemplate-interest mailing list