3 * Copyright (C) 2000 Klaus Hartlage
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 package net.sourceforge.phpeclipse.phpeditor.phpparser;
22 * Exception for a syntax error detected by the HartMath parser.
24 public class SyntaxError extends Error {
26 /** The line where the error start */
28 /** The column where the error start */
30 /** the current line. */
32 /** The error message. */
36 * SyntaxError exception
37 * @param lineNumber the line number where the error start
38 * @param columnNumber the column where the error start
39 * @param currentLine the line where the error end
40 * @param error the error message
43 public SyntaxError(int lineNumber, int columnNumber, String currentLine, String error) {
44 this.lineNumber = lineNumber;
45 this.columnNumber = columnNumber;
46 this.currentLine = currentLine;
51 * Get the error message.
52 * @return the error message
54 public String getMessage() {
55 // StringBuffer buf = new StringBuffer(256);
56 // buf.append("Syntax error in line:");
57 // buf.append(lineNumber+1);
58 // buf.append(": "+ error + "\n");
59 // buf.append( currentLine + "\n");
60 // for (int i=0; i<(columnNumber-1); i++) {
64 // return buf.toString();
67 // System.err.println(currentLine);
68 //System.err.println(columnNumber);
73 * Get the line number where the error happens
74 * @return the line number
76 public int getLine() {