]> git.saurik.com Git - bison.git/commitdiff
Clean up %skeleton and %language priority implementation.
authorJoel E. Denny <jdenny@ces.clemson.edu>
Fri, 7 Nov 2008 21:48:31 +0000 (16:48 -0500)
committerJoel E. Denny <jdenny@ces.clemson.edu>
Fri, 7 Nov 2008 21:48:31 +0000 (16:48 -0500)
* src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
remove static qualifier because others will soon need to see it.
(language_prio): Likewise.
(getargs): Use command_line_prio rather than 0.
* src/getargs.h (command_line_prio, grammar_prio, default_prio): New
enum fields.
(skeleton_prio): Extern it.
(language_prio): Extern it.
* src/parse-gram.y: Use grammar_prio rather than 1.

ChangeLog
src/getargs.c
src/getargs.h
src/parse-gram.c
src/parse-gram.h
src/parse-gram.y

index 49c2d99da130b45bcf1256278e130d5e74f16a8a..4d3011f15bfbdd35c59a355041cbc30cfff9c3ec 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2008-11-07  Joel E. Denny  <jdenny@ces.clemson.edu>
+
+       Clean up %skeleton and %language priority implementation.
+       * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
+       remove static qualifier because others will soon need to see it.
+       (language_prio): Likewise.
+       (getargs): Use command_line_prio rather than 0.
+       * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
+       enum fields.
+       (skeleton_prio): Extern it.
+       (language_prio): Extern it.
+       * src/parse-gram.y: Use grammar_prio rather than 1.
+
 2008-11-04  Akim Demaille  <demaille@gostai.com>
 
        * NEWS: Mention the trailing semicolon in action.
index c9fc9bfc4f87f3a11a633bb0ca3103876f0bf21e..f36f25bc9ebbba2daafd84f63f699d196c2701f2 100644 (file)
@@ -70,9 +70,9 @@ static struct bison_language const valid_languages[] = {
   { "", "", "", "", false }
 };
 
-static int skeleton_prio = 2;
+int skeleton_prio = default_prio;
 const char *skeleton = NULL;
-static int language_prio = 2;
+int language_prio = default_prio;
 struct bison_language const *language = &valid_languages[0];
 const char *include = NULL;
 
@@ -520,11 +520,11 @@ getargs (int argc, char *argv[])
        break;
 
       case 'L':
-       language_argmatch (optarg, 0, NULL);
+       language_argmatch (optarg, command_line_prio, NULL);
        break;
 
       case 'S':
-       skeleton_arg (AS_FILE_NAME (optarg), 0, NULL);
+       skeleton_arg (AS_FILE_NAME (optarg), command_line_prio, NULL);
        break;
 
       case 'T':
index 8449626b21785795245fbf70ca0c45b99e663b8b..eb7f448e2f0b56c1000076a9cf12fe8cf196c262 100644 (file)
@@ -1,7 +1,7 @@
 /* Parse command line arguments for bison.
 
    Copyright (C) 1984, 1986, 1989, 1992, 2000, 2001, 2002, 2003, 2004,
-   2005, 2006, 2007 Free Software Foundation, Inc.
+   2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
 
 #include "location.h"
 
 extern char *program_name;
+enum { command_line_prio, grammar_prio, default_prio };
 
 /* flags set by % directives */
 
 /* for -S */
 extern char const *skeleton;
+extern int skeleton_prio;
 
 /* for -I */
 extern char const *include;
@@ -68,6 +70,7 @@ struct bison_language
   bool add_tab;
 };
 
+extern int language_prio;
 extern struct bison_language const *language;
 
 /*-----------.
index 56eba09b2b85bd03cbbfc2b441f6f17f0672fced..b7938dcd98a0a1cfeb58f84c8923da933847fd3d 100644 (file)
@@ -1,5 +1,5 @@
 
-/* A Bison parser, made by GNU Bison 2.3b.21-d67c5-dirty.  */
+/* A Bison parser, made by GNU Bison 2.4.4-738cd.  */
 
 /* Skeleton implementation for Bison's Yacc-like parsers in C
    
@@ -46,7 +46,7 @@
 #define YYBISON 1
 
 /* Bison version.  */
-#define YYBISON_VERSION "2.3b.21-d67c5-dirty"
+#define YYBISON_VERSION "2.4.4-738cd"
 
 /* Skeleton name.  */
 #define YYSKELETON_NAME "yacc.c"
@@ -1994,7 +1994,7 @@ yyreduce:
 
 /* Line 1455 of yacc.c  */
 #line 257 "parse-gram.y"
-    { language_argmatch ((yyvsp[(2) - (2)].chars), 1, &(yylsp[(1) - (2)])); }
+    { language_argmatch ((yyvsp[(2) - (2)].chars), grammar_prio, &(yylsp[(1) - (2)])); }
     break;
 
   case 19:
@@ -2110,7 +2110,7 @@ yyreduce:
           skeleton_user = uniqstr_new (skeleton_build);
           free (skeleton_build);
         }
-      skeleton_arg (skeleton_user, 1, &(yylsp[(1) - (2)]));
+      skeleton_arg (skeleton_user, grammar_prio, &(yylsp[(1) - (2)]));
     }
     break;
 
index 78b2a4f10a1e643232dd1fbb03731b5488af93e6..938b2017f6e1d6a6dbdc8bbfde36f5f30959e6b7 100644 (file)
@@ -1,5 +1,5 @@
 
-/* A Bison parser, made by GNU Bison 2.3b.21-d67c5-dirty.  */
+/* A Bison parser, made by GNU Bison 2.4.4-738cd.  */
 
 /* Skeleton interface for Bison's Yacc-like parsers in C
    
index fa74d8d858a2d01f9abe13fee902154dbf95339b..a8526b24ed0badb03ba9f621397447dd00cb6d1b 100644 (file)
@@ -254,7 +254,7 @@ prologue_declaration:
       muscle_code_grow ("initial_action", action.code, @2);
       code_scanner_last_string_free ();
     }
-| "%language" STRING           { language_argmatch ($2, 1, &@1); }
+| "%language" STRING           { language_argmatch ($2, grammar_prio, &@1); }
 | "%lex-param" "{...}"         { add_param ("lex_param", $2, @2); }
 | "%locations"                  { locations_flag = true; }
 | "%name-prefix" STRING         { spec_name_prefix = $2; }
@@ -300,7 +300,7 @@ prologue_declaration:
           skeleton_user = uniqstr_new (skeleton_build);
           free (skeleton_build);
         }
-      skeleton_arg (skeleton_user, 1, &@1);
+      skeleton_arg (skeleton_user, grammar_prio, &@1);
     }
 | "%token-table"                { token_table_flag = true; }
 | "%verbose"                    { report_flag |= report_states; }