Use new STGroup.GROUP_FILE_EXTENSION value

This commit is contained in:
Sam Harwell 2012-12-11 08:41:59 -06:00
parent 1411a561ab
commit b822070790
4 changed files with 4 additions and 3 deletions

View File

@ -8,6 +8,7 @@ December 11, 2012
* Fix template issues
* GrammarASTWithOptions.getOptions never returns null
* Use EnumSet instead of HashSet
* Use new STGroup.GROUP_FILE_EXTENSION value
December 2, 2012

View File

@ -36,7 +36,7 @@
<dependency>
<groupId>org.antlr</groupId>
<artifactId>ST4</artifactId>
<version>4.0.7-rc-1</version>
<version>4.0.7-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>

View File

@ -115,7 +115,7 @@ public class CodeGenerator {
public void loadTemplates(String language) {
try {
templates = new STGroupFile(TEMPLATE_ROOT+"/"+language+"/"+language+".stg");
templates = new STGroupFile(TEMPLATE_ROOT+"/"+language+"/"+language+STGroup.GROUP_FILE_EXTENSION);
templates.registerRenderer(Integer.class, new NumberRenderer());
templates.registerRenderer(String.class, new StringRenderer());
templates.setListener(new STErrorListener() {

View File

@ -270,7 +270,7 @@ public class ErrorManager {
*/
public void setFormat(String formatName) {
this.formatName = formatName;
String fileName = FORMATS_DIR +formatName+".stg";
String fileName = FORMATS_DIR +formatName+STGroup.GROUP_FILE_EXTENSION;
ClassLoader cl = Thread.currentThread().getContextClassLoader();
URL url = cl.getResource(fileName);
if ( url==null ) {