Rename skeleton to skel_bison.c, include skel_bison.c in repository instead of requir...
authorNick Downing <downing.nick@gmail.com>
Fri, 10 Aug 2018 12:43:26 +0000 (22:43 +1000)
committerNick Downing <downing.nick@gmail.com>
Fri, 10 Aug 2018 12:43:26 +0000 (22:43 +1000)
.gitignore
bootstrap_pyacc.py
skel/Makefile
skel/skel_bison.c.patch [moved from skel/y.tab.c.patch with 95% similarity]
skel/skel_bison.h.patch [moved from skel/y.tab.h.patch with 70% similarity]
skel/skel_bison.y [moved from skel/skel.y with 100% similarity]

index 690c009..8fe40b2 100644 (file)
@@ -5,10 +5,8 @@ lex-yacc-examples/*.o
 lex-yacc-examples/*.xml
 lex-yacc-examples/example4
 lex-yacc-examples/example7
-skel/y.tab.c
-skel/y.tab.c.orig
-skel/y.tab.h
-skel/y.tab.h.orig
+skel/skel_bison.c.orig
+skel/skel_bison.h.orig
 tests/*.c
 tests/*.o
 tests/*.xml
index 4cefee0..031821e 100755 (executable)
@@ -20,7 +20,7 @@ except getopt.GetoptError as err:
 
 defines_file = None
 out_file = 'y.tab.c'
-skel_file = os.path.join(home_dir, 'skel/y.tab.c')
+skel_file = os.path.join(home_dir, 'skel/skel_bison.c')
 for opt, arg in opts:
   if opt == '-d':
     defines_file = 'y.tab.h'
index 2d79b50..8be9c44 100644 (file)
@@ -1,8 +1,8 @@
-y.tab.c: skel.y
-       ../../bootstrap_bison.git/src/bison -dy $<
+skel_bison.c: skel_bison.y
+       ../../bootstrap_bison.git/src/bison -d -o $@ $<
        grep -v "^#line " <$@ >$@.orig
        cp $@.orig $@
        patch $@ <$@.patch
-       grep -v "^#line " <y.tab.h >y.tab.h.orig
-       cp y.tab.h.orig y.tab.h
-       patch y.tab.h <y.tab.h.patch
+       grep -v "^#line " <skel_bison.h >skel_bison.h.orig
+       cp skel_bison.h.orig skel_bison.h
+       patch skel_bison.h <skel_bison.h.patch
similarity index 95%
rename from skel/y.tab.c.patch
rename to skel/skel_bison.c.patch
index 6556fed..acfb228 100644 (file)
@@ -1,5 +1,11 @@
---- y.tab.c.orig       2018-07-30 07:49:37.272876744 +1000
-+++ y.tab.c    2018-07-30 10:36:37.807262919 +1000
+--- skel_bison.c.orig  2018-08-10 22:39:30.144019481 +1000
++++ skel_bison.c       2018-08-10 22:39:51.740019802 +1000
+@@ -1,4 +1,4 @@
+-/* A Bison parser, made by GNU Bison 3.0.5.  */
++/* A Bison parser, made by pyacc.  */
+ /* Bison implementation for Yacc-like parsers in C
 @@ -50,7 +50,7 @@
  #define YYSKELETON_NAME "yacc.c"
  
@@ -25,7 +31,7 @@
  
  # ifndef YY_NULLPTR
  #  if defined __cplusplus && 201103L <= __cplusplus
-@@ -73,52 +77,40 @@
+@@ -73,50 +77,39 @@
  # endif
  
  /* Enabling verbose error messages.  */
@@ -38,9 +44,9 @@
 +/* GENERATE YYERROR_VERBOSE */
  
  /* In a future release of Bison, this section will be replaced
-    by #include "y.tab.h".  */
- #ifndef YY_YY_Y_TAB_H_INCLUDED
- # define YY_YY_Y_TAB_H_INCLUDED
+    by #include "skel_bison.h".  */
+ #ifndef YY_YY_SKEL_BISON_H_INCLUDED
+ # define YY_YY_SKEL_BISON_H_INCLUDED
  /* Debug traces.  */
 -#ifndef YYDEBUG
 -# define YYDEBUG 0
 +/* GENERATE TOKENSEQUAL */
    };
  #endif
