/// <summary> /// Parses the <see cref="LogicJSONNode"/>. /// </summary> private static LogicJSONNode ParseValue(CharStream stream) { stream.SkipWhitespace(); char character = stream.NextChar(); LogicJSONNode node = null; switch (character) { case '{': node = LogicJSONParser.ParseObject(stream); break; case '[': node = LogicJSONParser.ParseArray(stream); break; case 'n': node = LogicJSONParser.ParseNull(stream); break; case 'f': node = LogicJSONParser.ParseBoolean(stream); break; case 't': node = LogicJSONParser.ParseBoolean(stream); break; case '"': node = LogicJSONParser.ParseString(stream); break; case '-': node = LogicJSONParser.ParseNumber(stream); break; default: if (character >= '0' && character <= '9') { node = LogicJSONParser.ParseNumber(stream); } else { LogicJSONParser.ParseError("Not of any recognized value: " + character); } break; } return(node); }
/// <summary> /// Parses the <see cref="LogicJSONArray"/>. /// </summary> public static LogicJSONArray ParseArray(string json) { return(LogicJSONParser.ParseArray(new CharStream(json))); }