01: /*************************************************************************
02: * *
03: * 1) This source code file, in unmodified form, and compiled classes *
04: * derived from it can be used and distributed without restriction, *
05: * including for commercial use. (Attribution is not required *
06: * but is appreciated.) *
07: * *
08: * 2) Modified versions of this file can be made and distributed *
09: * provided: the modified versions are put into a Java package *
10: * different from the original package, edu.hws; modified *
11: * versions are distributed under the same terms as the original; *
12: * and the modifications are documented in comments. (Modification *
13: * here does not include simply making subclasses that belong to *
14: * a package other than edu.hws, which can be done without any *
15: * restriction.) *
16: * *
17: * David J. Eck *
18: * Department of Mathematics and Computer Science *
19: * Hobart and William Smith Colleges *
20: * Geneva, New York 14456, USA *
21: * Email: eck@hws.edu WWW: http://math.hws.edu/eck/ *
22: * *
23: *************************************************************************/package edu.hws.jcm.data;
24:
25: /**
26: * Represents a syntax error that is found while a string is being parsed.
27: */
28: public class ParseError extends RuntimeException {
29:
30: /**
31: * The parsing context that was in effect
32: * at the time the error occurred. This includes
33: * the string that was being processed and the
34: * position in the string where the error occured.
35: * These values are context.data and context.pos.
36: */
37: public ParserContext context;
38:
39: /**
40: * Create a new ParseError with a given error message and parsing context.
41: */
42: public ParseError(String message, ParserContext context) {
43: super(message);
44: this.context = context;
45: }
46:
47: }
|