2

Current project I'm working on is limited to using antlr 3.5.2, but I would like to use the featureset of StringTemplate 4 for our code generation. Can antlr 3.5.2 generate a java treewalker that uses StringTemplate 4? (e.g. a tree grammer with output=template that results in a java file with ST* references instead of StringTemplate*)

Bas
  • 834
  • 6
  • 15

1 Answers1

3

The output=template option only supports StringTemplate 3. You can still support StringTemplate 4, but it would require using embedded actions or a hand-written walker similar to the ones ANTLR 4 generates automatically.

The ANTLR 4 tool itself uses the second option.

Sam Harwell
  • 97,721
  • 20
  • 209
  • 280