public Object convert(char [] s, List<JSONToken> t)
	{
		Object rv = null, k, v;
		int i;
		JSONToken tp;
	
		if (ndx == t.size()) {
			System.out.println("array overflow in JSON parser");
		}
		tp = t.get(ndx++);
		String tstr = new String(s, tp.start, tp.end-tp.start);
		
		switch(tp.type){
		case JSMN_OBJECT:
			HashMap<Object, Object> tab = new HashMap<Object, Object>();
			if(tp.size%2 != 0) {
				Msg.error(this, "invalid json object");
				return null;
			}
			for(i = 0; i < tp.size/2; i++){
				k = convert(s, t);
				v = convert(s, t);
				tab.put(k, v);
			}
			rv = tab;
			break;
		case JSMN_ARRAY:
			List<Object> l = new ArrayList<Object>();
			for(i = 0; i < tp.size; i++)
				l.add(convert(s, t));
			rv = l;
			break;
		case JSMN_PRIMITIVE:
			i = tp.start;
			switch(s[tp.start]){
			case 't':
				Msg.error(this, "what is this? "+tstr);
				//rv = mkvalcval2(cval1);
				break;
			case 'f':
				Msg.error(this, "what is this? "+tstr);
				//rv = mkvalcval2(cval0);
				break;
			case 'n':
				//rv = null;
				break;
			case '-':
			case '0':
			case '1':
			case '2':
			case '3':
			case '4':
			case '5':
			case '6':
			case '7':
			case '8':
			case '9':
				rv = NumericUtilities.parseLong(tstr);
				break;
			default:
				Msg.error(this, "invalid json primitive: "+tstr);
				return null;
			}
			break;
		case JSMN_STRING:
			rv = expands(tstr);
			if (rv == null){
				Msg.error(this, "invalid json string: "+tstr);
			}
			break;
		default:
			throw new RuntimeException("invalid json type: "+tp.type);
		}
	
		return rv;
	}
Parse JSON string and fill tokens.
Ghidra/Framework/Generic/src/main/java/generic/json/JSONParser.java