
Contents of /Public_Parser_JSON2-0.8/json_utf8.c:
#line 1 "src/json_utf8.rl"
// vim:syntax=ragel
char *_parse_JSON_utf8(char *p, char *pe, struct parser_state *state);
#include "json_string_utf8.c"
#include "json_number_utf8.c"
#include "json_array_utf8.c"
#include "json_mapping_utf8.c"
#line 43 "src/json_utf8.rl"
char *_parse_JSON_utf8(char *p, char *pe, struct parser_state *state) {
char *i = p;
int cs;
int c = 0;
#line 21 "work/json_utf8.c"
static const int JSON_start = 1;
static const int JSON_first_final = 12;
static const int JSON_error = 0;
static const int JSON_en_main = 1;
#line 51 "src/json_utf8.rl"
#line 31 "work/json_utf8.c"
{
cs = JSON_start;
}
#line 53 "src/json_utf8.rl"
#line 37 "work/json_utf8.c"
{
if ( p == pe )
goto _out;
switch ( cs )
{
st1:
if ( ++p == pe )
goto _out1;
case 1:
switch( (*p) ) {
case 13: goto st1;
case 32: goto st1;
case 34: goto tr2;
case 43: goto tr3;
case 91: goto tr4;
case 102: goto st2;
case 110: goto st6;
case 116: goto st9;
case 123: goto tr8;
}
if ( (*p) < 45 ) {
if ( 9 <= (*p) && (*p) <= 10 )
goto st1;
} else if ( (*p) > 46 ) {
if ( 48 <= (*p) && (*p) <= 57 )
goto tr3;
} else
goto tr3;
goto st0;
st0:
goto _out0;
tr2:
#line 24 "src/json_utf8.rl"
{ PARSE(string_utf8, p); {p = (( i))-1;} }
goto st12;
tr3:
#line 25 "src/json_utf8.rl"
{ PARSE(number_utf8, p); {p = (( i))-1;} }
goto st12;
tr4:
#line 27 "src/json_utf8.rl"
{ PARSE(array_utf8, p); {p = (( i))-1;} }
goto st12;
tr8:
#line 26 "src/json_utf8.rl"
{ PARSE(mapping_utf8, p); {p = (( i))-1;} }
goto st12;
tr12:
#line 31 "src/json_utf8.rl"
{ PUSH_SPECIAL("false"); }
goto st12;
tr15:
#line 32 "src/json_utf8.rl"
{ PUSH_SPECIAL("null"); }
goto st12;
tr18:
#line 30 "src/json_utf8.rl"
{ PUSH_SPECIAL("true"); }
goto st12;
st12:
if ( ++p == pe )
goto _out12;
case 12:
#line 42 "src/json_utf8.rl"
{ if (state->level != 0) goto _out12; }
#line 103 "work/json_utf8.c"
switch( (*p) ) {
case 13: goto st12;
case 32: goto st12;
}
if ( 9 <= (*p) && (*p) <= 10 )
goto st12;
goto st0;
st2:
if ( ++p == pe )
goto _out2;
case 2:
if ( (*p) == 97 )
goto st3;
goto st0;
st3:
if ( ++p == pe )
goto _out3;
case 3:
if ( (*p) == 108 )
goto st4;
goto st0;
st4:
if ( ++p == pe )
goto _out4;
case 4:
if ( (*p) == 115 )
goto st5;
goto st0;
st5:
if ( ++p == pe )
goto _out5;
case 5:
if ( (*p) == 101 )
goto tr12;
goto st0;
st6:
if ( ++p == pe )
goto _out6;
case 6:
if ( (*p) == 117 )
goto st7;
goto st0;
st7:
if ( ++p == pe )
goto _out7;
case 7:
if ( (*p) == 108 )
goto st8;
goto st0;
st8:
if ( ++p == pe )
goto _out8;
case 8:
if ( (*p) == 108 )
goto tr15;
goto st0;
st9:
if ( ++p == pe )
goto _out9;
case 9:
if ( (*p) == 114 )
goto st10;
goto st0;
st10:
if ( ++p == pe )
goto _out10;
case 10:
if ( (*p) == 117 )
goto st11;
goto st0;
st11:
if ( ++p == pe )
goto _out11;
case 11:
if ( (*p) == 101 )
goto tr18;
goto st0;
}
_out1: cs = 1; goto _out;
_out0: cs = 0; goto _out;
_out12: cs = 12; goto _out;
_out2: cs = 2; goto _out;
_out3: cs = 3; goto _out;
_out4: cs = 4; goto _out;
_out5: cs = 5; goto _out;
_out6: cs = 6; goto _out;
_out7: cs = 7; goto _out;
_out8: cs = 8; goto _out;
_out9: cs = 9; goto _out;
_out10: cs = 10; goto _out;
_out11: cs = 11; goto _out;
_out: {}
}
#line 54 "src/json_utf8.rl"
if (cs >= JSON_first_final) {
return p;
}
if (!state->validate && c > 0) pop_n_elems(c);
push_int((int)p);
return NULL;
}