private JsonValue<?> value() {
        switch(currTok.getType()) {
            case STR:
                JsonStr str = new JsonStr(currTok.getContents());
                match(STR);
                return str;
            case NUM:
                JsonNumber num = new JsonNumber(currTok.getContents());
                match(NUM);
                return num;
            case LBRACE:
                return object();
            case LBRACKET:
                return array();
            case BOOL:
                JsonBool bool = new JsonBool(currTok.getContents());
                match(BOOL);
                return bool;
            case NULL:
                match(NULL);
                return null;
            default:
                error(STR, NUM, LBRACE, LBRACKET, BOOL, NULL);
                break;
        }
        assert false;
        return null;
    }