1) Fixed issue #872.
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / parser / SyntaxError.java
1 package net.sourceforge.phpdt.internal.compiler.parser;
2
3 /**
4  * Exception for a syntax error detected by the parser.
5  */
6 public class SyntaxError extends Error {
7
8         /**
9          * 
10          */
11         private static final long serialVersionUID = -8723926000065578914L;
12
13         /** The line where the error start */
14         int lineNumber;
15
16         /** The column where the error start */
17         int columnNumber;
18
19         /** the current line. */
20         String currentLine;
21
22         /** The error message. */
23         String error;
24
25         /**
26          * SyntaxError exception
27          * 
28          * @param lineNumber
29          *            the line number where the error start
30          * @param columnNumber
31          *            the column where the error start
32          * @param currentLine
33          *            the line where the error end
34          * @param error
35          *            the error message
36          * @see
37          */
38         public SyntaxError(int lineNumber, int columnNumber, String currentLine,
39                         String error) {
40                 this.lineNumber = lineNumber;
41                 this.columnNumber = columnNumber;
42                 this.currentLine = currentLine;
43                 this.error = error;
44         }
45
46         /**
47          * Get the error message.
48          * 
49          * @return the error message
50          */
51         public String getMessage() {
52                 // StringBuffer buf = new StringBuffer(256);
53                 // buf.append("Syntax error in line:");
54                 // buf.append(lineNumber+1);
55                 // buf.append(": "+ error + "\n");
56                 // buf.append( currentLine + "\n");
57                 // for (int i=0; i<(columnNumber-1); i++) {
58                 // buf.append(' ');
59                 // }
60                 // buf.append('^');
61                 // return buf.toString();
62
63                 // System.err.println(currentLine);
64                 // System.err.println(columnNumber);
65                 return error;
66         }
67
68         /**
69          * Get the line number where the error happens
70          * 
71          * @return the line number
72          */
73 //      public int getLine() {
74 //              return lineNumber;
75 //      }
76 }