01: /*
02: * Copyright (C) Chaperon. All rights reserved.
03: * -------------------------------------------------------------------------
04: * This software is published under the terms of the Apache Software License
05: * version 1.1, a copy of which has been included with this distribution in
06: * the LICENSE file.
07: */
08:
09: package net.sourceforge.chaperon.model.grammar;
10:
11: import net.sourceforge.chaperon.model.symbol.Terminal;
12:
13: /**
14: * This symbol represents an error token
15: *
16: * @author <a href="mailto:stephan@apache.org">Stephan Michels </a>
17: * @version CVS $Id: Error.java,v 1.3 2003/12/09 19:55:52 benedikta Exp $
18: */
19: public class Error extends Terminal {
20: public static final Error instance = new Error();
21:
22: /**
23: * Creates a symbol for an error token
24: */
25: public Error() {
26: super ("error");
27: }
28:
29: /**
30: * Returns a hash code value for the symbol.
31: *
32: * @return Hash code value for the symbol.
33: */
34: public int hashCode() {
35: return Error.class.getName().hashCode();
36: }
37:
38: /**
39: * Compares the with another symbol.
40: *
41: * @param o Another object
42: *
43: * @return True, if the symbol are equal.
44: */
45: public boolean equals(Object o) {
46: //if (o==this)
47: if (o instanceof Error)
48: return true;
49:
50: return false;
51: }
52: }
|