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