01: package antlr;
02:
03: /* ANTLR Translator Generator
04: * Project led by Terence Parr at http://www.cs.usfca.edu
05: * Software rights: http://www.antlr.org/license.html
06: */
07:
08: public class DefaultFileLineFormatter extends FileLineFormatter {
09: public String getFormatString(String fileName, int line, int column) {
10: StringBuffer buf = new StringBuffer();
11:
12: if (fileName != null)
13: buf.append(fileName + ":");
14:
15: if (line != -1) {
16: if (fileName == null)
17: buf.append("line ");
18:
19: buf.append(line);
20:
21: if (column != -1)
22: buf.append(":" + column);
23:
24: buf.append(":");
25: }
26:
27: buf.append(" ");
28:
29: return buf.toString();
30: }
31: }
|