I have been using the Json that comes with Microsoft, and I have been trying to parse the Json myself. So I spent one night writing a parsing class,
Let's start with the following ideas: for example, the standard JSon format is {"Key": "Value1", "Key2": 1, "Key3": [1, 2, 3, 4], "Key4": {"Test1": "2"}, "Key5": [{"A": 1, "B": 2}]}
In this way, I regard the content of {} as a complete object. When I encounter {}, I treat it as a complete object parsing (I may have a problem with my ability to express it, but I cannot express it too much)
First of all, the Key must contain double quotation marks in strict format of the read Key, but it is not excluded. So I made a judgment that if there is double quotation marks, the Key will be removed, and then the value will be the value, the Value can be roughly divided into three types,
A common value is a string, number, or time,
The second is the complete class,
Array is the third type, but Arrays can also be divided into two types, one is a normal array and the other is an array of the tape class,
After testing the performance, I feel okay.
Don't talk about it.
Declare EndCount = Dictionary <,> JsonReader (TextReader reader, endCount = myObjDate = Dictionary <,> myReader = EndCount = intByte = (EndCount! = & IntByte! =-Key = value = (EndCount =) {intByte =: (reader, JsonReader (: (StringReader (value ), intByte = (intByte = EndCount ++ (intByte = EndCount -- ReadKeyName (StringBuilder strBuilder = intByte = (intByte = lastIntByte =-endByteInt =-(intByte = -( intByte = | intByte = endByteInt = intByte = (intByte! =-(EndByteInt! =-(IntByte = endByteInt & lastIntByte! = (IntByte = strBuilder. append (intByte = item = JsonReader (myReader, (intByte = ReadValueArrayString (StringBuilder strBuilder = intByte = (intByte = lastIntByte =-bytes =-(intByte = | intByte = bytes = intByte = (intByte! =-LastChar = (endByteInt! =-(IntByte = endByteInt & lastIntByte! = (IntByte ==|| (intByte ==& lastIntByte! = StrBuilder. append (intByte = ReadValueString (StringBuilder strBuilder = intByte = (intByte = lastIntByte =-endByteInt =-(intByte = | intByte = bytes = intByte = (intByte! =-(EndByteInt! =-(IntByte = endByteInt & lastIntByte! = (IntByte ==|| (intByte ==& lastIntByte! = StrBuilder. Append (intByte = List <> list = List <> intByte = (intByte! = (IntByte = item = JsonReader (myReader, (ReadInt () = (intByte = list. Add (ReadValueArrayString (intByte =) {intByte =}