- /* Tokens.  */
--#define TOKEN 258
--
--/* Value type.  */
--#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
 +/* GENERATE TOKENS */
  
+-/* Value type.  */
+-#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+-
 -union YYSTYPE
 -{
 - /* something */ 
-+/* GENERATE SECTION1REQUIRES */
+-
 -};
 -
 -typedef union YYSTYPE YYSTYPE;
 -# define YYSTYPE_IS_TRIVIAL 1
 -# define YYSTYPE_IS_DECLARED 1
 -#endif
++/* GENERATE SECTION1REQUIRES */
 +/* Value type.  */
 +/* GENERATE YYSTYPE */
++ 
 +/* Location type.  */
 +/* GENERATE YYLTYPE */
  
@@ -92,7 +97,7 @@
  
  int yyparse (void);
  
-@@ -126,6 +118,7 @@
+@@ -124,6 +117,7 @@
  
  /* Copy the second part of user declarations.  */
  
  
  #ifdef short
  # undef short
-@@ -306,13 +299,20 @@
+@@ -304,13 +298,20 @@
  
  #if (! defined yyoverflow \
       && (! defined __cplusplus \
  };
  
  /* The size of the maximum gap between one aligned stack and the next.  */
-@@ -320,9 +320,15 @@
+@@ -318,9 +319,15 @@
  
  /* The size of an array large to enough to hold all stacks, each with
     N elements.  */
  
  # define YYCOPY_NEEDED 1
  
-@@ -364,155 +370,7 @@
+@@ -362,155 +369,7 @@
  # endif
  #endif /* !YYCOPY_NEEDED */
  
 -  /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
 -static const yytype_uint8 yyrline[] =
 -{
--       0,     5,     5,     5
+-       0,     6,     6,     6
 -};
 -#endif
 -
  
  #define yyerrok         (yyerrstatus = 0)
  #define yyclearin       (yychar = YYEMPTY)
-@@ -526,7 +384,25 @@
+@@ -524,7 +383,25 @@
  
  #define YYRECOVERING()  (!!yyerrstatus)
  
  do                                                              \
    if (yychar == YYEMPTY)                                        \
      {                                                           \
-@@ -542,12 +418,39 @@
+@@ -540,12 +417,39 @@
        YYERROR;                                                  \
      }                                                           \
  while (0)
  
  /* Enable debugging if requested.  */
  #if YYDEBUG
-@@ -563,13 +466,64 @@
+@@ -561,13 +465,64 @@
      YYFPRINTF Args;                             \
  } while (0)
  
 -#endif
 +# if (defined YYLTYPE || defined YYLTYPE_IS_DECLARED) \
 +     && defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
++
 +/* Print *YYLOCP on YYO.  Private, do not rely on its existence. */
  
--# define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \
 +YY_ATTRIBUTE_UNUSED
 +static unsigned
 +yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
 +    }
 +  return res;
 + }
-+
+-# define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \
 +#  define YY_LOCATION_PRINT(File, Loc)          \
 +  yy_location_print_ (File, &(Loc))
 +
  do {                                                                      \
    if (yydebug)                                                            \
      {                                                                     \
-@@ -579,12 +533,29 @@
+@@ -577,12 +532,29 @@
        YYFPRINTF (stderr, "\n");                                           \
      }                                                                     \
  } while (0)
  static void
  yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
  {
-@@ -592,18 +563,32 @@
+@@ -590,18 +562,32 @@
    YYUSE (yyo);
    if (!yyvaluep)
      return;
  static void
  yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
  {
-@@ -613,6 +598,7 @@
+@@ -611,6 +597,7 @@
    yy_symbol_value_print (yyoutput, yytype, yyvaluep);
    YYFPRINTF (yyoutput, ")");
  }
  
  /*------------------------------------------------------------------.
  | yy_stack_print -- Print the state stack from its BOTTOM up to its |
-@@ -642,6 +628,33 @@
+@@ -640,6 +627,33 @@
  | Report that the YYRULE is going to be reduced.  |
  `------------------------------------------------*/
  
  static void
  yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
  {
-@@ -662,11 +675,12 @@
+@@ -660,11 +674,12 @@
      }
  }
  
  
  /* Nonzero means print parse trace.  It is left uninitialized so that
     multiple parsers can coexist.  */
