package net.morilib.deculture.misc;

import net.morilib.automata.lr.Terminal;

public class PrecedenceTerminal implements Terminal {

	//
	private Terminal wrapee, precedence;

	/**
	 * 
	 * @param w
	 * @param prec
	 */
	public PrecedenceTerminal(Terminal w, Terminal prec) {
		wrapee = w;
		precedence = prec;
	}

	/**
	 * 
	 * @return
	 */
	public Terminal getWrapee() {
		return wrapee;
	}

	/**
	 * 
	 * @return
	 */
	public Terminal getPrecedence() {
		return precedence;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	public int hashCode() {
		return wrapee.hashCode();
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	public boolean equals(Object o) {
		return wrapee.equals(o);
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	public String toString() {
		return "<" + wrapee + " prec:" + precedence + ">";
	}

}
