1 package antlr; 2 3 9 10 public class DefaultFileLineFormatter extends FileLineFormatter { 11 public String getFormatString(String fileName, int line, int column) { 12 StringBuffer buf = new StringBuffer (); 13 14 if (fileName != null) 15 buf.append(fileName + ":"); 16 17 if (line != -1) { 18 if (fileName == null) 19 buf.append("line "); 20 21 buf.append(line); 22 23 if (column != -1) 24 buf.append(":" + column); 25 26 buf.append(":"); 27 } 28 29 buf.append(" "); 30 31 return buf.toString(); 32 } 33 } 34 | Popular Tags |