Rev | Line | |
---|
[1] | 1 | package antlr; |
---|
| 2 | |
---|
| 3 | /* ANTLR Translator Generator |
---|
| 4 | * Project led by Terence Parr at http://www.cs.usfca.edu |
---|
| 5 | * Software rights: http://www.antlr.org/license.html |
---|
| 6 | * |
---|
| 7 | * $Id: //depot/code/org.antlr/release/antlr-2.7.7/antlr/DefaultFileLineFormatter.java#2 $ |
---|
| 8 | */ |
---|
| 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 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.