title: How to use stringtemplate in Antlr (rewrite)
body: <p>I would have this problem :
  i given this rules</p>
  
  <pre><code> expr: (NUM -&gt; NUM) ( a=NUM -&gt; ^(PLUS   $expr   $a ))* ;
  
      NUM   : '0'..'9'+;
      WS    :  ( ' ' | '\t' | '\r' | '\n'  ) {$channel=HIDDEN;};
  </code></pre>
  
  <p>parses the input "1 2 3 4" as follows:</p>
  
  <pre><code>(PLUS (PLUS (PLUS  1  2)  3)  4)
  </code></pre>
  
  <p>my problem is how can i use 'template' or the file '.stg'  to get the output</p>
  
  <pre><code>1+2+3+4
  </code></pre>
  
  <p>the <strong>wrong</strong> stringtemplate rule  </p>
  
  <pre><code>expr  :^(plus  a=multi  b=NUM )    -&gt;template(f1={$a.st},f2={$b.st})"&lt;f1&gt;+&lt;f2&gt;"
  </code></pre>
  
  <p>Thank you, Bart Kiers!!!</p>