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

Diff of /bison/data/glr.c

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

revision 1.28 by akim, Wed Nov 6 14:11:47 2002 UTC revision 1.29 by akim, Thu Nov 7 12:52:19 2002 UTC
# Line 54  m4_define([b4_user_formals], Line 54  m4_define([b4_user_formals],
54  [m4_ifset([b4_parse_param], [, b4_c_ansi_formals(b4_parse_param)])])  [m4_ifset([b4_parse_param], [, b4_c_ansi_formals(b4_parse_param)])])
55    
56    
57    # b4_yyerror_args
58    # ---------------
59    # Arguments passed to yyerror: user args plus yylloc.
60    m4_define([b4_yyerror_args],
61    [b4_pure_if([b4_location_if([yylocp, ])])dnl
62    m4_ifset([b4_parse_param], [b4_c_args(b4_parse_param), ])])
63    
64    
65    # b4_lyyerror_args
66    # ----------------
67    # Same as above, but on the lookahead, hence yyllocp instead of yylocp.
68    m4_define([b4_lyyerror_args],
69    [b4_pure_if([b4_location_if([yyllocp, ])])dnl
70    m4_ifset([b4_parse_param], [b4_c_args(b4_parse_param), ])])
71    
72    
73  # b4_pure_args  # b4_pure_args
74  # ------------  # ------------
75  # Arguments passed to yyerror: user args plus yylloc.  # Arguments needed by yyerror: user args plus yylloc.
76  m4_define([b4_pure_args],  m4_define([b4_pure_args],
77  [b4_pure_if([b4_location_if([, yylocp])])[]b4_user_args])  [b4_pure_if([b4_location_if([, yylocp])])[]b4_user_args])
78    
# Line 581  yyFail (yyGLRStack* yystack]b4_pure_form Line 597  yyFail (yyGLRStack* yystack]b4_pure_form
597        va_start (yyap, yyformat);        va_start (yyap, yyformat);
598        yystack->yyerrflag = 1;        yystack->yyerrflag = 1;
599        vsprintf (yymsg, yyformat, yyap);        vsprintf (yymsg, yyformat, yyap);
600        yyerror (yymsg]b4_pure_args[);        yyerror (]b4_yyerror_args[yymsg);
601      }      }
602    longjmp (yystack->yyexception_buffer, 1);    longjmp (yystack->yyexception_buffer, 1);
603  }  }
# Line 636  yyuserAction (yyRuleNum yyn, int yyrhsle Line 652  yyuserAction (yyRuleNum yyn, int yyrhsle
652  # undef YYBACKUP  # undef YYBACKUP
653  # define YYBACKUP(Token, Value)                                              \  # define YYBACKUP(Token, Value)                                              \
654    do {                                                                       \    do {                                                                       \
655      yyerror ("syntax error: cannot back up"]b4_pure_args[);                  \      yyerror (]b4_yyerror_args["syntax error: cannot back up");               \
656      YYERROR;                                                                 \      YYERROR;                                                                 \
657    } while (0)    } while (0)
658    
# Line 1591  yyreportParseError (yyGLRStack* yystack, Line 1607  yyreportParseError (yyGLRStack* yystack,
1607                      yyprefix = " or ";                      yyprefix = " or ";
1608                    }                    }
1609              }              }
1610            yyerror (yymsg]b4_lpure_args[);            yyerror (]b4_lyyerror_args[yymsg);
1611            free (yymsg);            free (yymsg);
1612          }          }
1613        else        else
1614  #endif  #endif
1615          yyerror ("parse error"]b4_lpure_args[);          yyerror (]b4_lyyerror_args["parse error");
1616        yynerrs += 1;        yynerrs += 1;
1617      }      }
1618  }  }

Legend:
Removed from v.1.28  
changed lines
  Added in v.1.29

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