Parses the current token as a list of double-precision floating point numbers.
@param parser
@return List of {@link Double}s
@throws IOException
@throws JsonFormatException
@author vvakame
331399
public static List<Double> parserDoubleList(JsonPullParser parser) throws IOException,
			JsonFormatException {

		State eventType = parser.getEventType();
		if (eventType == State.VALUE_NULL) {
			return null;
		}
		if (eventType != State.START_ARRAY) {
			throw new IllegalStateException("not started brace!");
		}
		List<Double> list = new ArrayList<Double>();
		while (parser.lookAhead() != State.END_ARRAY) {
			eventType = parser.getEventType();
			if (eventType == State.VALUE_NULL) {
				list.add(null);
			} else if (eventType == State.VALUE_DOUBLE) {
				list.add(parser.getValueDouble());
			} else {
				throw new IllegalStateException("unexpected state. expected=VALUE_DOUBLE, but get="
						+ eventType.toString());
			}
		}
		parser.getEventType();
		return list;
	}
465420
function DynamicDelimiterParser() {
    // invoke super constructor
    Parser.call(this, allTokens, {
        outputCst: false,
        // by default the error recovery / fault tolerance capabilities are disabled
        // use this flag to enable them
        recoveryEnabled: true,
        // IMPORTANT: must be enabled to support dynamically defined Tokens
        dynamicTokensEnabled: true
    })

    // not mandatory, using <$> (or any other sign) to reduce verbosity (this. this. this. this. .......)
    const $ = this

    this.RULE("array", () => {
        let result = ""

        $.CONSUME(LSquare) // This will match any Token Class which extends BaseLeftDelimiter
        $.OPTION(() => {
            result += $.CONSUME(NumberLiteral).image
            $.MANY(() => {
                $.CONSUME(BaseDelimiter)
                result += $.CONSUME2(NumberLiteral).image
            })
        })
        $.CONSUME(RSquare) // This will match any Token Class which extends BaseRightDelimiter

        return result
    })

    // very important to call this after all the rules have been defined.
    // otherwise the parser may not work correctly as it will lack information
    // derived during the self analysis phase.
    this.performSelfAnalysis()
}
241397
static List<Object> parseList(AbstractContext context, JsonParser parser, List<Object> list, boolean skipRead) {
		try {
			if (!skipRead) {
				parser.nextToken();
			}

			if (parser.currentToken() != JsonToken.START_ARRAY) {
				throw (new KriptonRuntimeException("Invalid input format"));
			}

			skipRead = false;

			JsonToken token;
			do {
				if (skipRead) {
					token = parser.getCurrentToken();
				} else {
					token = parser.nextToken();
					skipRead = true;
				}
				switch (token) {
				case VALUE_FALSE:
				case VALUE_TRUE:
				case VALUE_NUMBER_FLOAT:
				case VALUE_NUMBER_INT:
				case VALUE_STRING:
					list.add(parser.getText());
					break;
				case VALUE_NULL:
					list.add(null);
					break;
				case VALUE_EMBEDDED_OBJECT:
					// parse submap
					list.add(parseMap(context, parser, new LinkedHashMap<String, Object>(), true));
					break;
				case START_ARRAY:
					list.add(parseList(context, parser, list, true));
					break;
				default:
					break;
				}
			} while (parser.nextToken() != JsonToken.END_ARRAY);
			return list;
		} catch (IOException e) {
			e.printStackTrace();
			throw (new KriptonRuntimeException(e));
		}
	}
818661
private List<Object> parseArrayInternal() throws IOException {
		List<Object> result = new ArrayList<>();
		
		Type t;
		while (true) {
			t = lexer.readNextToken();
			if (t == Type.END_ARRAY) {
				break;
			}
			
			if (!result.isEmpty()) {
				//skip comma and read next token
				if (t != Type.COMMA) {
					throw new IOException("Unexpected token: " + t);
				}
				t = lexer.readNextToken();
			}
			
			//read value
			Object value = readValue(t);
			result.add(value);
		}
		
		return result;
	}
