/[bison]/bison/data/yacc.c
ViewVC logotype

Diff of /bison/data/yacc.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.46 by eggert, Thu Dec 26 08:27:09 2002 UTC revision 1.47 by eggert, Sat Dec 28 08:36:02 2002 UTC
# Line 54  m4_ifset([b4_parse_param], [b4_c_args(b4 Line 54  m4_ifset([b4_parse_param], [b4_c_args(b4
54    
55  # b4_lex_param  # b4_lex_param
56  # ------------  # ------------
57  # Accumule in b4_lex_param all the yylex arguments.  # Accumulate in b4_lex_param all the yylex arguments.
58  # b4_lex_param arrives quoted twice, but we want to keep only one level.  # b4_lex_param arrives quoted twice, but we want to keep only one level.
59  m4_define([b4_lex_param],  m4_define([b4_lex_param],
60  m4_dquote(b4_pure_if([[[[YYSTYPE *]], [[&yylval]]][]dnl  m4_dquote(b4_pure_if([[[[YYSTYPE *]], [[&yylval]]][]dnl
# Line 767  b4_c_function_def([yyparse], [int], b4_p Line 767  b4_c_function_def([yyparse], [int], b4_p
767  [[  /* The location stack.  */  [[  /* The location stack.  */
768    YYLTYPE yylsa[YYINITDEPTH];    YYLTYPE yylsa[YYINITDEPTH];
769    YYLTYPE *yyls = yylsa;    YYLTYPE *yyls = yylsa;
770    YYLTYPE *yylsp;]])[    YYLTYPE *yylsp;
771      YYLTYPE *yylerrsp;]])[
772    
773  #define YYPOPSTACK   (yyvsp--, yyssp--]b4_location_if([, yylsp--])[)  #define YYPOPSTACK   (yyvsp--, yyssp--]b4_location_if([, yylsp--])[)
774    
# Line 1072  yyerrlab: Line 1073  yyerrlab:
1073          yyerror (]b4_yyerror_args["syntax error");          yyerror (]b4_yyerror_args["syntax error");
1074      }      }
1075    
1076    ]b4_location_if([  yylerrsp = yylsp;])[
1077    
1078    if (yyerrstatus == 3)    if (yyerrstatus == 3)
1079      {      {
1080        /* If just tried and failed to reuse lookahead token after an        /* If just tried and failed to reuse lookahead token after an
# Line 1095  yyerrlab: Line 1098  yyerrlab:
1098        YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);        YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
1099        yydestruct (yytoken, &yylval]b4_location_if([, &yylloc])[);        yydestruct (yytoken, &yylval]b4_location_if([, &yylloc])[);
1100        yychar = YYEMPTY;        yychar = YYEMPTY;
1101    ]b4_location_if([      *++yylerrsp = yylloc;])[
1102      }      }
1103    
1104    /* Else will try to reuse lookahead token after shifting the error    /* Else will try to reuse lookahead token after shifting the error
1105       token.  */       token.  */
1106    goto yyerrlab1;    goto yyerrlab2;
1107    
1108    
1109  /*----------------------------------------------------.  /*----------------------------------------------------.
1110  | yyerrlab1 -- error raised explicitly by an action.  |  | yyerrlab1 -- error raised explicitly by an action.  |
1111  `----------------------------------------------------*/  `----------------------------------------------------*/
1112  yyerrlab1:  yyerrlab1:
1113    
1114      /* Suppress GCC warning that yyerrlab1 is unused when no action
1115         invokes YYERROR.  */
1116    #if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__)
1117      __attribute__ ((__unused__))
1118    #endif
1119    
1120    ]b4_location_if([  yylerrsp = yylsp;
1121      *++yylerrsp = yyloc;])[
1122      goto yyerrlab2;
1123    
1124    
1125    /*---------------------------------------------------------------.
1126    | yyerrlab2 -- pop states until the error token can be shifted.  |
1127    `---------------------------------------------------------------*/
1128    yyerrlab2:
1129    yyerrstatus = 3;      /* Each real token shifted decrements this.  */    yyerrstatus = 3;      /* Each real token shifted decrements this.  */
1130    
1131    for (;;)    for (;;)
# Line 1140  yyerrlab1: Line 1160  yyerrlab1:
1160    YYDPRINTF ((stderr, "Shifting error token, "));    YYDPRINTF ((stderr, "Shifting error token, "));
1161    
1162    *++yyvsp = yylval;    *++yyvsp = yylval;
1163  ]b4_location_if([  *++yylsp = yylloc;])[  ]b4_location_if([  YYLLOC_DEFAULT (yyloc, yylsp, (yylerrsp - yylsp));
1164      *++yylsp = yyloc;])[
1165    
1166    yystate = yyn;    yystate = yyn;
1167    goto yynewstate;    goto yynewstate;

Legend:
Removed from v.1.46  
changed lines
  Added in v.1.47

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26