1 package net.sourceforge.phpdt.internal.compiler.parser;
4 * Exception for a syntax error detected by the parser.
6 public class SyntaxError extends Error {
8 /** The line where the error start */
10 /** The column where the error start */
12 /** the current line. */
14 /** The error message. */
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
25 public SyntaxError(int lineNumber, int columnNumber, String currentLine, String error) {
26 this.lineNumber = lineNumber;
27 this.columnNumber = columnNumber;
28 this.currentLine = currentLine;
33 * Get the error message.
34 * @return the error message
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++) {
46 // return buf.toString();
49 // System.err.println(currentLine);
50 //System.err.println(columnNumber);
55 * Get the line number where the error happens
56 * @return the line number
58 public int getLine() {