Combining Antlr 3.5.2 with StringTemplate 4 for co

2019-08-14 21:07发布

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*)

1条回答
三岁会撩人
2楼-- · 2019-08-14 21:40

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.

查看更多
登录 后发表回答