public int getKindOf(String name) throws JackException {
        int kind;
        if (parameters.containsKey(name)) {
            kind = KIND_PARAMETER;
        }
        else if (locals.containsKey(name)) {
            kind = KIND_LOCAL;
        }
        else if (subroutineType != SUBROUTINE_TYPE_FUNCTION && fields.containsKey(name)) {
            kind = KIND_FIELD;
        }
        else if (statics.containsKey(name)) {
            kind = KIND_STATIC;
        }
        else {
            throw new JackException(name);
        }
        return kind;
    }