From f6bd542788a4a6aa90d5ca5a53259b1de414df3a Mon Sep 17 00:00:00 2001 From: Marc Autret Date: Mon, 26 Nov 2001 21:06:22 +0000 Subject: [PATCH] * 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. --- ChangeLog | 11 +++++++++++ src/getargs.c | 5 +++++ src/getargs.h | 7 ++++--- src/lex.h | 1 + src/options.c | 1 + src/reader.c | 14 ++++++++++++++ 6 files changed, 36 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index d227611f..62e3bacb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2001-11-26 Marc Autret + + * 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 * src/reader.c (readgram): Make sure rules for mid-rule actions diff --git a/src/getargs.c b/src/getargs.c index 76e3823f..eee6314f 100644 --- a/src/getargs.c +++ b/src/getargs.c @@ -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; diff --git a/src/getargs.h b/src/getargs.h index 4ff100bb..5eef6404 100644 --- a/src/getargs.h +++ b/src/getargs.h @@ -22,9 +22,10 @@ # 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 */ diff --git a/src/lex.h b/src/lex.h index 16ac115a..34954148 100644 --- 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, diff --git a/src/options.c b/src/options.c index f1240766..a3db8968 100644 --- a/src/options.c +++ b/src/options.c @@ -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} diff --git a/src/reader.c b/src/reader.c index 73e79704..ac160aed 100644 --- a/src/reader.c +++ b/src/reader.c @@ -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; -- 2.45.2