01: package persistence.antlr;
02:
03: /* ANTLR Translator Generator
04: * Project led by Terence Parr at http://www.jGuru.com
05: * Software rights: http://www.antlr.org/license.html
06: *
07: */
08:
09: public class RecognitionException extends ANTLRException {
10: public String fileName; // not used by treeparsers
11: public int line;
12: public int column;
13:
14: public RecognitionException() {
15: super ("parsing error");
16: fileName = null;
17: line = -1;
18: column = -1;
19: }
20:
21: /**
22: * RecognitionException constructor comment.
23: * @param s java.lang.String
24: */
25: public RecognitionException(String s) {
26: super (s);
27: fileName = null;
28: line = -1;
29: column = -1;
30: }
31:
32: /** @deprecated As of ANTLR 2.7.2 use {@see #RecognitionException(char, String, int, int) } */
33: public RecognitionException(String s, String fileName_, int line_) {
34: this (s, fileName_, line_, -1);
35: }
36:
37: /**
38: * RecognitionException constructor comment.
39: * @param s java.lang.String
40: */
41: public RecognitionException(String s, String fileName_, int line_,
42: int column_) {
43: super (s);
44: fileName = fileName_;
45: line = line_;
46: column = column_;
47: }
48:
49: public String getFilename() {
50: return fileName;
51: }
52:
53: public int getLine() {
54: return line;
55: }
56:
57: public int getColumn() {
58: return column;
59: }
60:
61: /** @deprecated As of ANTLR 2.7.0 */
62: public String getErrorMessage() {
63: return getMessage();
64: }
65:
66: public String toString() {
67: return FileLineFormatter.getFormatter().getFormatString(
68: fileName, line, column)
69: + getMessage();
70: }
71: }
|