hi there,
are there any complex examples of tree walkers emitting stringtemplates?
What I want to do is to generate C++ header and implementation files
with forward declarations etc
This means that names might show up in multiple places in the resulting files.
here is a small example:
walker:
module
: ^(R n=IDENT) -> R(name={$n})
;
header file:
#include "<R>.h"
class <R>; // ok, no one would do that ...
class <R> : public <R>
{
R r1;
R* r2;
};
I know that I can build up data structures in the walker, finally
triggering a global stringtemplate (as far as I know this is what
happens in the ANTLR backend).
The stringtemplate in this case would look pretty much like the
header file above.
But how can I do that with the "->" semantics in the walker? Do I
need multiple passes then, replacing the string template group file
and collecting the results afterwards?
thx
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---