]> git.saurik.com Git - bison.git/commitdiff
* src/reader.c (parse_include_decl): New, Not yet implemented.
authorMarc Autret <autret_m@epita.fr>
Mon, 26 Nov 2001 21:06:22 +0000 (21:06 +0000)
committerMarc Autret <autret_m@epita.fr>
Mon, 26 Nov 2001 21:06:22 +0000 (21:06 +0000)
(read_declarations): Add case tok_include.
* src/getargs.h (include): Add its extern definition.
* src/getargs.c (include): New const char *.
(getargs): Add case '-I'.
* src/options.c (option_table): Add include as command line and
percent option.
* src/lex.h (token_t): Add tok_include.

ChangeLog
src/getargs.c
src/getargs.h
src/lex.h
src/options.c
src/reader.c

index d227611fc47c488b09ab7738e19f0387f52ef315..62e3bacbdf43e91837de94ef28762b3d460aef38 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2001-11-26  Marc Autret  <autret_m@epita.fr>
+
+       * src/reader.c (parse_include_decl): New, Not yet implemented.
+       (read_declarations): Add case tok_include.
+       * src/getargs.h (include): Add its extern definition.
+       * src/getargs.c (include): New const char *.
+       (getargs): Add case '-I'.
+       * src/options.c (option_table): Add include as command line and
+       percent option.
+       * src/lex.h (token_t): Add tok_include.
+
 2001-11-26  Akim Demaille  <akim@epita.fr>
 
        * src/reader.c (readgram): Make sure rules for mid-rule actions
index 76e3823f21ae0098d2020bfe61bdc44e45e9ac3c..eee6314f0aff610a62e5c0d57441b487503624b6 100644 (file)
@@ -39,6 +39,7 @@ int graph_flag = 0;
 int trace_flag = 0;
 
 const char *skeleton = NULL;
+const char *include = NULL;
 
 extern char *program_name;
 
@@ -168,6 +169,10 @@ getargs (int argc, char *argv[])
        skeleton = optarg;
        break;
 
+      case 'I':
+       include = optarg;
+       break;
+
       case 'd':
        /* Here, the -d and --defines options are differentiated.  */
        defines_flag = 1;
index 4ff100bb6bd5b7883e68a9d6d26076e54fa4d206..5eef6404e30dd9b4d7967b4394a66d2d13aeedcc 100644 (file)
 # define GETARGS_H_
 
 /* flags set by % directives */
-extern char *spec_file_prefix; /* for -b */
-extern char *spec_name_prefix;         /* for -p */
-extern const char *skeleton;
+extern char *spec_file_prefix;         /* for -b */
+extern char *spec_name_prefix;         /* for -p */
+extern const char *skeleton;           /* for -S */
+extern const char *include;            /* for -I */
 
 extern int debug_flag;                 /* for -t */
 extern int defines_flag;       /* for -d */
index 16ac115a56ee3bec65a4efee131adcbc57689144..34954148677424c71e42dd2dc274454289a641dd 100644 (file)
--- a/src/lex.h
+++ b/src/lex.h
@@ -50,6 +50,7 @@ typedef enum token_e
     tok_thong,
     tok_define,
     tok_skel,
+    tok_include,
     tok_noop,
     tok_intopt,
     tok_stropt,
index f1240766ce89d56cdef0445569ddae8184ef5e41..a3db8968d2cee760a2dd8d2bce93391e18a99203 100644 (file)
@@ -116,6 +116,7 @@ const struct option_table_struct option_table[] =
   {opt_both, "no-parser",      no_argument, &no_parser_flag, tok_intopt,          'n'},
   {opt_both, "raw",           no_argument,               0, tok_obsolete, 'r'},
   {opt_both, "skeleton",       required_argument,         0, tok_skel,    'S'},
+  {opt_both, "include",               required_argument,         0, tok_include,  'I'},
   {opt_both, "token-table",    no_argument, &token_table_flag, tok_intopt,   'k'},
 
   {0, 0, 0, 0, 0, 0}
index 73e79704a6024fcacda7a22a7c928d1550c3b6cd..ac160aed449b93d59814299a2e1eee7a009374f2 100644 (file)
@@ -974,6 +974,16 @@ parse_skel_decl (void)
   /* Complete with parse_dquoted_param () on the CVS branch 1.29.  */
 }
 
+/*---------------------------------------.
+| Parse what comes after %skeleton_path. |
+`---------------------------------------*/
+
+void
+parse_include_decl (void)
+{
+  /* Complete with parse_dquoted_param () on the CVS branch 1.29.  */
+}
+
 /*----------------------------------------------------------------.
 | Read from finput until `%%' is seen.  Discard the `%%'.  Handle |
 | any `%' declarations, and copy the contents of any `%{ ... %}'  |
@@ -1048,6 +1058,10 @@ read_declarations (void)
              parse_skel_decl ();
              break;
 
+           case tok_include:
+             parse_include_decl ();
+             break;
+             
            case tok_noop:
              break;