740725
protected DataType parseApproxNumericType( DdlTokenStream tokens ) throws ParsingException {
        DataType dataType = null;
        String typeName = null;

        if (tokens.matches(DataTypes.DTYPE_REAL)) {
            dataType = new DataType();
            typeName = consume(tokens, dataType, false, DataTypes.DTYPE_REAL);
            dataType.setName(typeName);
        } else if (tokens.matches(DataTypes.DTYPE_DOUBLE_PRECISION)) {
            dataType = new DataType();
            typeName = consume(tokens, dataType, false, DataTypes.DTYPE_DOUBLE_PRECISION);
            dataType.setName(typeName);
        } else if (tokens.matches(DataTypes.DTYPE_FLOAT)) {
            dataType = new DataType();
            typeName = consume(tokens, dataType, false, DataTypes.DTYPE_FLOAT);
            dataType.setName(typeName);
            int precision = 0;
            if (tokens.matches(L_PAREN)) {
                precision = (int)parseBracketedLong(tokens, dataType);
            }
            dataType.setPrecision(precision);
        }

        return dataType;
    }
1176417
private MultiLineString parseMultiLinestring(JsonParser jp) throws IOException, SQLException {
        jp.nextToken(); // FIELD_NAME coordinates        
        String coordinatesField = jp.getText();
        if (coordinatesField.equalsIgnoreCase(GeoJsonField.COORDINATES)) {
            ArrayList<LineString> lineStrings = new ArrayList<LineString>();
            jp.nextToken();//START_ARRAY [ coordinates
            jp.nextToken(); // START_ARRAY [ coordinates line
            while (jp.getCurrentToken() != JsonToken.END_ARRAY) {
                lineStrings.add(GF.createLineString(parseCoordinates(jp)));
                jp.nextToken();
            }
            MultiLineString line = GF.createMultiLineString(lineStrings.toArray(new LineString[0]));
            jp.nextToken();//END_OBJECT } geometry
            return line;
        } else {
            throw new SQLException("Malformed GeoJSON file. Expected 'coordinates', found '" + coordinatesField + "'");
        }

    }
1012657
function parseStringNumbers (parser) {
  const length = parser.buffer.length - 1
  var offset = parser.offset
  var number = 0
  var res = ''

  if (parser.buffer[offset] === 45) {
    res += '-'
    offset++
  }

  while (offset < length) {
    var c1 = parser.buffer[offset++]
    if (c1 === 13) { // \r\n
      parser.offset = offset + 1
      if (number !== 0) {
        res += number
      }
      return res
    } else if (number > 429496728) {
      res += (number * 10) + (c1 - 48)
      number = 0
    } else if (c1 === 48 && number === 0) {
      res += 0
    } else {
      number = (number * 10) + (c1 - 48)
    }
  }
}
1172854
public static Object parseWithException(InputStream in) throws IOException, ParseException {
		return new JSONParser(DEFAULT_PERMISSIVE_MODE).parse(in, defaultReader.DEFAULT);
	}
23558
public List<Double> getDoubles(String name, String delimiter) {
        List<String> strings = getStrings(name, delimiter);

        List<Double> doubles = new ArrayList<>(strings.size());
        for (String value : strings) {
            try {
                double i = Double.parseDouble(value);
                doubles.add(i);
            } catch (NumberFormatException e) {
            }
        }
        return Collections.unmodifiableList(doubles);
    }
86579
@SuppressWarnings("unchecked")
  <T> T parse(Class<T> clazz) throws JsonParserException {
    advanceToken();
    Object parsed = currentValue();
    if (advanceToken() != Token.EOF)
      throw createParseException(null, "Expected end of input, got " + token, true);
    if (clazz != Object.class && (parsed == null || clazz != parsed.getClass()))
      throw createParseException(null, "JSON did not contain the correct type, expected " + clazz.getName()
          + ".", true);
    return (T)(parsed);
  }
230572
Record
parseRR(Tokenizer st, int classValue, long TTLValue)
throws IOException
{
	Name name = st.getName(zone);
	long ttl;
	int type;
	Record record;

	String s = st.getString();

	try {
		ttl = TTL.parseTTL(s);
		s = st.getString();
	}
	catch (NumberFormatException e) {
		ttl = TTLValue;
	}

	if (DClass.value(s) >= 0) {
		classValue = DClass.value(s);
		s = st.getString();
	}

	if ((type = Type.value(s)) < 0)
		throw new IOException("Invalid type: " + s);

	record = Record.fromString(name, type, classValue, ttl, st, zone);
	if (record != null)
		return (record);
	else
		throw new IOException("Parse error");
}
258774
final Parser<T> asDelimiter() {
    return new Parser<T>() {
      @Override boolean apply(ParseContext ctxt) {
        return ctxt.applyAsDelimiter(Parser.this);
      }
      @Override public String toString() {
        return Parser.this.toString();
      }
    };
  }
