use of org.stringtemplate.v4.STWriter in project antlr4 by tunnelvisionlabs.
the class CodeGenerator method write.
public void write(ST code, String fileName) {
try {
@SuppressWarnings("unused") long start = System.currentTimeMillis();
Writer w = tool.getOutputFileWriter(g, fileName);
STWriter wr = new AutoIndentWriter(w);
wr.setLineWidth(lineWidth);
code.write(wr);
w.close();
@SuppressWarnings("unused") long stop = System.currentTimeMillis();
} catch (IOException ioe) {
tool.errMgr.toolError(ErrorType.CANNOT_WRITE_FILE, ioe, fileName);
}
}
use of org.stringtemplate.v4.STWriter in project antlr4 by antlr.
the class CodeGenerator method write.
public void write(ST code, String fileName) {
try {
// long start = System.currentTimeMillis();
Writer w = tool.getOutputFileWriter(g, fileName);
STWriter wr = new AutoIndentWriter(w);
wr.setLineWidth(lineWidth);
code.write(wr);
w.close();
// long stop = System.currentTimeMillis();
} catch (IOException ioe) {
tool.errMgr.toolError(ErrorType.CANNOT_WRITE_FILE, ioe, fileName);
}
}
Aggregations