-@@ -923,10 +937,12 @@
+@@ -921,10 +936,12 @@
  | Release the memory associated to this symbol.  |
  `-----------------------------------------------*/
  
    if (!yymsg)
      yymsg = "Deleting";
    YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
-@@ -935,18 +951,38 @@
+@@ -933,18 +950,38 @@
    YYUSE (yytype);
    YY_IGNORE_MAYBE_UNINITIALIZED_END
  }
  
  /*----------.
  | yyparse.  |
-@@ -955,6 +991,27 @@
+@@ -953,6 +990,27 @@
  int
  yyparse (void)
  {
      int yystate;
      /* Number of tokens to shift before error messages enabled.  */
      int yyerrstatus;
-@@ -962,6 +1019,7 @@
+@@ -960,6 +1018,7 @@
      /* The stacks and their tools:
         'yyss': related to states.
         'yyvs': related to semantic values.
  
         Refer to the stacks through separate pointers, to allow yyoverflow
         to reallocate them elsewhere.  */
-@@ -976,6 +1034,16 @@
+@@ -974,6 +1033,16 @@
      YYSTYPE *yyvs;
      YYSTYPE *yyvsp;
  
      YYSIZE_T yystacksize;
  
    int yyn;
-@@ -985,6 +1053,9 @@
+@@ -983,6 +1052,9 @@
    /* The variables used to return semantic value and location from the
       action routines.  */
    YYSTYPE yyval;
  
  #if YYERROR_VERBOSE
    /* Buffer for error messages, and its allocated size.  */
-@@ -993,7 +1064,11 @@
+@@ -991,7 +1063,11 @@
    YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
  #endif
  
  
    /* The number of symbols on the RHS of the reduced rule.
       Keep to zero when no symbol should be popped.  */
-@@ -1001,6 +1076,9 @@
+@@ -999,6 +1075,9 @@
  
    yyssp = yyss = yyssa;
    yyvsp = yyvs = yyvsa;
    yystacksize = YYINITDEPTH;
  
    YYDPRINTF ((stderr, "Starting parse\n"));
-@@ -1009,6 +1087,13 @@
+@@ -1007,6 +1086,13 @@
    yyerrstatus = 0;
    yynerrs = 0;
    yychar = YYEMPTY; /* Cause a token to be read.  */
    goto yysetstate;
  
  /*------------------------------------------------------------.
-@@ -1034,16 +1119,29 @@
+@@ -1032,16 +1118,29 @@
             memory.  */
          YYSTYPE *yyvs1 = yyvs;
          yytype_int16 *yyss1 = yyss;
          yyss = yyss1;
          yyvs = yyvs1;
        }
-@@ -1066,6 +1164,9 @@
+@@ -1064,6 +1163,9 @@
            goto yyexhaustedlab;
          YYSTACK_RELOCATE (yyss_alloc, yyss);
          YYSTACK_RELOCATE (yyvs_alloc, yyvs);
  #  undef YYSTACK_RELOCATE
          if (yyss1 != yyssa)
            YYSTACK_FREE (yyss1);
-@@ -1075,6 +1176,9 @@
+@@ -1073,6 +1175,9 @@
  
        yyssp = yyss + yysize - 1;
        yyvsp = yyvs + yysize - 1;
  
        YYDPRINTF ((stderr, "Stack size increased to %lu\n",
                    (unsigned long int) yystacksize));
-@@ -1109,7 +1213,15 @@
+@@ -1107,7 +1212,15 @@
    if (yychar == YYEMPTY)
      {
        YYDPRINTF ((stderr, "Reading a token: "));
      }
  
    if (yychar <= YYEOF)
-@@ -1152,7 +1264,9 @@
+@@ -1150,7 +1263,9 @@
    YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
    *++yyvsp = yylval;
    YY_IGNORE_MAYBE_UNINITIALIZED_END
    goto yynewstate;
  
  
-@@ -1183,18 +1297,14 @@
+@@ -1181,18 +1296,14 @@
       GCC warning that YYVAL may be used uninitialized.  */
    yyval = yyvsp[1-yylen];
  
  
        default: break;
      }
-@@ -1216,6 +1326,9 @@
+@@ -1214,6 +1325,9 @@
    YY_STACK_PRINT (yyss, yyssp);
  
    *++yyvsp = yyval;
  
    /* Now 'shift' the result of the reduction.  Determine what state
       that goes to, based on the state we popped back to and the rule
-@@ -1245,7 +1358,11 @@
+@@ -1243,7 +1357,11 @@
      {
        ++yynerrs;
  #if ! YYERROR_VERBOSE
  #else
  # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
                                          yyssp, yytoken)
-@@ -1272,7 +1389,11 @@
+@@ -1270,7 +1388,11 @@
                  yymsgp = yymsg;
                }
            }
          if (yysyntax_error_status == 2)
            goto yyexhaustedlab;
        }
-@@ -1280,7 +1401,9 @@
+@@ -1278,7 +1400,9 @@
  #endif
      }
  
  
    if (yyerrstatus == 3)
      {
-@@ -1295,8 +1418,13 @@
+@@ -1293,8 +1417,13 @@
          }
        else
          {
            yychar = YYEMPTY;
          }
      }
-@@ -1317,6 +1445,9 @@
+@@ -1315,6 +1444,9 @@
    if (/*CONSTCOND*/ 0)
       goto yyerrorlab;
  
    /* Do not reclaim the symbols of the rule whose action triggered
       this YYERROR.  */
    YYPOPSTACK (yylen);
-@@ -1350,9 +1481,14 @@
+@@ -1348,9 +1480,14 @@
        if (yyssp == yyss)
          YYABORT;
  
        YYPOPSTACK (1);
        yystate = *yyssp;
        YY_STACK_PRINT (yyss, yyssp);
-@@ -1362,6 +1498,13 @@
+@@ -1360,6 +1497,13 @@
    *++yyvsp = yylval;
    YY_IGNORE_MAYBE_UNINITIALIZED_END
  
  
    /* Shift the error token.  */
    YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
-@@ -1389,7 +1532,11 @@
+@@ -1387,7 +1531,11 @@
  | yyexhaustedlab -- memory exhaustion comes here.  |
  `-------------------------------------------------*/
  yyexhaustedlab:
    yyresult = 2;
    /* Fall through.  */
  #endif
