public Token checkNextToken(Enum<?>... expected)
            throws ScriptException {
        Token next = getNextToken();
        if (next != null) {
            for (Enum<?> exp : expected) {
                if (next.getType() == exp)
                    return next;
            }
        }
        throw error("\"" + next + "\" is not expected here.");
    }