KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > antlr > RecognitionException


1 package antlr;
2
3 /* ANTLR Translator Generator
4  * Project led by Terence Parr at http://www.jGuru.com
5  * Software rights: http://www.antlr.org/RIGHTS.html
6  *
7  * $Id: //depot/code/org.antlr/main/main/antlr/RecognitionException.java#5 $
8  */

9
10 public class RecognitionException extends ANTLRException {
11     public String JavaDoc fileName; // not used by treeparsers
12
public int line; // not used by treeparsers
13
public int column; // not used by treeparsers
14

15     public RecognitionException() {
16         super("parsing error");
17         fileName = null;
18         line = -1;
19         column = -1;
20     }
21
22     /**
23      * RecognitionException constructor comment.
24      * @param s java.lang.String
25      */

26     public RecognitionException(String JavaDoc s) {
27         super(s);
28         fileName = null;
29         line = -1;
30         column = -1;
31     }
32
33     /**
34      * RecognitionException constructor comment.
35      * @param s java.lang.String
36      */

37     public RecognitionException(String JavaDoc s, String JavaDoc fileName_, int line_, int column_) {
38         super(s);
39         fileName = fileName_;
40         line = line_;
41         column = column_;
42     }
43
44     public String JavaDoc getFilename() {
45         return fileName;
46     }
47
48     public int getLine() {
49         return line;
50     }
51
52     public int getColumn() {
53         return column;
54     }
55
56     /** @deprecated As of ANTLR 2.7.0 */
57     public String JavaDoc getErrorMessage() {
58         return getMessage();
59     }
60
61     public String JavaDoc toString() {
62         return FileLineFormatter.getFormatter().
63             getFormatString(fileName, line, column) + getMessage();
64     }
65 }
66
Popular Tags