/// <summary> /// </summary> /// <param name="ctx">The CTX.</param> /// <returns></returns> private static bool State4(FsmContext ctx) { ctx.Lex.GetChar(); if (ctx.Lex._inputChar == ' ' || ctx.Lex._inputChar >= '\t' && ctx.Lex._inputChar <= '\r') { ctx.Return = true; ctx.NextState = 1; return(true); } switch (ctx.Lex._inputChar) { case ',': case ']': case '}': ctx.Lex.UngetChar(); ctx.Return = true; ctx.NextState = 1; return(true); case '.': ctx.Lex._stringBuffer.Append((char)ctx.Lex._inputChar); ctx.NextState = 5; return(true); case 'e': case 'E': ctx.Lex._stringBuffer.Append((char)ctx.Lex._inputChar); ctx.NextState = 7; return(true); default: return(false); } }
/// <summary> /// </summary> /// <param name="ctx">The CTX.</param> /// <returns></returns> private static bool State1(FsmContext ctx) { while (ctx.Lex.GetChar()) { if (ctx.Lex._inputChar == ' ' || ctx.Lex._inputChar >= '\t' && ctx.Lex._inputChar <= '\r') { continue; } if (ctx.Lex._inputChar >= '1' && ctx.Lex._inputChar <= '9') { ctx.Lex._stringBuffer.Append((char)ctx.Lex._inputChar); ctx.NextState = 3; return(true); } switch (ctx.Lex._inputChar) { case '"': ctx.NextState = 19; ctx.Return = true; return(true); case ',': case ':': case '[': case ']': case '{': case '}': ctx.NextState = 1; ctx.Return = true; return(true); case '-': ctx.Lex._stringBuffer.Append((char)ctx.Lex._inputChar); ctx.NextState = 2; return(true); case '0': ctx.Lex._stringBuffer.Append((char)ctx.Lex._inputChar); ctx.NextState = 4; return(true); case 'f': ctx.NextState = 12; return(true); case 'n': ctx.NextState = 16; return(true); case 't': ctx.NextState = 9; return(true); case '\'': if (!ctx.Lex.AllowSingleQuotedStrings) { return(false); } ctx.Lex._inputChar = '"'; ctx.NextState = 23; ctx.Return = true; return(true); case '/': if (!ctx.Lex.AllowComments) { return(false); } ctx.NextState = 25; return(true); default: return(false); } } return(true); }