package parser;

/**
 * Abstract token class.
 */
public abstract class AToken {
    /**
     * The _lexeme this token is representing.
     */
    private String _lexeme;

    /**
     * Token constructor.
     *
     * @param lexeme _lexeme this token is representing.
     */
    public AToken(String lexeme) {
        _lexeme = lexeme;
    }


    /**
     * Execute a token visitor.
     *
     * @param algo  visitor to execute
     * @param param visitor-specific parameter
     * @return visitor-specific return value
     */
    public abstract Object execute(ITokVisitor algo, Object param);

    /**
     * Return a string representation.
     *
     * @return string representation
     */
    public String toString() {
        return _lexeme;
    }
}

