本文整理汇总了C#中LitJson.FsmContext类的典型用法代码示例。如果您正苦于以下问题:C# FsmContext类的具体用法?C# FsmContext怎么用?C# FsmContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FsmContext类属于LitJson命名空间,在下文中一共展示了FsmContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Lexer
public Lexer(TextReader
reader)
{
allow_comments
=
true;
allow_single_quoted_strings
=
true;
input_buffer
=
0;
string_buffer
=
new
StringBuilder
(128);
state
=
1;
end_of_input
=
false;
this.reader
=
reader;
fsm_context
=
new
FsmContext
();
fsm_context.L
=
this;
}
示例2: Lexer
public Lexer(TextReader reader)
{
_allowComments = true;
_allowSingleQuotedStrings = true;
_inputBuffer = 0;
_stringBuffer = new StringBuilder (128);
_state = 1;
_endOfInput = false;
_reader = reader;
_fsmContext = new FsmContext {L = this};
}
示例3: Lexer
public Lexer(TextReader reader) {
AllowComments = true;
AllowSingleQuotedStrings = true;
inputBuffer = 0;
stringBuffer = new StringBuilder(128);
state = 1;
EndOfInput = false;
this.reader = reader;
context = new FsmContext();
context.L = this;
}
示例4: State1
private static bool State1(FsmContext ctx)
{
while (ctx.L.GetChar ()) {
if (ctx.L.input_char == ' ' ||
ctx.L.input_char >= '\t' && ctx.L.input_char <= '\r')
continue;
if (ctx.L.input_char >= '1' && ctx.L.input_char <= '9') {
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
ctx.NextState = 3;
return true;
}
switch (ctx.L.input_char) {
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.L.string_buffer.Append ((char) ctx.L.input_char);
ctx.NextState = 2;
return true;
case '0':
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
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.L.allow_single_quoted_strings)
return false;
ctx.L.input_char = '"';
ctx.NextState = 23;
ctx.Return = true;
return true;
case '/':
if (! ctx.L.allow_comments)
return false;
ctx.NextState = 25;
return true;
default:
return false;
}
}
return true;
}
示例5: State26
static bool State26(FsmContext ctx)
{
while (ctx.L.GetChar())
{
if (ctx.L.input_char == '\n')
{
ctx.NextState = 1;
return true;
}
}
return true;
}
示例6: State23
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;
}
示例7: State25
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;
}
示例8: State28
private static bool State28(FsmContext ctx)
{
while (ctx.L.GetChar ()) {
if (ctx.L.input_char == '*')
continue;
if (ctx.L.input_char == '/') {
ctx.NextState = 1;
return true;
}
ctx.NextState = 27;
return true;
}
return true;
}
示例9: State25
private static bool State25(FsmContext ctx)
{
ctx.L.GetChar ();
switch (ctx.L.input_char) {
case '*':
ctx.NextState = 27;
return true;
case '/':
ctx.NextState = 26;
return true;
default:
return false;
}
}
示例10: State23
private static bool State23(FsmContext ctx)
{
while (ctx.L.GetChar ()) {
switch (ctx.L.input_char) {
case '\'':
ctx.L.UngetChar ();
ctx.Return = true;
ctx.NextState = 24;
return true;
case '\\':
ctx.StateStack = 23;
ctx.NextState = 21;
return true;
default:
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
continue;
}
}
return true;
}
示例11: State9
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;
}
示例12: State7
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;
}
switch (ctx.L.input_char)
{
case 43:
case 45:
ctx.L.string_buffer.Append((char)ctx.L.input_char);
ctx.NextState = 8;
return true;
}
return false;
}
示例13: State8
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;
}
示例14: State6
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;
}
示例15: State4
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:
goto IL_98;
case 45:
IL_73:
if (num != 69)
{
if (num == 93)
{
goto IL_98;
}
if (num != 101)
{
if (num != 125)
{
return false;
}
goto IL_98;
}
}
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;
}
goto IL_73;
IL_98:
ctx.L.UngetChar();
ctx.Return = true;
ctx.NextState = 1;
return true;
}