Mirror of espurna firmware for wireless switches and more
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

181 lines
3.2 KiB

/* Generated by re2c 2.2 */
#line 1 "espurna\\ir_parse_state.re"
/*
Part of the IR MODULE
For more info:
- https://re2c.org/
- https://re2c.org/manual/manual_c.html
*/
#pragma once
ParseResult<Payload> parse(StringView view) {
const char* YYCURSOR { view.begin() };
const char* YYLIMIT { view.end() };
const char* YYMARKER;
const char *p0 = nullptr, *p1 = nullptr;
const char *c0 = nullptr, *c1 = nullptr;
const char *s0 = nullptr, *s1 = nullptr;
const char *d0 = nullptr, *d1 = nullptr;
ParseResult<Payload> out;
#line 29 "espurna\\ir_parse_state.re.ipp"
const char *yyt1 { nullptr };
const char *yyt2 { nullptr };
const char *yyt3 { nullptr };
const char *yyt4 { nullptr };
#line 25 "espurna\\ir_parse_state.re"
#line 37 "espurna\\ir_parse_state.re.ipp"
{
char yych;
unsigned int yyaccept = 0;
yych = *YYCURSOR;
switch (yych) {
case '0' ... '9':
yyt1 = YYCURSOR;
goto yy4;
default:
if (YYLIMIT <= YYCURSOR) goto yy20;
goto yy2;
}
yy2:
++YYCURSOR;
yy3:
#line 49 "espurna\\ir_parse_state.re"
{ goto return_out; }
#line 55 "espurna\\ir_parse_state.re.ipp"
yy4:
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
switch (yych) {
case '0' ... ':': goto yy6;
default: goto yy3;
}
yy5:
yych = *++YYCURSOR;
yy6:
switch (yych) {
case '0' ... '9': goto yy5;
case ':': goto yy8;
default: goto yy7;
}
yy7:
YYCURSOR = YYMARKER;
switch (yyaccept) {
case 0:
goto yy3;
case 1:
goto yy11;
default:
goto yy15;
}
yy8:
yych = *++YYCURSOR;
switch (yych) {
case '0' ... '9':
case 'A' ... 'F':
case 'a' ... 'f':
yyt2 = YYCURSOR;
goto yy9;
default: goto yy7;
}
yy9:
yyaccept = 1;
yych = *(YYMARKER = ++YYCURSOR);
switch (yych) {
case '0' ... '9':
case 'A' ... 'F':
case 'a' ... 'f': goto yy9;
case ':': goto yy12;
default: goto yy11;
}
yy11:
p0 = yyt1;
c0 = yyt2;
p1 = yyt2 - 1;
c1 = YYCURSOR;
#line 38 "espurna\\ir_parse_state.re"
{ goto update_out; }
#line 108 "espurna\\ir_parse_state.re.ipp"
yy12:
yych = *++YYCURSOR;
switch (yych) {
case '0' ... '9':
yyt3 = YYCURSOR;
goto yy13;
default: goto yy7;
}
yy13:
yyaccept = 2;
yych = *(YYMARKER = ++YYCURSOR);
switch (yych) {
case '0' ... '9': goto yy13;
case ':': goto yy16;
default: goto yy15;
}
yy15:
p0 = yyt1;
c0 = yyt2;
s0 = yyt3;
p1 = yyt2 - 1;
c1 = yyt3 - 1;
s1 = YYCURSOR;
#line 42 "espurna\\ir_parse_state.re"
{ goto update_out; }
#line 134 "espurna\\ir_parse_state.re.ipp"
yy16:
yych = *++YYCURSOR;
switch (yych) {
case '0' ... '9':
yyt4 = YYCURSOR;
goto yy17;
default: goto yy7;
}
yy17:
yych = *++YYCURSOR;
switch (yych) {
case '0' ... '9': goto yy17;
default: goto yy19;
}
yy19:
p0 = yyt1;
c0 = yyt2;
s0 = yyt3;
d0 = yyt4;
p1 = yyt2 - 1;
c1 = yyt3 - 1;
s1 = yyt4 - 1;
d1 = YYCURSOR;
#line 47 "espurna\\ir_parse_state.re"
{ goto update_out; }
#line 160 "espurna\\ir_parse_state.re.ipp"
yy20:
#line 50 "espurna\\ir_parse_state.re"
{ goto return_out; }
#line 164 "espurna\\ir_parse_state.re.ipp"
}
#line 51 "espurna\\ir_parse_state.re"
update_out:
{
if (!((c1 - c0) % 2)) {
out = prepare(
StringView{p0, p1},
StringView{c0, c1},
StringView{s0, s1},
StringView{d0, d1});
}
}
return_out:
return out;
}