]> git.saurik.com Git - bison.git/blobdiff - data/bison.simple
* doc/bison.texinfo (Debugging): Split into...
[bison.git] / data / bison.simple
index a540cd0375d0e116292a29494fb6a9190e7aec9e..7a491feb8d9ae9b93b4fddd5163492cbea2abf43 100644 (file)
@@ -6,8 +6,7 @@ m4_divert(-1)                                                       -*- C -*-
 m4_define([b4_sint_type],
 [m4_if(m4_eval([$1 <= 127]),        [1], [signed char],
        m4_eval([$1 <= 32767]),      [1], [signed short],
-       m4_eval([$1 <= 2147483647]), [1], [signed int],
-       [m4_fatal([no signed int type for $1])])])
+       [signed int])])
 
 
 # b4_uint_type(MAX)
@@ -16,8 +15,7 @@ m4_define([b4_sint_type],
 m4_define([b4_uint_type],
 [m4_if(m4_eval([$1 <= 255]),        [1], [unsigned char],
        m4_eval([$1 <= 65535]),      [1], [unsigned short],
-       m4_eval([$1 <= 4294967295]), [1], [unsigned int],
-       [m4_fatal([no unsigned int type for $1])])])
+       [unsigned int])])
 
 
 # b4_lhs_value([TYPE])
@@ -100,9 +98,9 @@ m4_map_sep([     b4_token_enum], [,
 ],
            [$@])
    };
-   /* POSIX requires `int' for tokens in interfaces.  */
-#  define YYTOKENTYPE int
 # endif
+  /* POSIX requires `int' for tokens in interfaces.  */
+# define YYTOKENTYPE int
 #endif /* !YYTOKENTYPE */
 m4_map([b4_token_define], [$@])
 ])
@@ -334,12 +332,11 @@ b4_token_defines(b4_tokens)
 #define YYUNDEFTOK  b4_undef_token_number
 #define YYMAXUTOK   b4_user_token_number_max
 
-typedef b4_uint_type(b4_token_number_max) yy_token_number_type;
 #define YYTRANSLATE(X) \
   ((unsigned)(X) <= YYMAXUTOK ? yytranslate[[X]] : YYUNDEFTOK)
 
 /* YYTRANSLATE[[YYLEX]] -- Bison symbol number corresponding to YYLEX.  */
-static const yy_token_number_type yytranslate[[]] =
+static const b4_uint_type(b4_translate_max) yytranslate[[]] =
 {
   b4_translate
 };
@@ -347,20 +344,19 @@ static const yy_token_number_type yytranslate[[]] =
 #if YYDEBUG
 /* YYPRHS[[YYN]] -- Index of the first RHS symbol of rule number YYN in
    YYRHS.  */
-static const short yyprhs[[]] =
+static const b4_uint_type(b4_prhs_max) yyprhs[[]] =
 {
   b4_prhs
 };
 
 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
-typedef b4_sint_type(b4_rhs_number_max) yyrhs_t;
-static const yyrhs_t yyrhs[[]] =
+static const b4_sint_type(b4_rhs_max) yyrhs[[]] =
 {
   b4_rhs
 };
 
 /* YYRLINE[[YYN]] -- source line where rule number YYN was defined.  */
-static const short yyrline[[]] =
+static const b4_uint_type(b4_rline_max) yyrline[[]] =
 {
   b4_rline
 };
@@ -382,13 +378,13 @@ static const short yytoknum[[]] =
 };
 
 /* YYR1[[YYN]] -- Symbol number of symbol that rule YYN derives.  */
-static const yy_token_number_type yyr1[[]] =
+static const b4_uint_type(b4_r1_max) yyr1[[]] =
 {
   b4_r1
 };
 
 /* YYR2[[YYN]] -- Number of symbols composing right hand side of rule YYN.  */
-static const short yyr2[[]] =
+static const b4_uint_type(b4_r2_max) yyr2[[]] =
 {
   b4_r2
 };
@@ -1124,71 +1120,40 @@ yyerrlab1:
 
   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
-
+  for (;;)
+    {
+      yyn = yypact[yystate];
+      if (yyn != YYFLAG)
+       {
+         yyn += YYTERROR;
+         if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
+           {
+             yyn = yytable[yyn];
+             if (0 < yyn)
+               break;
+           }
+       }
 
-/*---------------------------------------------------------------.
-| yyerrpop -- pop the current state because it cannot handle the |
-| error token.                                                   |
-`---------------------------------------------------------------*/
-yyerrpop:
-  if (yyssp == yyss)
-    YYABORT;
-  yyvsp--;
-  yystate = *--yyssp;
+      /* Pop the current state because it cannot handle the error token.  */
+      if (yyssp == yyss)
+       YYABORT;
+      yyvsp--;
+      yystate = *--yyssp;
 #if YYLSP_NEEDED
-  yylsp--;
+      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");
-    }
+      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;