01: // Copyright (c) Corporation for National Research Initiatives
02: package org.python.core;
03:
04: /**
05: * A convience class for creating Syntax errors. Note that the
06: * syntax error is still taken from Py.SyntaxError.
07: * <p>
08: * Generally subclassing from PyException is not the right way
09: * of creating new exception classes.
10: */
11:
12: public class PySyntaxError extends PyException {
13: int lineno, column;
14: String text;
15: String filename;
16:
17: public PySyntaxError(String s, int line, int column, String text,
18: String filename) {
19: super (Py.SyntaxError);
20: PyObject[] tmp = new PyObject[] { new PyString(filename),
21: new PyInteger(line), new PyInteger(column),
22: new PyString(text) };
23:
24: this .value = new PyTuple(new PyObject[] { new PyString(s),
25: new PyTuple(tmp) });
26:
27: this.lineno = line;
28: this.column = column;
29: this.text = text;
30: this.filename = filename;
31: }
32: }
|