style: harmonize the labels of yyparse

* data/glr.c, data/lalr1.cc, data/yacc.c: Fix indentation and
other formatting issues.
This commit is contained in:
Akim Demaille
2018-11-20 20:41:23 +01:00
parent ebb92c0545
commit 6bc54a934e
3 changed files with 66 additions and 34 deletions

View File

@@ -793,17 +793,22 @@ b4_dollar_popdef])[]dnl
yystack_.clear ();
yypush_ (YY_NULLPTR, 0, YY_MOVE (yyla));
// A new symbol was pushed on the stack.
/*-----------------------------------------------.
| yynewstate -- push a new symbol on the stack. |
`-----------------------------------------------*/
yynewstate:
YYCDEBUG << "Entering state " << yystack_[0].state << '\n';
// Accept?
if (yystack_[0].state == yyfinal_)
goto yyacceptlab;
YYACCEPT;
goto yybackup;
// Backup.
/*-----------.
| yybackup. |
`-----------*/
yybackup:
// Try to take a decision without lookahead.
yyn = yypact_[yystack_[0].state];
@@ -856,6 +861,7 @@ b4_dollar_popdef])[]dnl
yypush_ ("Shifting", yyn, YY_MOVE (yyla));
goto yynewstate;
/*-----------------------------------------------------------.
| yydefault -- do the default action for the current state. |
`-----------------------------------------------------------*/
@@ -865,8 +871,9 @@ b4_dollar_popdef])[]dnl
goto yyerrlab;
goto yyreduce;
/*-----------------------------.
| yyreduce -- Do a reduction. |
| yyreduce -- do a reduction. |
`-----------------------------*/
yyreduce:
yylen = yyr2_[yyn];
@@ -926,6 +933,7 @@ b4_dollar_popdef])[]dnl
}
goto yynewstate;
/*--------------------------------------.
| yyerrlab -- here on detecting error. |
`--------------------------------------*/
@@ -963,7 +971,6 @@ b4_dollar_popdef])[]dnl
| yyerrorlab -- error raised explicitly by YYERROR. |
`---------------------------------------------------*/
yyerrorlab:
/* Pacify compilers like GCC when the user code never invokes
YYERROR and the label yyerrorlab therefore never appears in user
code. */
@@ -975,6 +982,7 @@ b4_dollar_popdef])[]dnl
yylen = 0;
goto yyerrlab1;
/*-------------------------------------------------------------.
| yyerrlab1 -- common code for both syntax error and YYERROR. |
`-------------------------------------------------------------*/
@@ -1015,16 +1023,26 @@ b4_dollar_popdef])[]dnl
}
goto yynewstate;
// Accept.
/*-------------------------------------.
| yyacceptlab -- YYACCEPT comes here. |
`-------------------------------------*/
yyacceptlab:
yyresult = 0;
goto yyreturn;
// Abort.
/*-----------------------------------.
| yyabortlab -- YYABORT comes here. |
`-----------------------------------*/
yyabortlab:
yyresult = 1;
goto yyreturn;
/*-----------------------------------------------------.
| yyreturn -- parsing is finished, return the result. |
`-----------------------------------------------------*/
yyreturn:
if (!yyla.empty ())
yy_destroy_ ("Cleanup: discarding lookahead", yyla);