parse.y (yyparse_1): Rename the parser entry point.
* cp/parse.y (yyparse_1): Rename the parser entry point. * c-lex.c (orig_filename): New variable. (init_c_lex): Set it. Move call to cpp_start_read ... (yyparse): ... here. New function. * c-parse.in (yyparse_1): Rename the parser entry point. * c-tree.h: Declare it. From-SVN: r37607
This commit is contained in:
parent
66bc5940f1
commit
3aac38d70c
|
@ -1,3 +1,11 @@
|
||||||
|
2000-11-20 Richard Henderson <rth@redhat.com>
|
||||||
|
|
||||||
|
* c-lex.c (orig_filename): New variable.
|
||||||
|
(init_c_lex): Set it. Move call to cpp_start_read ...
|
||||||
|
(yyparse): ... here. New function.
|
||||||
|
* c-parse.in (yyparse_1): Rename the parser entry point.
|
||||||
|
* c-tree.h: Declare it.
|
||||||
|
|
||||||
2000-11-21 Jakub Jelinek <jakub@redhat.com>
|
2000-11-21 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
* expr.c (do_compare_and_jump): If op0 was replaced by promoted
|
* expr.c (do_compare_and_jump): If op0 was replaced by promoted
|
||||||
|
|
20
gcc/c-lex.c
20
gcc/c-lex.c
|
@ -60,6 +60,9 @@ extern cpp_reader parse_in;
|
||||||
FILE *finput;
|
FILE *finput;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* The original file name, before changing "-" to "stdin". */
|
||||||
|
static const char *orig_filename;
|
||||||
|
|
||||||
/* Private idea of the line number. See discussion in c_lex(). */
|
/* Private idea of the line number. See discussion in c_lex(). */
|
||||||
static int lex_lineno;
|
static int lex_lineno;
|
||||||
|
|
||||||
|
@ -170,6 +173,8 @@ init_c_lex (filename)
|
||||||
{
|
{
|
||||||
struct c_fileinfo *toplevel;
|
struct c_fileinfo *toplevel;
|
||||||
|
|
||||||
|
orig_filename = filename;
|
||||||
|
|
||||||
/* Set up filename timing. Must happen before cpp_start_read. */
|
/* Set up filename timing. Must happen before cpp_start_read. */
|
||||||
file_info_tree = splay_tree_new ((splay_tree_compare_fn)strcmp,
|
file_info_tree = splay_tree_new ((splay_tree_compare_fn)strcmp,
|
||||||
0,
|
0,
|
||||||
|
@ -214,9 +219,6 @@ init_c_lex (filename)
|
||||||
/* Make sure parse_in.digraphs matches flag_digraphs. */
|
/* Make sure parse_in.digraphs matches flag_digraphs. */
|
||||||
CPP_OPTION (&parse_in, digraphs) = flag_digraphs;
|
CPP_OPTION (&parse_in, digraphs) = flag_digraphs;
|
||||||
|
|
||||||
if (! cpp_start_read (&parse_in, filename))
|
|
||||||
exit (FATAL_EXIT_CODE); /* cpplib has emitted an error. */
|
|
||||||
|
|
||||||
if (filename == 0 || !strcmp (filename, "-"))
|
if (filename == 0 || !strcmp (filename, "-"))
|
||||||
filename = "stdin";
|
filename = "stdin";
|
||||||
#endif
|
#endif
|
||||||
|
@ -232,6 +234,18 @@ init_c_lex (filename)
|
||||||
return filename;
|
return filename;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* A thin wrapper around the real parser that initializes the
|
||||||
|
integrated preprocessor after debug output has been initialized. */
|
||||||
|
|
||||||
|
int
|
||||||
|
yyparse()
|
||||||
|
{
|
||||||
|
if (! cpp_start_read (&parse_in, orig_filename))
|
||||||
|
return 1; /* cpplib has emitted an error. */
|
||||||
|
|
||||||
|
return yyparse_1();
|
||||||
|
}
|
||||||
|
|
||||||
struct c_fileinfo *
|
struct c_fileinfo *
|
||||||
get_fileinfo (name)
|
get_fileinfo (name)
|
||||||
const char *name;
|
const char *name;
|
||||||
|
|
|
@ -72,8 +72,11 @@ end ifc
|
||||||
/* Like YYERROR but do call yyerror. */
|
/* Like YYERROR but do call yyerror. */
|
||||||
#define YYERROR1 { yyerror ("syntax error"); YYERROR; }
|
#define YYERROR1 { yyerror ("syntax error"); YYERROR; }
|
||||||
|
|
||||||
/* Cause the `yydebug' variable to be defined. */
|
/* Cause the "yydebug" variable to be defined. */
|
||||||
#define YYDEBUG 1
|
#define YYDEBUG 1
|
||||||
|
|
||||||
|
/* Rename the "yyparse" function so that we can override it elsewhere. */
|
||||||
|
#define yyparse yyparse_1
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%start program
|
%start program
|
||||||
|
|
|
@ -154,6 +154,7 @@ extern tree lookup_objc_ivar PARAMS ((tree));
|
||||||
|
|
||||||
/* in c-parse.in */
|
/* in c-parse.in */
|
||||||
extern void c_parse_init PARAMS ((void));
|
extern void c_parse_init PARAMS ((void));
|
||||||
|
extern int yyparse_1 PARAMS ((void));
|
||||||
|
|
||||||
/* in c-aux-info.c */
|
/* in c-aux-info.c */
|
||||||
extern void gen_aux_info_record PARAMS ((tree, int, int, int));
|
extern void gen_aux_info_record PARAMS ((tree, int, int, int));
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
2000-11-16 Alex Samuel <samuel@codesourcery.com>
|
2000-11-20 Richard Henderson <rth@redhat.com>
|
||||||
|
|
||||||
|
* parse.y (yyparse_1): Rename the parser entry point.
|
||||||
|
|
||||||
|
2000-11-20 Alex Samuel <samuel@codesourcery.com>
|
||||||
|
|
||||||
* mangle.c (write_name): Use <unscoped-name> for names directly in
|
* mangle.c (write_name): Use <unscoped-name> for names directly in
|
||||||
function scope.
|
function scope.
|
||||||
|
|
|
@ -214,6 +214,9 @@ cp_parse_init ()
|
||||||
ggc_add_tree_root (¤t_enum_type, 1);
|
ggc_add_tree_root (¤t_enum_type, 1);
|
||||||
ggc_add_tree_root (&saved_scopes, 1);
|
ggc_add_tree_root (&saved_scopes, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Rename the "yyparse" function so that we can override it elsewhere. */
|
||||||
|
#define yyparse yyparse_1
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%start program
|
%start program
|
||||||
|
|
Loading…
Reference in New Issue