-@@ -1400,8 +1547,13 @@
+@@ -1398,8 +1546,13 @@
        /* Make sure we have latest lookahead translation.  See comments at
           user semantic actions for why this is necessary.  */
        yytoken = YYTRANSLATE (yychar);
      }
    /* Do not reclaim the symbols of the rule whose action triggered
       this YYABORT or YYACCEPT.  */
-@@ -1409,8 +1561,13 @@
+@@ -1407,8 +1560,13 @@
    YY_STACK_PRINT (yyss, yyssp);
    while (yyssp != yyss)
      {
        YYPOPSTACK (1);
      }
  #ifndef yyoverflow
-@@ -1423,3 +1580,5 @@
+@@ -1421,3 +1579,5 @@
  #endif
    return yyresult;
  }
similarity index 70%
rename from skel/y.tab.h.patch
rename to skel/skel_bison.h.patch
index cdd20f1..da8e346 100644 (file)
@@ -1,8 +1,14 @@
---- y.tab.h.orig       2018-07-29 21:31:56.747898663 +1000
-+++ y.tab.h    2018-07-29 21:34:24.931902574 +1000
-@@ -33,40 +33,36 @@
- #ifndef YY_YY_Y_TAB_H_INCLUDED
- # define YY_YY_Y_TAB_H_INCLUDED
+--- skel_bison.h.orig  2018-08-10 22:39:30.160019481 +1000
++++ skel_bison.h       2018-08-10 22:40:03.852019982 +1000
+@@ -1,4 +1,4 @@
+-/* A Bison parser, made by GNU Bison 3.0.5.  */
++/* A Bison parser, made by pyacc.  */
+ /* Bison interface for Yacc-like parsers in C
+@@ -33,38 +33,36 @@
+ #ifndef YY_YY_SKEL_BISON_H_INCLUDED
+ # define YY_YY_SKEL_BISON_H_INCLUDED
  /* Debug traces.  */
 -#ifndef YYDEBUG
 -# define YYDEBUG 0
 +/* GENERATE TOKENSEQUAL */
    };
  #endif
- /* Tokens.  */
--#define TOKEN 258
--
--/* Value type.  */
--#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
++/* Tokens.  */
 +/* GENERATE TOKENS */
  
+-/* Value type.  */
+-#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+-
 -union YYSTYPE
 -{
 - /* something */ 
similarity index 100%
rename from skel/skel.y
rename to skel/skel_bison.y