KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sourceforge > chaperon > model > grammar > Error


1 /*
2  * Copyright (C) Chaperon. All rights reserved.
3  * -------------------------------------------------------------------------
4  * This software is published under the terms of the Apache Software License
5  * version 1.1, a copy of which has been included with this distribution in
6  * the LICENSE file.
7  */

8
9 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 {
21   public static final Error JavaDoc instance = new Error JavaDoc();
22
23   /**
24    * Creates a symbol for an error token
25    */

26   public Error()
27   {
28     super("error");
29   }
30
31   /**
32    * Returns a hash code value for the symbol.
33    *
34    * @return Hash code value for the symbol.
35    */

36   public int hashCode()
37   {
38     return Error JavaDoc.class.getName().hashCode();
39   }
40
41   /**
42    * Compares the with another symbol.
43    *
44    * @param o Another object
45    *
46    * @return True, if the symbol are equal.
47    */

48   public boolean equals(Object JavaDoc o)
49   {
50     //if (o==this)
51
if (o instanceof Error JavaDoc)
52       return true;
53
54     return false;
55   }
56 }
57
Popular Tags