[antlr-interest] Why can't I make StringTemplate to indent?
Vinicius Durelli
vinicius.durelli at gmail.com
Sat Aug 18 13:53:03 PDT 2012
Hi all,
I have the following StringTemplate group
group RPInstr;
before(firstStat) ::= <<
<{<[beforeEnteringInstr(),firstStat]; anchor, separator="\n">}; anchor>
>>
beforeEnteringInstr() ::= "before();"
I am trying to make the first statement of a method to align with the
instrumentation code ("before();").
However, what I am getting right now is something like this:
public int method() {
before();
System.out.println("testing");
System.out.println("testing again");
}
What is the proper way to indent before(); and the next statement so I get
the following?
public int method() {
before();
System.out.println("testing");
System.out.println("testing again");
}
Thanks in advance.
PS: the options that I am using in my grammar are the following
options {output=template; rewrite=true; backtrack=true; memoize=true;}
Regards,
~Vinicius
More information about the antlr-interest
mailing list