/* PseudoCode Interpreted Language (PCIL): Part of the algoviz@vt collection of algorithm visualizations. Copyright (C) 2008 Brandon Malone, Frank Hadlock This file is part of the PseudoCode Interpreted Language. PseudoCode Interpreted Language is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. PseudoCode Interpreted Language is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with PseudoCode Interpreted Language. If not, see . */ /* * GrammarToken.java * * Created on March 2, 2008, 7:07 PM * * To change this template, choose Tools | Template Manager * and open the template in the editor. */ package syntacticanalysis; /** * * @author Brandon */ public abstract class GrammarToken { protected String name; /** Creates a new instance of GrammarToken */ public GrammarToken(String name) { this.name = name; } public boolean equals(Object other) { if (other instanceof GrammarToken) { return equals((GrammarToken)other); } return false; } public boolean equals(GrammarToken other) { if (other.getType().equals(getType())) { return other.name.equals(name); } return false; } public abstract String getType(); public int hashCode() { return name.hashCode(); } }