12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151 |
- using System;
- using System.IO;
- using System.Runtime.CompilerServices;
- using System.Text;
- namespace LitJson
- {
- internal class Lexer
- {
- static Lexer()
- {
- Lexer.PopulateFsmTables();
- }
- public Lexer(TextReader reader)
- {
- this.allow_comments = true;
- this.allow_single_quoted_strings = true;
- this.input_buffer = 0;
- this.string_buffer = new StringBuilder(128);
- this.state = 1;
- this.end_of_input = false;
- this.reader = reader;
- this.fsm_context = new FsmContext();
- this.fsm_context.L = this;
- }
- public bool AllowComments
- {
- get
- {
- return this.allow_comments;
- }
- set
- {
- this.allow_comments = value;
- }
- }
- public bool AllowSingleQuotedStrings
- {
- get
- {
- return this.allow_single_quoted_strings;
- }
- set
- {
- this.allow_single_quoted_strings = value;
- }
- }
- public bool EndOfInput
- {
- get
- {
- return this.end_of_input;
- }
- }
- public int Token
- {
- get
- {
- return this.token;
- }
- }
- public string StringValue
- {
- get
- {
- return this.string_value;
- }
- }
- private static int HexValue(int digit)
- {
- switch (digit)
- {
- case 65:
- break;
- case 66:
- return 11;
- case 67:
- return 12;
- case 68:
- return 13;
- case 69:
- return 14;
- case 70:
- return 15;
- default:
- switch (digit)
- {
- case 97:
- break;
- case 98:
- return 11;
- case 99:
- return 12;
- case 100:
- return 13;
- case 101:
- return 14;
- case 102:
- return 15;
- default:
- return digit - 48;
- }
- break;
- }
- return 10;
- }
- private static void PopulateFsmTables()
- {
- Lexer.StateHandler[] array = new Lexer.StateHandler[28];
- int num = 0;
- if (Lexer._003C_003Ef__mg_0024cache0 == null)
- {
- Lexer._003C_003Ef__mg_0024cache0 = new Lexer.StateHandler(Lexer.State1);
- }
- array[num] = Lexer._003C_003Ef__mg_0024cache0;
- int num2 = 1;
- if (Lexer._003C_003Ef__mg_0024cache1 == null)
- {
- Lexer._003C_003Ef__mg_0024cache1 = new Lexer.StateHandler(Lexer.State2);
- }
- array[num2] = Lexer._003C_003Ef__mg_0024cache1;
- int num3 = 2;
- if (Lexer._003C_003Ef__mg_0024cache2 == null)
- {
- Lexer._003C_003Ef__mg_0024cache2 = new Lexer.StateHandler(Lexer.State3);
- }
- array[num3] = Lexer._003C_003Ef__mg_0024cache2;
- int num4 = 3;
- if (Lexer._003C_003Ef__mg_0024cache3 == null)
- {
- Lexer._003C_003Ef__mg_0024cache3 = new Lexer.StateHandler(Lexer.State4);
- }
- array[num4] = Lexer._003C_003Ef__mg_0024cache3;
- int num5 = 4;
- if (Lexer._003C_003Ef__mg_0024cache4 == null)
- {
- Lexer._003C_003Ef__mg_0024cache4 = new Lexer.StateHandler(Lexer.State5);
- }
- array[num5] = Lexer._003C_003Ef__mg_0024cache4;
- int num6 = 5;
- if (Lexer._003C_003Ef__mg_0024cache5 == null)
- {
- Lexer._003C_003Ef__mg_0024cache5 = new Lexer.StateHandler(Lexer.State6);
- }
- array[num6] = Lexer._003C_003Ef__mg_0024cache5;
- int num7 = 6;
- if (Lexer._003C_003Ef__mg_0024cache6 == null)
- {
- Lexer._003C_003Ef__mg_0024cache6 = new Lexer.StateHandler(Lexer.State7);
- }
- array[num7] = Lexer._003C_003Ef__mg_0024cache6;
- int num8 = 7;
- if (Lexer._003C_003Ef__mg_0024cache7 == null)
- {
- Lexer._003C_003Ef__mg_0024cache7 = new Lexer.StateHandler(Lexer.State8);
- }
- array[num8] = Lexer._003C_003Ef__mg_0024cache7;
- int num9 = 8;
- if (Lexer._003C_003Ef__mg_0024cache8 == null)
- {
- Lexer._003C_003Ef__mg_0024cache8 = new Lexer.StateHandler(Lexer.State9);
- }
- array[num9] = Lexer._003C_003Ef__mg_0024cache8;
- int num10 = 9;
- if (Lexer._003C_003Ef__mg_0024cache9 == null)
- {
- Lexer._003C_003Ef__mg_0024cache9 = new Lexer.StateHandler(Lexer.State10);
- }
- array[num10] = Lexer._003C_003Ef__mg_0024cache9;
- int num11 = 10;
- if (Lexer._003C_003Ef__mg_0024cacheA == null)
- {
- Lexer._003C_003Ef__mg_0024cacheA = new Lexer.StateHandler(Lexer.State11);
- }
- array[num11] = Lexer._003C_003Ef__mg_0024cacheA;
- int num12 = 11;
- if (Lexer._003C_003Ef__mg_0024cacheB == null)
- {
- Lexer._003C_003Ef__mg_0024cacheB = new Lexer.StateHandler(Lexer.State12);
- }
- array[num12] = Lexer._003C_003Ef__mg_0024cacheB;
- int num13 = 12;
- if (Lexer._003C_003Ef__mg_0024cacheC == null)
- {
- Lexer._003C_003Ef__mg_0024cacheC = new Lexer.StateHandler(Lexer.State13);
- }
- array[num13] = Lexer._003C_003Ef__mg_0024cacheC;
- int num14 = 13;
- if (Lexer._003C_003Ef__mg_0024cacheD == null)
- {
- Lexer._003C_003Ef__mg_0024cacheD = new Lexer.StateHandler(Lexer.State14);
- }
- array[num14] = Lexer._003C_003Ef__mg_0024cacheD;
- int num15 = 14;
- if (Lexer._003C_003Ef__mg_0024cacheE == null)
- {
- Lexer._003C_003Ef__mg_0024cacheE = new Lexer.StateHandler(Lexer.State15);
- }
- array[num15] = Lexer._003C_003Ef__mg_0024cacheE;
- int num16 = 15;
- if (Lexer._003C_003Ef__mg_0024cacheF == null)
- {
- Lexer._003C_003Ef__mg_0024cacheF = new Lexer.StateHandler(Lexer.State16);
- }
- array[num16] = Lexer._003C_003Ef__mg_0024cacheF;
- int num17 = 16;
- if (Lexer._003C_003Ef__mg_0024cache10 == null)
- {
- Lexer._003C_003Ef__mg_0024cache10 = new Lexer.StateHandler(Lexer.State17);
- }
- array[num17] = Lexer._003C_003Ef__mg_0024cache10;
- int num18 = 17;
- if (Lexer._003C_003Ef__mg_0024cache11 == null)
- {
- Lexer._003C_003Ef__mg_0024cache11 = new Lexer.StateHandler(Lexer.State18);
- }
- array[num18] = Lexer._003C_003Ef__mg_0024cache11;
- int num19 = 18;
- if (Lexer._003C_003Ef__mg_0024cache12 == null)
- {
- Lexer._003C_003Ef__mg_0024cache12 = new Lexer.StateHandler(Lexer.State19);
- }
- array[num19] = Lexer._003C_003Ef__mg_0024cache12;
- int num20 = 19;
- if (Lexer._003C_003Ef__mg_0024cache13 == null)
- {
- Lexer._003C_003Ef__mg_0024cache13 = new Lexer.StateHandler(Lexer.State20);
- }
- array[num20] = Lexer._003C_003Ef__mg_0024cache13;
- int num21 = 20;
- if (Lexer._003C_003Ef__mg_0024cache14 == null)
- {
- Lexer._003C_003Ef__mg_0024cache14 = new Lexer.StateHandler(Lexer.State21);
- }
- array[num21] = Lexer._003C_003Ef__mg_0024cache14;
- int num22 = 21;
- if (Lexer._003C_003Ef__mg_0024cache15 == null)
- {
- Lexer._003C_003Ef__mg_0024cache15 = new Lexer.StateHandler(Lexer.State22);
- }
- array[num22] = Lexer._003C_003Ef__mg_0024cache15;
- int num23 = 22;
- if (Lexer._003C_003Ef__mg_0024cache16 == null)
- {
- Lexer._003C_003Ef__mg_0024cache16 = new Lexer.StateHandler(Lexer.State23);
- }
- array[num23] = Lexer._003C_003Ef__mg_0024cache16;
- int num24 = 23;
- if (Lexer._003C_003Ef__mg_0024cache17 == null)
- {
- Lexer._003C_003Ef__mg_0024cache17 = new Lexer.StateHandler(Lexer.State24);
- }
- array[num24] = Lexer._003C_003Ef__mg_0024cache17;
- int num25 = 24;
- if (Lexer._003C_003Ef__mg_0024cache18 == null)
- {
- Lexer._003C_003Ef__mg_0024cache18 = new Lexer.StateHandler(Lexer.State25);
- }
- array[num25] = Lexer._003C_003Ef__mg_0024cache18;
- int num26 = 25;
- if (Lexer._003C_003Ef__mg_0024cache19 == null)
- {
- Lexer._003C_003Ef__mg_0024cache19 = new Lexer.StateHandler(Lexer.State26);
- }
- array[num26] = Lexer._003C_003Ef__mg_0024cache19;
- int num27 = 26;
- if (Lexer._003C_003Ef__mg_0024cache1A == null)
- {
- Lexer._003C_003Ef__mg_0024cache1A = new Lexer.StateHandler(Lexer.State27);
- }
- array[num27] = Lexer._003C_003Ef__mg_0024cache1A;
- int num28 = 27;
- if (Lexer._003C_003Ef__mg_0024cache1B == null)
- {
- Lexer._003C_003Ef__mg_0024cache1B = new Lexer.StateHandler(Lexer.State28);
- }
- array[num28] = Lexer._003C_003Ef__mg_0024cache1B;
- Lexer.fsm_handler_table = array;
- Lexer.fsm_return_table = new int[]
- {
- 65542,
- 0,
- 65537,
- 65537,
- 0,
- 65537,
- 0,
- 65537,
- 0,
- 0,
- 65538,
- 0,
- 0,
- 0,
- 65539,
- 0,
- 0,
- 65540,
- 65541,
- 65542,
- 0,
- 0,
- 65541,
- 65542,
- 0,
- 0,
- 0,
- 0
- };
- }
- private static char ProcessEscChar(int esc_char)
- {
- switch (esc_char)
- {
- case 114:
- return '\r';
- default:
- if (esc_char == 34 || esc_char == 39 || esc_char == 47 || esc_char == 92)
- {
- return Convert.ToChar(esc_char);
- }
- if (esc_char == 98)
- {
- return '\b';
- }
- if (esc_char == 102)
- {
- return '\f';
- }
- if (esc_char != 110)
- {
- return '?';
- }
- return '\n';
- case 116:
- return '\t';
- }
- }
- private static bool State1(FsmContext ctx)
- {
- while (ctx.L.GetChar())
- {
- if (ctx.L.input_char != 32 && (ctx.L.input_char < 9 || ctx.L.input_char > 13))
- {
- if (ctx.L.input_char >= 49 && ctx.L.input_char <= 57)
- {
- ctx.L.string_buffer.Append((char)ctx.L.input_char);
- ctx.NextState = 3;
- return true;
- }
- int num = ctx.L.input_char;
- switch (num)
- {
- case 44:
- break;
- case 45:
- ctx.L.string_buffer.Append((char)ctx.L.input_char);
- ctx.NextState = 2;
- return true;
- default:
- switch (num)
- {
- case 91:
- case 93:
- break;
- default:
- switch (num)
- {
- case 123:
- case 125:
- break;
- default:
- if (num == 34)
- {
- ctx.NextState = 19;
- ctx.Return = true;
- return true;
- }
- if (num != 39)
- {
- if (num != 58)
- {
- if (num == 102)
- {
- ctx.NextState = 12;
- return true;
- }
- if (num == 110)
- {
- ctx.NextState = 16;
- return true;
- }
- if (num != 116)
- {
- return false;
- }
- ctx.NextState = 9;
- return true;
- }
- }
- else
- {
- if (!ctx.L.allow_single_quoted_strings)
- {
- return false;
- }
- ctx.L.input_char = 34;
- ctx.NextState = 23;
- ctx.Return = true;
- return true;
- }
- break;
- }
- break;
- }
- break;
- case 47:
- if (!ctx.L.allow_comments)
- {
- return false;
- }
- ctx.NextState = 25;
- return true;
- case 48:
- ctx.L.string_buffer.Append((char)ctx.L.input_char);
- ctx.NextState = 4;
- return true;
- }
- ctx.NextState = 1;
- ctx.Return = true;
- return true;
- }
- }
- return true;
- }
- private static bool State2(FsmContext ctx)
- {
- ctx.L.GetChar();
- if (ctx.L.input_char >= 49 && ctx.L.input_char <= 57)
- {
- ctx.L.string_buffer.Append((char)ctx.L.input_char);
- ctx.NextState = 3;
- return true;
- }
- int num = ctx.L.input_char;
- if (num != 48)
- {
- return false;
- }
- ctx.L.string_buffer.Append((char)ctx.L.input_char);
- ctx.NextState = 4;
- return true;
- }
- private static bool State3(FsmContext ctx)
- {
- while (ctx.L.GetChar())
- {
- if (ctx.L.input_char >= 48 && ctx.L.input_char <= 57)
- {
- ctx.L.string_buffer.Append((char)ctx.L.input_char);
- }
- else
- {
- if (ctx.L.input_char == 32 || (ctx.L.input_char >= 9 && ctx.L.input_char <= 13))
- {
- ctx.Return = true;
- ctx.NextState = 1;
- return true;
- }
- int num = ctx.L.input_char;
- switch (num)
- {
- case 44:
- break;
- default:
- if (num != 69)
- {
- if (num == 93)
- {
- break;
- }
- if (num != 101)
- {
- if (num != 125)
- {
- return false;
- }
- break;
- }
- }
- ctx.L.string_buffer.Append((char)ctx.L.input_char);
- ctx.NextState = 7;
- return true;
- case 46:
- ctx.L.string_buffer.Append((char)ctx.L.input_char);
- ctx.NextState = 5;
- return true;
- }
- ctx.L.UngetChar();
- ctx.Return = true;
- ctx.NextState = 1;
- return true;
- }
- }
- return true;
- }
- private static bool State4(FsmContext ctx)
- {
- ctx.L.GetChar();
- if (ctx.L.input_char == 32 || (ctx.L.input_char >= 9 && ctx.L.input_char <= 13))
- {
- ctx.Return = true;
- ctx.NextState = 1;
- return true;
- }
- int num = ctx.L.input_char;
- switch (num)
- {
- case 44:
- break;
- default:
- if (num != 69)
- {
- if (num == 93)
- {
- break;
- }
- if (num != 101)
- {
- if (num != 125)
- {
- return false;
- }
- break;
- }
- }
- ctx.L.string_buffer.Append((char)ctx.L.input_char);
- ctx.NextState = 7;
- return true;
- case 46:
- ctx.L.string_buffer.Append((char)ctx.L.input_char);
- ctx.NextState = 5;
- return true;
- }
- ctx.L.UngetChar();
- ctx.Return = true;
- ctx.NextState = 1;
- return true;
- }
- private static bool State5(FsmContext ctx)
- {
- ctx.L.GetChar();
- if (ctx.L.input_char >= 48 && ctx.L.input_char <= 57)
- {
- ctx.L.string_buffer.Append((char)ctx.L.input_char);
- ctx.NextState = 6;
- return true;
- }
- return false;
- }
- private static bool State6(FsmContext ctx)
- {
- while (ctx.L.GetChar())
- {
- if (ctx.L.input_char >= 48 && ctx.L.input_char <= 57)
- {
- ctx.L.string_buffer.Append((char)ctx.L.input_char);
- }
- else
- {
- if (ctx.L.input_char == 32 || (ctx.L.input_char >= 9 && ctx.L.input_char <= 13))
- {
- ctx.Return = true;
- ctx.NextState = 1;
- return true;
- }
- int num = ctx.L.input_char;
- if (num != 44)
- {
- if (num != 69)
- {
- if (num == 93)
- {
- goto IL_CA;
- }
- if (num != 101)
- {
- if (num != 125)
- {
- return false;
- }
- goto IL_CA;
- }
- }
- ctx.L.string_buffer.Append((char)ctx.L.input_char);
- ctx.NextState = 7;
- return true;
- }
- IL_CA:
- ctx.L.UngetChar();
- ctx.Return = true;
- ctx.NextState = 1;
- return true;
- }
- }
- return true;
- }
- private static bool State7(FsmContext ctx)
- {
- ctx.L.GetChar();
- if (ctx.L.input_char >= 48 && ctx.L.input_char <= 57)
- {
- ctx.L.string_buffer.Append((char)ctx.L.input_char);
- ctx.NextState = 8;
- return true;
- }
- int num = ctx.L.input_char;
- if (num != 43 && num != 45)
- {
- return false;
- }
- ctx.L.string_buffer.Append((char)ctx.L.input_char);
- ctx.NextState = 8;
- return true;
- }
- private static bool State8(FsmContext ctx)
- {
- while (ctx.L.GetChar())
- {
- if (ctx.L.input_char >= 48 && ctx.L.input_char <= 57)
- {
- ctx.L.string_buffer.Append((char)ctx.L.input_char);
- }
- else
- {
- if (ctx.L.input_char == 32 || (ctx.L.input_char >= 9 && ctx.L.input_char <= 13))
- {
- ctx.Return = true;
- ctx.NextState = 1;
- return true;
- }
- int num = ctx.L.input_char;
- if (num != 44 && num != 93 && num != 125)
- {
- return false;
- }
- ctx.L.UngetChar();
- ctx.Return = true;
- ctx.NextState = 1;
- return true;
- }
- }
- return true;
- }
- private static bool State9(FsmContext ctx)
- {
- ctx.L.GetChar();
- int num = ctx.L.input_char;
- if (num != 114)
- {
- return false;
- }
- ctx.NextState = 10;
- return true;
- }
- private static bool State10(FsmContext ctx)
- {
- ctx.L.GetChar();
- int num = ctx.L.input_char;
- if (num != 117)
- {
- return false;
- }
- ctx.NextState = 11;
- return true;
- }
- private static bool State11(FsmContext ctx)
- {
- ctx.L.GetChar();
- int num = ctx.L.input_char;
- if (num != 101)
- {
- return false;
- }
- ctx.Return = true;
- ctx.NextState = 1;
- return true;
- }
- private static bool State12(FsmContext ctx)
- {
- ctx.L.GetChar();
- int num = ctx.L.input_char;
- if (num != 97)
- {
- return false;
- }
- ctx.NextState = 13;
- return true;
- }
- private static bool State13(FsmContext ctx)
- {
- ctx.L.GetChar();
- int num = ctx.L.input_char;
- if (num != 108)
- {
- return false;
- }
- ctx.NextState = 14;
- return true;
- }
- private static bool State14(FsmContext ctx)
- {
- ctx.L.GetChar();
- int num = ctx.L.input_char;
- if (num != 115)
- {
- return false;
- }
- ctx.NextState = 15;
- return true;
- }
- private static bool State15(FsmContext ctx)
- {
- ctx.L.GetChar();
- int num = ctx.L.input_char;
- if (num != 101)
- {
- return false;
- }
- ctx.Return = true;
- ctx.NextState = 1;
- return true;
- }
- private static bool State16(FsmContext ctx)
- {
- ctx.L.GetChar();
- int num = ctx.L.input_char;
- if (num != 117)
- {
- return false;
- }
- ctx.NextState = 17;
- return true;
- }
- private static bool State17(FsmContext ctx)
- {
- ctx.L.GetChar();
- int num = ctx.L.input_char;
- if (num != 108)
- {
- return false;
- }
- ctx.NextState = 18;
- return true;
- }
- private static bool State18(FsmContext ctx)
- {
- ctx.L.GetChar();
- int num = ctx.L.input_char;
- if (num != 108)
- {
- return false;
- }
- ctx.Return = true;
- ctx.NextState = 1;
- return true;
- }
- private static bool State19(FsmContext ctx)
- {
- while (ctx.L.GetChar())
- {
- int num = ctx.L.input_char;
- if (num == 34)
- {
- ctx.L.UngetChar();
- ctx.Return = true;
- ctx.NextState = 20;
- return true;
- }
- if (num == 92)
- {
- ctx.StateStack = 19;
- ctx.NextState = 21;
- return true;
- }
- ctx.L.string_buffer.Append((char)ctx.L.input_char);
- }
- return true;
- }
- private static bool State20(FsmContext ctx)
- {
- ctx.L.GetChar();
- int num = ctx.L.input_char;
- if (num != 34)
- {
- return false;
- }
- ctx.Return = true;
- ctx.NextState = 1;
- return true;
- }
- private static bool State21(FsmContext ctx)
- {
- ctx.L.GetChar();
- int num = ctx.L.input_char;
- switch (num)
- {
- case 114:
- case 116:
- break;
- default:
- if (num != 34 && num != 39 && num != 47 && num != 92 && num != 98 && num != 102 && num != 110)
- {
- return false;
- }
- break;
- case 117:
- ctx.NextState = 22;
- return true;
- }
- ctx.L.string_buffer.Append(Lexer.ProcessEscChar(ctx.L.input_char));
- ctx.NextState = ctx.StateStack;
- return true;
- }
- private static bool State22(FsmContext ctx)
- {
- int num = 0;
- int num2 = 4096;
- ctx.L.unichar = 0;
- while (ctx.L.GetChar())
- {
- if ((ctx.L.input_char < 48 || ctx.L.input_char > 57) && (ctx.L.input_char < 65 || ctx.L.input_char > 70) && (ctx.L.input_char < 97 || ctx.L.input_char > 102))
- {
- return false;
- }
- ctx.L.unichar += Lexer.HexValue(ctx.L.input_char) * num2;
- num++;
- num2 /= 16;
- if (num == 4)
- {
- ctx.L.string_buffer.Append(Convert.ToChar(ctx.L.unichar));
- ctx.NextState = ctx.StateStack;
- return true;
- }
- }
- return true;
- }
- private static bool State23(FsmContext ctx)
- {
- while (ctx.L.GetChar())
- {
- int num = ctx.L.input_char;
- if (num == 39)
- {
- ctx.L.UngetChar();
- ctx.Return = true;
- ctx.NextState = 24;
- return true;
- }
- if (num == 92)
- {
- ctx.StateStack = 23;
- ctx.NextState = 21;
- return true;
- }
- ctx.L.string_buffer.Append((char)ctx.L.input_char);
- }
- return true;
- }
- private static bool State24(FsmContext ctx)
- {
- ctx.L.GetChar();
- int num = ctx.L.input_char;
- if (num != 39)
- {
- return false;
- }
- ctx.L.input_char = 34;
- ctx.Return = true;
- ctx.NextState = 1;
- return true;
- }
- private static bool State25(FsmContext ctx)
- {
- ctx.L.GetChar();
- int num = ctx.L.input_char;
- if (num == 42)
- {
- ctx.NextState = 27;
- return true;
- }
- if (num != 47)
- {
- return false;
- }
- ctx.NextState = 26;
- return true;
- }
- private static bool State26(FsmContext ctx)
- {
- while (ctx.L.GetChar())
- {
- if (ctx.L.input_char == 10)
- {
- ctx.NextState = 1;
- return true;
- }
- }
- return true;
- }
- private static bool State27(FsmContext ctx)
- {
- while (ctx.L.GetChar())
- {
- if (ctx.L.input_char == 42)
- {
- ctx.NextState = 28;
- return true;
- }
- }
- return true;
- }
- private static bool State28(FsmContext ctx)
- {
- while (ctx.L.GetChar())
- {
- if (ctx.L.input_char != 42)
- {
- if (ctx.L.input_char == 47)
- {
- ctx.NextState = 1;
- return true;
- }
- ctx.NextState = 27;
- return true;
- }
- }
- return true;
- }
- private bool GetChar()
- {
- if ((this.input_char = this.NextChar()) != -1)
- {
- return true;
- }
- this.end_of_input = true;
- return false;
- }
- private int NextChar()
- {
- if (this.input_buffer != 0)
- {
- int result = this.input_buffer;
- this.input_buffer = 0;
- return result;
- }
- return this.reader.Read();
- }
- public bool NextToken()
- {
- this.fsm_context.Return = false;
- for (;;)
- {
- Lexer.StateHandler stateHandler = Lexer.fsm_handler_table[this.state - 1];
- if (!stateHandler(this.fsm_context))
- {
- break;
- }
- if (this.end_of_input)
- {
- return false;
- }
- if (this.fsm_context.Return)
- {
- goto Block_3;
- }
- this.state = this.fsm_context.NextState;
- }
- throw new JsonException(this.input_char);
- Block_3:
- this.string_value = this.string_buffer.ToString();
- this.string_buffer.Remove(0, this.string_buffer.Length);
- this.token = Lexer.fsm_return_table[this.state - 1];
- if (this.token == 65542)
- {
- this.token = this.input_char;
- }
- this.state = this.fsm_context.NextState;
- return true;
- }
- private void UngetChar()
- {
- this.input_buffer = this.input_char;
- }
- private static int[] fsm_return_table;
- private static Lexer.StateHandler[] fsm_handler_table;
- private bool allow_comments;
- private bool allow_single_quoted_strings;
- private bool end_of_input;
- private FsmContext fsm_context;
- private int input_buffer;
- private int input_char;
- private TextReader reader;
- private int state;
- private StringBuilder string_buffer;
- private string string_value;
- private int token;
- private int unichar;
- [CompilerGenerated]
- private static Lexer.StateHandler _003C_003Ef__mg_0024cache0;
- [CompilerGenerated]
- private static Lexer.StateHandler _003C_003Ef__mg_0024cache1;
- [CompilerGenerated]
- private static Lexer.StateHandler _003C_003Ef__mg_0024cache2;
- [CompilerGenerated]
- private static Lexer.StateHandler _003C_003Ef__mg_0024cache3;
- [CompilerGenerated]
- private static Lexer.StateHandler _003C_003Ef__mg_0024cache4;
- [CompilerGenerated]
- private static Lexer.StateHandler _003C_003Ef__mg_0024cache5;
- [CompilerGenerated]
- private static Lexer.StateHandler _003C_003Ef__mg_0024cache6;
- [CompilerGenerated]
- private static Lexer.StateHandler _003C_003Ef__mg_0024cache7;
- [CompilerGenerated]
- private static Lexer.StateHandler _003C_003Ef__mg_0024cache8;
- [CompilerGenerated]
- private static Lexer.StateHandler _003C_003Ef__mg_0024cache9;
- [CompilerGenerated]
- private static Lexer.StateHandler _003C_003Ef__mg_0024cacheA;
- [CompilerGenerated]
- private static Lexer.StateHandler _003C_003Ef__mg_0024cacheB;
- [CompilerGenerated]
- private static Lexer.StateHandler _003C_003Ef__mg_0024cacheC;
- [CompilerGenerated]
- private static Lexer.StateHandler _003C_003Ef__mg_0024cacheD;
- [CompilerGenerated]
- private static Lexer.StateHandler _003C_003Ef__mg_0024cacheE;
- [CompilerGenerated]
- private static Lexer.StateHandler _003C_003Ef__mg_0024cacheF;
- [CompilerGenerated]
- private static Lexer.StateHandler _003C_003Ef__mg_0024cache10;
- [CompilerGenerated]
- private static Lexer.StateHandler _003C_003Ef__mg_0024cache11;
- [CompilerGenerated]
- private static Lexer.StateHandler _003C_003Ef__mg_0024cache12;
- [CompilerGenerated]
- private static Lexer.StateHandler _003C_003Ef__mg_0024cache13;
- [CompilerGenerated]
- private static Lexer.StateHandler _003C_003Ef__mg_0024cache14;
- [CompilerGenerated]
- private static Lexer.StateHandler _003C_003Ef__mg_0024cache15;
- [CompilerGenerated]
- private static Lexer.StateHandler _003C_003Ef__mg_0024cache16;
- [CompilerGenerated]
- private static Lexer.StateHandler _003C_003Ef__mg_0024cache17;
- [CompilerGenerated]
- private static Lexer.StateHandler _003C_003Ef__mg_0024cache18;
- [CompilerGenerated]
- private static Lexer.StateHandler _003C_003Ef__mg_0024cache19;
- [CompilerGenerated]
- private static Lexer.StateHandler _003C_003Ef__mg_0024cache1A;
- [CompilerGenerated]
- private static Lexer.StateHandler _003C_003Ef__mg_0024cache1B;
- private delegate bool StateHandler(FsmContext ctx);
- }
- }
|