A massive organize imports and formatting of the sources using default Eclipse code...
[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         /** The line where the error start */
9         int lineNumber;
10
11         /** The column where the error start */
12         int columnNumber;
13
14         /** the current line. */
15         String currentLine;
16
17         /** The error message. */
18         String error;
19
20         /**
21          * SyntaxError exception
22          * 
23          * @param lineNumber
24          *            the line number where the error start
25          * @param columnNumber
26          *            the column where the error start
27          * @param currentLine
28          *            the line where the error end
29          * @param error
30          *            the error message
31          * @see
32          */
33         public SyntaxError(int lineNumber, int columnNumber, String currentLine,
34                         String error) {
35                 this.lineNumber = lineNumber;
36                 this.columnNumber = columnNumber;
37                 this.currentLine = currentLine;
38                 this.error = error;
39         }
40
41         /**
42          * Get the error message.
43          * 
44          * @return the error message
45          */
46         public String getMessage() {
47                 // StringBuffer buf = new StringBuffer(256);
48                 // buf.append("Syntax error in line:");
49                 // buf.append(lineNumber+1);
50                 // buf.append(": "+ error + "\n");
51                 // buf.append( currentLine + "\n");
52                 // for (int i=0; i<(columnNumber-1); i++) {
53                 // buf.append(' ');
54                 // }
55                 // buf.append('^');
56                 // return buf.toString();
57
58                 // System.err.println(currentLine);
59                 // System.err.println(columnNumber);
60                 return error;
61         }
62
63         /**
64          * Get the line number where the error happens
65          * 
66          * @return the line number
67          */
68         public int getLine() {
69                 return lineNumber;
70         }
71 }