224578
public static double parseFloat(InputStream inputStream, final int size) throws IOException {
        byte[] buffer = new byte[size];
        int numberOfReadsBytes = inputStream.read(buffer, 0, size);
        assert numberOfReadsBytes == size;

        ByteBuffer byteBuffer = ByteBuffer.wrap(buffer).order(ByteOrder.BIG_ENDIAN);
        if (8 == size) {
            return byteBuffer.getDouble();
        }

        return byteBuffer.getFloat();
    }
781536
public static Short parserShort(JsonPullParser parser) throws IOException, JsonFormatException {

		State eventType = parser.getEventType();
		if (eventType == State.VALUE_NULL) {
			return null;
		} else if (eventType == State.VALUE_LONG) {
			return (short) parser.getValueLong();
		} else {
			throw new IllegalStateException("unexpected state. expected=VALUE_LONG, but get="
					+ eventType.toString());
		}
	}
292988
public static Parse parseParse(String parse) {
    StringBuffer text = new StringBuffer();
    int offset = 0;
    Stack stack = new Stack();
    List cons = new LinkedList();
    for (int ci = 0, cl = parse.length(); ci < cl; ci++) {
      char c = parse.charAt(ci);
      if (c == '(') {
        String rest = parse.substring(ci + 1);
        String type = getType(rest);
        if (type == null) {
          System.err.println("null type for: " + rest);
        }
        String token = getToken(rest);
        stack.push(new Object[] { type, new Integer(offset)});
        if (token != null && !type.equals("-NONE-")) {
          cons.add(new Object[] { ParserME.TOK_NODE, new Span(offset, offset + token.length())});
          text.append(token).append(" ");
          offset += token.length() + 1;
        }
      }
      else if (c == ')') {
        Object[] parts = (Object[]) stack.pop();
        String type = (String) parts[0];
        if (!type.equals("-NONE-")) {
          int start = ((Integer) parts[1]).intValue();
          cons.add(new Object[] { parts[0], new Span(start, offset - 1)});
        }
      }
    }
    String txt = text.toString();
    Parse p = new Parse(txt, new Span(0, txt.length()), ParserME.TOP_NODE, 1);
    /*
    for (int ti=0;ti < tokens.size();ti++) {
      Object[] parts = (Object[]) cons.get(ti);
      String type = (String) parts[0];
      if (!type.equals(ParserME.TOP_NODE)) {
        Parse con = new Parse(txt, (Span) parts[1], type, 1);
        System.err.println("insert "+type+" "+con.toString());
        p.insert(con);
      }
    }
    */
    for (int ci=0;ci < cons.size();ci++) {
      Object[] parts = (Object[]) cons.get(ci);
      String type = (String) parts[0];
      if (!type.equals(ParserME.TOP_NODE)) {
        Parse con = new Parse(txt, (Span) parts[1], type, 1);
        //System.err.println("insert["+ci+"] "+type+" "+con.toString()+" "+con.hashCode());
        p.insert(con);
        //codeTree(p);
      }
    }
    return p;
  }
740419
static List<TypeArgument> parseList(final Parser parser, final String definingClassName) throws ParseException {
        if (parser.peek() == '<') {
            parser.expect('<');
            final List<TypeArgument> typeArguments = new ArrayList<>(2);
            while (parser.peek() != '>') {
                if (!parser.hasMore()) {
                    throw new ParseException(parser, "Missing '>'");
                }
                typeArguments.add(parse(parser, definingClassName));
            }
            parser.expect('>');
            return typeArguments;
        } else {
            return Collections.emptyList();
        }
    }
593970
public void parseReader(Reader reader) throws ParserException, IOException {

        try {
            nanoElement.parseFromReader(reader);
        } catch (XMLParseException e) {
            throw new ParserException(e.getMessage());
        }
    }