Browse Source

- fixed peg to handle include correctly

development
Andreas Romeyke 2 years ago
parent
commit
7785f0c397
3 changed files with 82 additions and 122 deletions
  1. +77
    -118
      src/parser/config_dsl.grammar.c
  2. +4
    -3
      src/parser/config_dsl.grammar.peg
  3. +1
    -1
      src/parser/config_parser.c

+ 77
- 118
src/parser/config_dsl.grammar.c View File

@ -308,9 +308,9 @@ YY_RULE(int) yy_SlashorBackslash(yycontext *yy); /* 14 */
YY_RULE(int) yy_ClosingBracket(yycontext *yy); /* 13 */
YY_RULE(int) yy_Path(yycontext *yy); /* 12 */
YY_RULE(int) yy_OpenBracket(yycontext *yy); /* 11 */
YY_RULE(int) yy_IncludeLine(yycontext *yy); /* 10 */
YY_RULE(int) yy_SpaceLine(yycontext *yy); /* 9 */
YY_RULE(int) yy_CommentLine(yycontext *yy); /* 8 */
YY_RULE(int) yy_SpaceLine(yycontext *yy); /* 10 */
YY_RULE(int) yy_CommentLine(yycontext *yy); /* 9 */
YY_RULE(int) yy_IncludeLine(yycontext *yy); /* 8 */
YY_RULE(int) yy_ModeLine(yycontext *yy); /* 7 */
YY_RULE(int) yy_TagLine(yycontext *yy); /* 6 */
YY_RULE(int) yy_EndOfLine(yycontext *yy); /* 5 */
@ -988,20 +988,6 @@ YY_ACTION(void) yy_1_CommentLine(yycontext *yy, char *yytext, int yyleng)
#undef yypos
#undef yy
}
YY_ACTION(void) yy_1_Line(yycontext *yy, char *yytext, int yyleng)
{
#define __ yy->__
#define yypos yy->__pos
#define yythunkpos yy->__thunkpos
yyprintf((stderr, "do yy_1_Line\n"));
{
#line 0
fprintf(stderr, "grammar parser error at line %i (error at '%s')\n", parser_state.lineno, yytext); exit(EXIT_FAILURE); ;
}
#undef yythunkpos
#undef yypos
#undef yy
}
YY_RULE(int) yy_EscapedPCRE(yycontext *yy)
{ int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos;
@ -1456,7 +1442,8 @@ YY_RULE(int) yy_Subpath(yycontext *yy)
l93:; yy->__pos= yypos91; yy->__thunkpos= yythunkpos91; if (!yymatchClass(yy, (unsigned char *)"\000\000\000\000\000\000\377\003\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l94; goto l91;
l94:; yy->__pos= yypos91; yy->__thunkpos= yythunkpos91; if (!yymatchChar(yy, '.')) goto l95; goto l91;
l95:; yy->__pos= yypos91; yy->__thunkpos= yythunkpos91; if (!yymatchChar(yy, '_')) goto l96; goto l91;
l96:; yy->__pos= yypos91; yy->__thunkpos= yythunkpos91; if (!yymatchChar(yy, '-')) goto l90;
l96:; yy->__pos= yypos91; yy->__thunkpos= yythunkpos91; if (!yymatchChar(yy, '-')) goto l97; goto l91;
l97:; yy->__pos= yypos91; yy->__thunkpos= yythunkpos91; if (!yy_SlashorBackslash(yy)) goto l90;
}
l91:;
yyprintf((stderr, " ok %s @ %s\n", "Subpath", yy->__buf+yy->__pos));
@ -1468,224 +1455,196 @@ YY_RULE(int) yy_Subpath(yycontext *yy)
YY_RULE(int) yy_SlashorBackslash(yycontext *yy)
{ int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos;
yyprintf((stderr, "%s\n", "SlashorBackslash"));
{ int yypos98= yy->__pos, yythunkpos98= yy->__thunkpos; if (!yymatchChar(yy, '/')) goto l99; goto l98;
l99:; yy->__pos= yypos98; yy->__thunkpos= yythunkpos98; if (!yymatchChar(yy, '\\')) goto l97;
{ int yypos99= yy->__pos, yythunkpos99= yy->__thunkpos; if (!yymatchChar(yy, '/')) goto l100; goto l99;
l100:; yy->__pos= yypos99; yy->__thunkpos= yythunkpos99; if (!yymatchChar(yy, '\\')) goto l98;
}
l98:;
l99:;
yyprintf((stderr, " ok %s @ %s\n", "SlashorBackslash", yy->__buf+yy->__pos));
return 1;
l97:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0;
l98:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0;
yyprintf((stderr, " fail %s @ %s\n", "SlashorBackslash", yy->__buf+yy->__pos));
return 0;
}
YY_RULE(int) yy_ClosingBracket(yycontext *yy)
{ int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos;
yyprintf((stderr, "%s\n", "ClosingBracket")); if (!yymatchChar(yy, ')')) goto l100;
yyprintf((stderr, "%s\n", "ClosingBracket")); if (!yymatchChar(yy, ')')) goto l101;
yyprintf((stderr, " ok %s @ %s\n", "ClosingBracket", yy->__buf+yy->__pos));
return 1;
l100:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0;
l101:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0;
yyprintf((stderr, " fail %s @ %s\n", "ClosingBracket", yy->__buf+yy->__pos));
return 0;
}
YY_RULE(int) yy_Path(yycontext *yy)
{ int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos;
yyprintf((stderr, "%s\n", "Path")); if (!yy_SlashorBackslash(yy)) goto l101; if (!yy_Subpath(yy)) goto l101;
l104:;
{ int yypos105= yy->__pos, yythunkpos105= yy->__thunkpos; if (!yy_Subpath(yy)) goto l105; goto l104;
l105:; yy->__pos= yypos105; yy->__thunkpos= yythunkpos105;
}
l102:;
{ int yypos103= yy->__pos, yythunkpos103= yy->__thunkpos; if (!yy_SlashorBackslash(yy)) goto l103; if (!yy_Subpath(yy)) goto l103;
l106:;
{ int yypos107= yy->__pos, yythunkpos107= yy->__thunkpos; if (!yy_Subpath(yy)) goto l107; goto l106;
l107:; yy->__pos= yypos107; yy->__thunkpos= yythunkpos107;
} goto l102;
l103:; yy->__pos= yypos103; yy->__thunkpos= yythunkpos103;
yyprintf((stderr, "%s\n", "Path")); if (!yy_Subpath(yy)) goto l102;
l103:;
{ int yypos104= yy->__pos, yythunkpos104= yy->__thunkpos; if (!yy_Subpath(yy)) goto l104; goto l103;
l104:; yy->__pos= yypos104; yy->__thunkpos= yythunkpos104;
}
yyprintf((stderr, " ok %s @ %s\n", "Path", yy->__buf+yy->__pos));
return 1;
l101:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0;
l102:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0;
yyprintf((stderr, " fail %s @ %s\n", "Path", yy->__buf+yy->__pos));
return 0;
}
YY_RULE(int) yy_OpenBracket(yycontext *yy)
{ int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos;
yyprintf((stderr, "%s\n", "OpenBracket")); if (!yymatchChar(yy, '(')) goto l108;
yyprintf((stderr, "%s\n", "OpenBracket")); if (!yymatchChar(yy, '(')) goto l105;
yyprintf((stderr, " ok %s @ %s\n", "OpenBracket", yy->__buf+yy->__pos));
return 1;
l108:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0;
l105:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0;
yyprintf((stderr, " fail %s @ %s\n", "OpenBracket", yy->__buf+yy->__pos));
return 0;
}
YY_RULE(int) yy_IncludeLine(yycontext *yy)
YY_RULE(int) yy_SpaceLine(yycontext *yy)
{
yyprintf((stderr, "%s\n", "SpaceLine"));
l107:;
{ int yypos108= yy->__pos, yythunkpos108= yy->__thunkpos; if (!yy_Space(yy)) goto l108; goto l107;
l108:; yy->__pos= yypos108; yy->__thunkpos= yythunkpos108;
}
yyprintf((stderr, " ok %s @ %s\n", "SpaceLine", yy->__buf+yy->__pos));
return 1;
}
YY_RULE(int) yy_CommentLine(yycontext *yy)
{ int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos;
yyprintf((stderr, "%s\n", "IncludeLine")); if (!yymatchString(yy, "include")) goto l109; if (!yy_OpenBracket(yy)) goto l109; yyText(yy, yy->__begin, yy->__end); {
yyprintf((stderr, "%s\n", "CommentLine")); if (!yymatchChar(yy, '#')) goto l109; yyText(yy, yy->__begin, yy->__end); {
#define yytext yy->__text
#define yyleng yy->__textlen
if (!(YY_BEGIN)) goto l109;
#undef yytext
#undef yyleng
} if (!yy_Path(yy)) goto l109; yyText(yy, yy->__begin, yy->__end); {
}
l110:;
{ int yypos111= yy->__pos, yythunkpos111= yy->__thunkpos;
{ int yypos112= yy->__pos, yythunkpos112= yy->__thunkpos; if (!yy_EndOfLine(yy)) goto l112; goto l111;
l112:; yy->__pos= yypos112; yy->__thunkpos= yythunkpos112;
} if (!yymatchDot(yy)) goto l111; goto l110;
l111:; yy->__pos= yypos111; yy->__thunkpos= yythunkpos111;
} yyText(yy, yy->__begin, yy->__end); {
#define yytext yy->__text
#define yyleng yy->__textlen
if (!(YY_END)) goto l109;
#undef yytext
#undef yyleng
} if (!yy_ClosingBracket(yy)) goto l109; yyDo(yy, yy_1_IncludeLine, yy->__begin, yy->__end);
yyprintf((stderr, " ok %s @ %s\n", "IncludeLine", yy->__buf+yy->__pos));
} yyDo(yy, yy_1_CommentLine, yy->__begin, yy->__end);
yyprintf((stderr, " ok %s @ %s\n", "CommentLine", yy->__buf+yy->__pos));
return 1;
l109:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0;
yyprintf((stderr, " fail %s @ %s\n", "IncludeLine", yy->__buf+yy->__pos));
yyprintf((stderr, " fail %s @ %s\n", "CommentLine", yy->__buf+yy->__pos));
return 0;
}
YY_RULE(int) yy_SpaceLine(yycontext *yy)
{
yyprintf((stderr, "%s\n", "SpaceLine"));
l111:;
{ int yypos112= yy->__pos, yythunkpos112= yy->__thunkpos; if (!yy_Space(yy)) goto l112; goto l111;
l112:; yy->__pos= yypos112; yy->__thunkpos= yythunkpos112;
}
yyprintf((stderr, " ok %s @ %s\n", "SpaceLine", yy->__buf+yy->__pos));
return 1;
}
YY_RULE(int) yy_CommentLine(yycontext *yy)
YY_RULE(int) yy_IncludeLine(yycontext *yy)
{ int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos;
yyprintf((stderr, "%s\n", "CommentLine")); if (!yymatchChar(yy, '#')) goto l113; yyText(yy, yy->__begin, yy->__end); {
yyprintf((stderr, "%s\n", "IncludeLine")); if (!yymatchString(yy, "include")) goto l113; if (!yy_OpenBracket(yy)) goto l113; yyText(yy, yy->__begin, yy->__end); {
#define yytext yy->__text
#define yyleng yy->__textlen
if (!(YY_BEGIN)) goto l113;
#undef yytext
#undef yyleng
}
l114:;
{ int yypos115= yy->__pos, yythunkpos115= yy->__thunkpos;
{ int yypos116= yy->__pos, yythunkpos116= yy->__thunkpos; if (!yy_EndOfLine(yy)) goto l116; goto l115;
l116:; yy->__pos= yypos116; yy->__thunkpos= yythunkpos116;
} if (!yymatchDot(yy)) goto l115; goto l114;
l115:; yy->__pos= yypos115; yy->__thunkpos= yythunkpos115;
} yyText(yy, yy->__begin, yy->__end); {
} if (!yy_Path(yy)) goto l113; yyText(yy, yy->__begin, yy->__end); {
#define yytext yy->__text
#define yyleng yy->__textlen
if (!(YY_END)) goto l113;
#undef yytext
#undef yyleng
} yyDo(yy, yy_1_CommentLine, yy->__begin, yy->__end);
yyprintf((stderr, " ok %s @ %s\n", "CommentLine", yy->__buf+yy->__pos));
} if (!yy_ClosingBracket(yy)) goto l113; yyDo(yy, yy_1_IncludeLine, yy->__begin, yy->__end);
yyprintf((stderr, " ok %s @ %s\n", "IncludeLine", yy->__buf+yy->__pos));
return 1;
l113:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0;
yyprintf((stderr, " fail %s @ %s\n", "CommentLine", yy->__buf+yy->__pos));
yyprintf((stderr, " fail %s @ %s\n", "IncludeLine", yy->__buf+yy->__pos));
return 0;
}
YY_RULE(int) yy_ModeLine(yycontext *yy)
{ int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos;
yyprintf((stderr, "%s\n", "ModeLine")); if (!yymatchString(yy, "mode")) goto l117; if (!yy_OpenBracket(yy)) goto l117; yyText(yy, yy->__begin, yy->__end); {
yyprintf((stderr, "%s\n", "ModeLine")); if (!yymatchString(yy, "mode")) goto l114; if (!yy_OpenBracket(yy)) goto l114; yyText(yy, yy->__begin, yy->__end); {
#define yytext yy->__text
#define yyleng yy->__textlen
if (!(YY_BEGIN)) goto l117;
if (!(YY_BEGIN)) goto l114;
#undef yytext
#undef yyleng
} if (!yy_Mode(yy)) goto l117; yyText(yy, yy->__begin, yy->__end); {
} if (!yy_Mode(yy)) goto l114; yyText(yy, yy->__begin, yy->__end); {
#define yytext yy->__text
#define yyleng yy->__textlen
if (!(YY_END)) goto l117;
if (!(YY_END)) goto l114;
#undef yytext
#undef yyleng
} if (!yy_ClosingBracket(yy)) goto l117; yyDo(yy, yy_1_ModeLine, yy->__begin, yy->__end);
} if (!yy_ClosingBracket(yy)) goto l114; yyDo(yy, yy_1_ModeLine, yy->__begin, yy->__end);
yyprintf((stderr, " ok %s @ %s\n", "ModeLine", yy->__buf+yy->__pos));
return 1;
l117:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0;
l114:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0;
yyprintf((stderr, " fail %s @ %s\n", "ModeLine", yy->__buf+yy->__pos));
return 0;
}
YY_RULE(int) yy_TagLine(yycontext *yy)
{ int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos;
yyprintf((stderr, "%s\n", "TagLine"));
{ int yypos119= yy->__pos, yythunkpos119= yy->__thunkpos; if (!yy_Tag(yy)) goto l120; if (!yy_Semicolon(yy)) goto l120; if (!yy_Requirements(yy)) goto l120; if (!yy_Semicolon(yy)) goto l120; if (!yy_Content(yy)) goto l120; yyDo(yy, yy_1_TagLine, yy->__begin, yy->__end); goto l119;
l120:; yy->__pos= yypos119; yy->__thunkpos= yythunkpos119; if (!yy_Tag(yy)) goto l118; if (!yy_Semicolon(yy)) goto l118; if (!yy_Requirements(yy)) goto l118; if (!yy_Semicolon(yy)) goto l118; if (!yy_LogicalOr(yy)) goto l118; yyDo(yy, yy_2_TagLine, yy->__begin, yy->__end);
{ int yypos116= yy->__pos, yythunkpos116= yy->__thunkpos; if (!yy_Tag(yy)) goto l117; if (!yy_Semicolon(yy)) goto l117; if (!yy_Requirements(yy)) goto l117; if (!yy_Semicolon(yy)) goto l117; if (!yy_Content(yy)) goto l117; yyDo(yy, yy_1_TagLine, yy->__begin, yy->__end); goto l116;
l117:; yy->__pos= yypos116; yy->__thunkpos= yythunkpos116; if (!yy_Tag(yy)) goto l115; if (!yy_Semicolon(yy)) goto l115; if (!yy_Requirements(yy)) goto l115; if (!yy_Semicolon(yy)) goto l115; if (!yy_LogicalOr(yy)) goto l115; yyDo(yy, yy_2_TagLine, yy->__begin, yy->__end);
}
l119:;
l116:;
yyprintf((stderr, " ok %s @ %s\n", "TagLine", yy->__buf+yy->__pos));
return 1;
l118:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0;
l115:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0;
yyprintf((stderr, " fail %s @ %s\n", "TagLine", yy->__buf+yy->__pos));
return 0;
}
YY_RULE(int) yy_EndOfLine(yycontext *yy)
{ int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos;
yyprintf((stderr, "%s\n", "EndOfLine")); if (!yymatchClass(yy, (unsigned char *)"\000\044\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l121; yyDo(yy, yy_1_EndOfLine, yy->__begin, yy->__end);
yyprintf((stderr, "%s\n", "EndOfLine")); if (!yymatchClass(yy, (unsigned char *)"\000\044\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l118; yyDo(yy, yy_1_EndOfLine, yy->__begin, yy->__end);
yyprintf((stderr, " ok %s @ %s\n", "EndOfLine", yy->__buf+yy->__pos));
return 1;
l121:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0;
l118:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0;
yyprintf((stderr, " fail %s @ %s\n", "EndOfLine", yy->__buf+yy->__pos));
return 0;
}
YY_RULE(int) yy_LineType(yycontext *yy)
{ int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos;
yyprintf((stderr, "%s\n", "LineType"));
{ int yypos123= yy->__pos, yythunkpos123= yy->__thunkpos; if (!yy_TagLine(yy)) goto l124; goto l123;
l124:; yy->__pos= yypos123; yy->__thunkpos= yythunkpos123; if (!yy_ModeLine(yy)) goto l125; goto l123;
l125:; yy->__pos= yypos123; yy->__thunkpos= yythunkpos123; if (!yy_CommentLine(yy)) goto l126; goto l123;
l126:; yy->__pos= yypos123; yy->__thunkpos= yythunkpos123; if (!yy_SpaceLine(yy)) goto l127; goto l123;
l127:; yy->__pos= yypos123; yy->__thunkpos= yythunkpos123; if (!yy_IncludeLine(yy)) goto l122;
{ int yypos120= yy->__pos, yythunkpos120= yy->__thunkpos; if (!yy_TagLine(yy)) goto l121; goto l120;
l121:; yy->__pos= yypos120; yy->__thunkpos= yythunkpos120; if (!yy_ModeLine(yy)) goto l122; goto l120;
l122:; yy->__pos= yypos120; yy->__thunkpos= yythunkpos120; if (!yy_IncludeLine(yy)) goto l123; goto l120;
l123:; yy->__pos= yypos120; yy->__thunkpos= yythunkpos120; if (!yy_CommentLine(yy)) goto l124; goto l120;
l124:; yy->__pos= yypos120; yy->__thunkpos= yythunkpos120; if (!yy_SpaceLine(yy)) goto l119;
}
l123:;
l120:;
yyprintf((stderr, " ok %s @ %s\n", "LineType", yy->__buf+yy->__pos));
return 1;
l122:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0;
l119:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0;
yyprintf((stderr, " fail %s @ %s\n", "LineType", yy->__buf+yy->__pos));
return 0;
}
YY_RULE(int) yy_EndOfFile(yycontext *yy)
{ int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos;
yyprintf((stderr, "%s\n", "EndOfFile"));
{ int yypos129= yy->__pos, yythunkpos129= yy->__thunkpos; if (!yymatchDot(yy)) goto l129; goto l128;
l129:; yy->__pos= yypos129; yy->__thunkpos= yythunkpos129;
{ int yypos126= yy->__pos, yythunkpos126= yy->__thunkpos; if (!yymatchDot(yy)) goto l126; goto l125;
l126:; yy->__pos= yypos126; yy->__thunkpos= yythunkpos126;
}
yyprintf((stderr, " ok %s @ %s\n", "EndOfFile", yy->__buf+yy->__pos));
return 1;
l128:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0;
l125:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0;
yyprintf((stderr, " fail %s @ %s\n", "EndOfFile", yy->__buf+yy->__pos));
return 0;
}
YY_RULE(int) yy_Line(yycontext *yy)
{ int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos;
yyprintf((stderr, "%s\n", "Line"));
{ int yypos131= yy->__pos, yythunkpos131= yy->__thunkpos; if (!yy_LineType(yy)) goto l132; if (!yy_EndOfLine(yy)) goto l132; goto l131;
l132:; yy->__pos= yypos131; yy->__thunkpos= yythunkpos131; yyText(yy, yy->__begin, yy->__end); {
#define yytext yy->__text
#define yyleng yy->__textlen
if (!(YY_BEGIN)) goto l130;
#undef yytext
#undef yyleng
} if (!yymatchClass(yy, (unsigned char *)"\377\333\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377")) goto l130;
l133:;
{ int yypos134= yy->__pos, yythunkpos134= yy->__thunkpos; if (!yymatchClass(yy, (unsigned char *)"\377\333\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377")) goto l134; goto l133;
l134:; yy->__pos= yypos134; yy->__thunkpos= yythunkpos134;
} yyText(yy, yy->__begin, yy->__end); {
#define yytext yy->__text
#define yyleng yy->__textlen
if (!(YY_END)) goto l130;
#undef yytext
#undef yyleng
} if (!yy_EndOfLine(yy)) goto l130; yyDo(yy, yy_1_Line, yy->__begin, yy->__end);
}
l131:;
yyprintf((stderr, "%s\n", "Line")); if (!yy_LineType(yy)) goto l127; if (!yy_EndOfLine(yy)) goto l127;
yyprintf((stderr, " ok %s @ %s\n", "Line", yy->__buf+yy->__pos));
return 1;
l130:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0;
l127:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0;
yyprintf((stderr, " fail %s @ %s\n", "Line", yy->__buf+yy->__pos));
return 0;
}
YY_RULE(int) yy_start(yycontext *yy)
{ int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos;
yyprintf((stderr, "%s\n", "start")); if (!yy_Line(yy)) goto l135;
l136:;
{ int yypos137= yy->__pos, yythunkpos137= yy->__thunkpos; if (!yy_Line(yy)) goto l137; goto l136;
l137:; yy->__pos= yypos137; yy->__thunkpos= yythunkpos137;
} if (!yy_EndOfFile(yy)) goto l135;
yyprintf((stderr, "%s\n", "start")); if (!yy_Line(yy)) goto l128;
l129:;
{ int yypos130= yy->__pos, yythunkpos130= yy->__thunkpos; if (!yy_Line(yy)) goto l130; goto l129;
l130:; yy->__pos= yypos130; yy->__thunkpos= yythunkpos130;
} if (!yy_EndOfFile(yy)) goto l128;
yyprintf((stderr, " ok %s @ %s\n", "start", yy->__buf+yy->__pos));
return 1;
l135:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0;
l128:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0;
yyprintf((stderr, " fail %s @ %s\n", "start", yy->__buf+yy->__pos));
return 0;
}


+ 4
- 3
src/parser/config_dsl.grammar.peg View File

@ -8,12 +8,12 @@
#
start <- ( Line )+ EndOfFile
Line <- LineType EndOfLine
/ < [^\r\n]+ > EndOfLine {fprintf(stderr, "grammar parser error at line %i (error at '%s')\n", parser_state.lineno, yytext); exit(EXIT_FAILURE); }
# / < [^\r\n]+ > EndOfLine {fprintf(stderr, "grammar parser error at line %i (error at '%s')\n", parser_state.lineno, yytext); exit(EXIT_FAILURE); }
LineType <- TagLine
/ ModeLine
/ IncludeLine
/ CommentLine
/ SpaceLine
/ IncludeLine
CommentLine <- '#' < ( !EndOfLine .)* > { commentline(); }
IncludeLine <- 'include' OpenBracket < Path > ClosingBracket { set_include ( yytext ); }
@ -21,7 +21,7 @@ IncludeLine <- 'include' OpenBracket < Path > ClosingBracket { set_include
SlashorBackslash <- '/'
/ '\\'
Path <- ( SlashorBackslash (Subpath)+ )+
Path <- ( Subpath )+
Subpath <- [A-Z]
/ [a-z]
@ -29,6 +29,7 @@ Subpath <- [A-Z]
/ '.'
/ '_'
/ '-'
/ SlashorBackslash
ModeLine <- 'mode' OpenBracket < Mode > ClosingBracket { int i = i_pop(); set_mode( i ); }


+ 1
- 1
src/parser/config_parser.c View File

@ -1156,7 +1156,7 @@ void set_include( const char * include_file ) {
exit (EXIT_FAILURE);
}
parser_state.includedepth++;
printf("Include=%s\n", include_file);
printf("Include='%s'\n", include_file);
FILE * cfg = fopen(include_file, "r");
if (NULL == cfg) {
fprintf( stderr, "file '%s' could not be opened\n", include_file);


Loading…
Cancel
Save