📄 _ps1.0_parser.cpp
字号:
YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
yyn, yyrline[yyn]);
/* Print the symbols being reduced, and their result. */
for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++)
YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
}
#endif
switch (yyn) {
case 1:
#line 72 "ps1.0_grammar.y"
{
DBG_MESG("dbg: WholeEnchilada", line_number);
ps10::invoke(yyvsp[-2].consts, yyvsp[-1].lines, yyvsp[0].lines);
;
break;}
case 2:
#line 79 "ps1.0_grammar.y"
{
DBG_MESG("dbg: WholeEnchilada", line_number);
ps10::invoke(yyvsp[-2].consts, yyvsp[-1].lines, yyvsp[0].lines);
;
break;}
case 3:
#line 86 "ps1.0_grammar.y"
{
DBG_MESG("dbg: WholeEnchilada", line_number);
ps10::invoke( 0, yyvsp[-1].lines, yyvsp[0].lines);
;
break;}
case 4:
#line 93 "ps1.0_grammar.y"
{
DBG_MESG("dbg: WholeEnchilada", line_number);
ps10::invoke( 0, yyvsp[-1].lines, yyvsp[0].lines);
;
break;}
case 5:
#line 100 "ps1.0_grammar.y"
{
DBG_MESG("dbg: WholeEnchilada", line_number);
ps10::invoke(yyvsp[-1].consts, 0, yyvsp[0].lines);
;
break;}
case 6:
#line 107 "ps1.0_grammar.y"
{
DBG_MESG("dbg: WholeEnchilada", line_number);
ps10::invoke(yyvsp[-1].consts, 0, yyvsp[0].lines);
;
break;}
case 7:
#line 114 "ps1.0_grammar.y"
{
DBG_MESG("dbg: WholeEnchilada", line_number);
ps10::invoke( 0, 0, yyvsp[0].lines);
;
break;}
case 8:
#line 121 "ps1.0_grammar.y"
{
DBG_MESG("dbg: WholeEnchilada", line_number);
ps10::invoke( 0, 0, yyvsp[0].lines);
;
break;}
case 9:
#line 131 "ps1.0_grammar.y"
{
yyval.consts = new vector<constdef>;
yyval.consts->push_back(* yyvsp[0].cdef);
delete yyvsp[0].cdef;
;
break;}
case 10:
#line 139 "ps1.0_grammar.y"
{
yyval.consts = yyvsp[-1].consts;
yyval.consts->push_back(* yyvsp[0].cdef);
delete yyvsp[0].cdef;
;
break;}
case 11:
#line 151 "ps1.0_grammar.y"
{
yyval.cdef = new constdef;
yyval.cdef->reg = * yyvsp[-9].sval;
yyval.cdef->r = yyvsp[-7].fval;
yyval.cdef->g = yyvsp[-5].fval;
yyval.cdef->b = yyvsp[-3].fval;
yyval.cdef->a = yyvsp[-1].fval;
delete yyvsp[-9].sval;
;
break;}
case 12:
#line 165 "ps1.0_grammar.y"
{
yyval.lines = new list<vector<string> >;
yyval.lines->push_back(* yyvsp[0].line);
delete yyvsp[0].line;
;
break;}
case 13:
#line 173 "ps1.0_grammar.y"
{
yyval.lines = yyvsp[-1].lines;
yyval.lines->push_back(* yyvsp[0].line);
delete yyvsp[0].line;
;
break;}
case 14:
#line 184 "ps1.0_grammar.y"
{
yyval.line = new vector<string>;
yyval.line->push_back(* yyvsp[-2].sval);
yyval.line->push_back(* yyvsp[-1].sval);
delete yyvsp[-2].sval;
delete yyvsp[-1].sval;
;
break;}
case 15:
#line 194 "ps1.0_grammar.y"
{
yyval.line = new vector<string>;
yyval.line->push_back(* yyvsp[-4].sval);
yyval.line->push_back(* yyvsp[-3].sval);
yyval.line->push_back(* yyvsp[-1].sval);
delete yyvsp[-4].sval;
delete yyvsp[-3].sval;
delete yyvsp[-1].sval;
;
break;}
case 16:
#line 206 "ps1.0_grammar.y"
{
yyval.line = new vector<string>;
yyval.line->push_back(* yyvsp[-6].sval);
yyval.line->push_back(* yyvsp[-5].sval);
yyval.line->push_back(* yyvsp[-3].sval);
yyval.line->push_back(* yyvsp[-1].sval);
delete yyvsp[-6].sval;
delete yyvsp[-5].sval;
delete yyvsp[-3].sval;
delete yyvsp[-1].sval;
;
break;}
case 17:
#line 223 "ps1.0_grammar.y"
{
yyval.lines = new list<vector<string> >;
yyval.lines->push_back(* yyvsp[0].line);
delete yyvsp[0].line;
;
break;}
case 18:
#line 231 "ps1.0_grammar.y"
{
yyval.lines = yyvsp[-1].lines;
yyval.lines->push_back(* yyvsp[0].line);
delete yyvsp[0].line;
;
break;}
case 19:
#line 243 "ps1.0_grammar.y"
{
yyval.line = new vector<string>;
if ( yyvsp[-5].ival )
yyval.line->push_back("+");
yyval.line->push_back(* yyvsp[-4].sval);
yyval.line->push_back(* yyvsp[-3].sval);
yyval.line->push_back(* yyvsp[-1].sval);
delete yyvsp[-4].sval;
delete yyvsp[-3].sval;
delete yyvsp[-1].sval;
;
break;}
case 20:
#line 257 "ps1.0_grammar.y"
{
yyval.line = new vector<string>;
if ( yyvsp[-7].ival )
yyval.line->push_back("+");
yyval.line->push_back(* yyvsp[-6].sval);
yyval.line->push_back(* yyvsp[-5].sval);
yyval.line->push_back(* yyvsp[-3].sval);
yyval.line->push_back(* yyvsp[-1].sval);
delete yyvsp[-6].sval;
delete yyvsp[-5].sval;
delete yyvsp[-3].sval;
delete yyvsp[-1].sval;
;
break;}
case 21:
#line 273 "ps1.0_grammar.y"
{
yyval.line = new vector<string>;
if ( yyvsp[-9].ival )
yyval.line->push_back("+");
yyval.line->push_back(* yyvsp[-8].sval);
yyval.line->push_back(* yyvsp[-7].sval);
yyval.line->push_back(* yyvsp[-5].sval);
yyval.line->push_back(* yyvsp[-3].sval);
yyval.line->push_back(* yyvsp[-1].sval);
delete yyvsp[-8].sval;
delete yyvsp[-7].sval;
delete yyvsp[-5].sval;
delete yyvsp[-3].sval;
delete yyvsp[-1].sval;
;
break;}
case 22:
#line 292 "ps1.0_grammar.y"
{ yyval.ival=0; ;
break;}
case 23:
#line 295 "ps1.0_grammar.y"
{ yyval.ival=1; ;
break;}
case 24:
#line 301 "ps1.0_grammar.y"
{;
break;}
case 25:
#line 305 "ps1.0_grammar.y"
{;
break;}
}
#line 705 "/usr/share/bison/bison.simple"
yyvsp -= yylen;
yyssp -= yylen;
#if YYLSP_NEEDED
yylsp -= yylen;
#endif
#if YYDEBUG
if (yydebug)
{
short *yyssp1 = yyss - 1;
YYFPRINTF (stderr, "state stack now");
while (yyssp1 != yyssp)
YYFPRINTF (stderr, " %d", *++yyssp1);
YYFPRINTF (stderr, "\n");
}
#endif
*++yyvsp = yyval;
#if YYLSP_NEEDED
*++yylsp = yyloc;
#endif
/* Now `shift' the result of the reduction. Determine what state
that goes to, based on the state we popped back to and the rule
number reduced by. */
yyn = yyr1[yyn];
yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
yystate = yytable[yystate];
else
yystate = yydefgoto[yyn - YYNTBASE];
goto yynewstate;
/*------------------------------------.
| yyerrlab -- here on detecting error |
`------------------------------------*/
yyerrlab:
/* If not already recovering from an error, report this error. */
if (!yyerrstatus)
{
++yynerrs;
#ifdef YYERROR_VERBOSE
yyn = yypact[yystate];
if (yyn > YYFLAG && yyn < YYLAST)
{
YYSIZE_T yysize = 0;
char *yymsg;
int yyx, yycount;
yycount = 0;
/* Start YYX at -YYN if negative to avoid negative indexes in
YYCHECK. */
for (yyx = yyn < 0 ? -yyn : 0;
yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
if (yycheck[yyx + yyn] == yyx)
yysize += yystrlen (yytname[yyx]) + 15, yycount++;
yysize += yystrlen ("parse error, unexpected ") + 1;
yysize += yystrlen (yytname[YYTRANSLATE (yychar)]);
yymsg = (char *) YYSTACK_ALLOC (yysize);
if (yymsg != 0)
{
char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]);
if (yycount < 5)
{
yycount = 0;
for (yyx = yyn < 0 ? -yyn : 0;
yyx < (int) (sizeof (yytname) / sizeof (char *));
yyx++)
if (yycheck[yyx + yyn] == yyx)
{
const char *yyq = ! yycount ? ", expecting " : " or ";
yyp = yystpcpy (yyp, yyq);
yyp = yystpcpy (yyp, yytname[yyx]);
yycount++;
}
}
yyerror (yymsg);
YYSTACK_FREE (yymsg);
}
else
yyerror ("parse error; also virtual memory exhausted");
}
else
#endif /* defined (YYERROR_VERBOSE) */
yyerror ("parse error");
}
goto yyerrlab1;
/*--------------------------------------------------.
| yyerrlab1 -- error raised explicitly by an action |
`--------------------------------------------------*/
yyerrlab1:
if (yyerrstatus == 3)
{
/* If just tried and failed to reuse lookahead token after an
error, discard it. */
/* return failure if at end of input */
if (yychar == YYEOF)
YYABORT;
YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
yychar, yytname[yychar1]));
yychar = YYEMPTY;
}
/* Else will try to reuse lookahead token after shifting the error
token. */
yyerrstatus = 3; /* Each real token shifted decrements this */
goto yyerrhandle;
/*-------------------------------------------------------------------.
| yyerrdefault -- current state does not do anything special for the |
| error token. |
`-------------------------------------------------------------------*/
yyerrdefault:
#if 0
/* This is wrong; only states that explicitly want error tokens
should shift them. */
/* If its default is to accept any token, ok. Otherwise pop it. */
yyn = yydefact[yystate];
if (yyn)
goto yydefault;
#endif
/*---------------------------------------------------------------.
| yyerrpop -- pop the current state because it cannot handle the |
| error token |
`---------------------------------------------------------------*/
yyerrpop:
if (yyssp == yyss)
YYABORT;
yyvsp--;
yystate = *--yyssp;
#if YYLSP_NEEDED
yylsp--;
#endif
#if YYDEBUG
if (yydebug)
{
short *yyssp1 = yyss - 1;
YYFPRINTF (stderr, "Error: state stack now");
while (yyssp1 != yyssp)
YYFPRINTF (stderr, " %d", *++yyssp1);
YYFPRINTF (stderr, "\n");
}
#endif
/*--------------.
| yyerrhandle. |
`--------------*/
yyerrhandle:
yyn = yypact[yystate];
if (yyn == YYFLAG)
goto yyerrdefault;
yyn += YYTERROR;
if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
goto yyerrdefault;
yyn = yytable[yyn];
if (yyn < 0)
{
if (yyn == YYFLAG)
goto yyerrpop;
yyn = -yyn;
goto yyreduce;
}
else if (yyn == 0)
goto yyerrpop;
if (yyn == YYFINAL)
YYACCEPT;
YYDPRINTF ((stderr, "Shifting error token, "));
*++yyvsp = yylval;
#if YYLSP_NEEDED
*++yylsp = yylloc;
#endif
yystate = yyn;
goto yynewstate;
/*-------------------------------------.
| yyacceptlab -- YYACCEPT comes here. |
`-------------------------------------*/
yyacceptlab:
yyresult = 0;
goto yyreturn;
/*-----------------------------------.
| yyabortlab -- YYABORT comes here. |
`-----------------------------------*/
yyabortlab:
yyresult = 1;
goto yyreturn;
/*---------------------------------------------.
| yyoverflowab -- parser overflow comes here. |
`---------------------------------------------*/
yyoverflowlab:
yyerror ("parser stack overflow");
yyresult = 2;
/* Fall through. */
yyreturn:
#ifndef yyoverflow
if (yyss != yyssa)
YYSTACK_FREE (yyss);
#endif
return yyresult;
}
#line 308 "ps1.0_grammar.y"
void yyerror(char* s)
{
errors.set("parser: syntax error", line_number);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -