* c-common.h (yyparse, c_common_parse_file): New.
* c-lang.c: Include c-common.h.
(LANG_HOOKS_PARSE_FILE): Redefine.
* c-lex.c: Include c-common.h.
(yyparse): Rename c_common_parse_file. Call yyparse.
* c-parse.in (yyparse): Remove macro.
* c-tree.h (yyparse_1): Remove.
* langhooks-def.h (LANG_HOOKS_PARSE_FILE): New.
(LANG_HOOKS_INITIALIZER): Update.
* langhooks.h (struct lang_hoooks): New hook parse_file.
* toplev.c (compile_file): Use parse_file hook.
* tree.h (yyparse): Remove.
ada:
* misc.c (LANG_HOOKS_PARSE_FILE): Redefine.
(yyparse): Rename gnat_parse_file.
cp:
* cp-lang.c (LANG_HOOKS_PARSE_FILE): Redefine.
* parse.y (yyparse): Remove macro.
f:
* com.c (LANG_HOOKS_PARSE_FILE): Redefine.
* com.h (ffe_parse_file): New.
* parse.c (NAME_OF_STDIN): Remove.
(yyparse): Rename ffe_parse_file.
java:
* java-tree.h (java_parse_file): New.
* jcf-parse.c (yyparse): Rename java_parse_file.
* lang.c (LANG_HOOKS_PARSE_FILE): Redefine.
objc:
* objc-lang.c (LANG_HOOKS_PARSE_FILE): Redefine.
From-SVN: r50926
+2002-03-17 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * c-common.h (yyparse, c_common_parse_file): New.
+ * c-lang.c: Include c-common.h.
+ (LANG_HOOKS_PARSE_FILE): Redefine.
+ * c-lex.c: Include c-common.h.
+ (yyparse): Rename c_common_parse_file. Call yyparse.
+ * c-parse.in (yyparse): Remove macro.
+ * c-tree.h (yyparse_1): Remove.
+ * langhooks-def.h (LANG_HOOKS_PARSE_FILE): New.
+ (LANG_HOOKS_INITIALIZER): Update.
+ * langhooks.h (struct lang_hoooks): New hook parse_file.
+ * toplev.c (compile_file): Use parse_file hook.
+ * tree.h (yyparse): Remove.
+objc:
+ * objc-lang.c (LANG_HOOKS_PARSE_FILE): Redefine.
+
2002-03-17 Hans-Peter Nilsson <hp@bitrange.com>
* config/mmix/mmix.md ("truncdfsf2"): Correct operator is
+2002-03-17 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * misc.c (LANG_HOOKS_PARSE_FILE): Redefine.
+ (yyparse): Rename gnat_parse_file.
+
2002-03-14 Geoffrey Keating <geoffk@redhat.com>
Delete all lines containing "$Revision:".
static const char *gnat_printable_name PARAMS ((tree, int));
static tree gnat_eh_runtime_type PARAMS ((tree));
static int gnat_eh_type_covers PARAMS ((tree, tree));
+static void gnat_parse_file PARAMS ((void));
/* Structure giving our language-specific hooks. */
#define LANG_HOOKS_INIT_OPTIONS gnat_init_options
#undef LANG_HOOKS_DECODE_OPTION
#define LANG_HOOKS_DECODE_OPTION gnat_decode_option
+#undef LANG_HOOKS_PARSE_FILE
+#define LANG_HOOKS_PARSE_FILE gnat_parse_file
#undef LANG_HOOKS_HONOR_READONLY
#define LANG_HOOKS_HONOR_READONLY 1
#undef LANG_HOOKS_GET_ALIAS_SET
extern void adainit PARAMS((void));
extern void _ada_gnat1drv PARAMS((void));
-/* For most front-ends, this is the parser for the language. For us, we
- process the GNAT tree. */
+/* The parser for the language. For us, we process the GNAT tree. */
-int
-yyparse ()
+static void
+gnat_parse_file ()
{
/* call the target specific initializations */
__gnat_initialize();
/* Call the front end */
_ada_gnat1drv ();
-
- return 0;
}
/* Decode all the language specific options that cannot be decoded by GCC.
noreturn attribute. */
extern int (*lang_missing_noreturn_ok_p) PARAMS ((tree));
-
+extern int yyparse PARAMS ((void));
extern stmt_tree current_stmt_tree PARAMS ((void));
extern tree *current_scope_stmt_stack PARAMS ((void));
extern void begin_stmt_tree PARAMS ((tree *));
extern void c_common_post_options PARAMS ((void));
extern const char *c_common_init PARAMS ((const char *));
extern void c_common_finish PARAMS ((void));
+extern void c_common_parse_file PARAMS ((void));
extern HOST_WIDE_INT c_common_get_alias_set PARAMS ((tree));
extern bool c_promoting_integer_type_p PARAMS ((tree));
extern int self_promoting_args_p PARAMS ((tree));
#include "system.h"
#include "tree.h"
#include "c-tree.h"
+#include "c-common.h"
#include "langhooks.h"
#include "langhooks-def.h"
#define LANG_HOOKS_GET_ALIAS_SET c_common_get_alias_set
#undef LANG_HOOKS_SAFE_FROM_P
#define LANG_HOOKS_SAFE_FROM_P c_safe_from_p
+#undef LANG_HOOKS_PARSE_FILE
+#define LANG_HOOKS_PARSE_FILE c_common_parse_file
#undef LANG_HOOKS_STATICP
#define LANG_HOOKS_STATICP c_staticp
#undef LANG_HOOKS_PRINT_IDENTIFIER
#include "output.h"
#include "c-lex.h"
#include "c-tree.h"
+#include "c-common.h"
#include "flags.h"
#include "timevar.h"
#include "cpplib.h"
Also, make sure the start_source_file debug hook gets called for
the primary source file. */
-int
-yyparse()
+void
+c_common_parse_file ()
{
(*debug_hooks->start_source_file) (lineno, input_filename);
cpp_finish_options (parse_in);
- return yyparse_1();
+ yyparse ();
}
struct c_fileinfo *
/* Cause the "yydebug" variable to be defined. */
#define YYDEBUG 1
-
-/* Rename the "yyparse" function so that we can override it elsewhere. */
-#define yyparse yyparse_1
%}
%start program
/* in c-parse.in */
extern void c_parse_init PARAMS ((void));
extern void c_set_yydebug PARAMS ((int));
-extern int yyparse_1 PARAMS ((void));
/* in c-aux-info.c */
extern void gen_aux_info_record PARAMS ((tree, int, int, int));
+2002-03-17 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * cp-lang.c (LANG_HOOKS_PARSE_FILE): Redefine.
+ * parse.y (yyparse): Remove macro.
+
2002-03-17 Jason Merrill <jason@redhat.com>
PR c++/5757
#define LANG_HOOKS_EXPAND_CONSTANT cplus_expand_constant
#undef LANG_HOOKS_SAFE_FROM_P
#define LANG_HOOKS_SAFE_FROM_P c_safe_from_p
+#undef LANG_HOOKS_PARSE_FILE
+#define LANG_HOOKS_PARSE_FILE c_common_parse_file
#undef LANG_HOOKS_DUP_LANG_SPECIFIC_DECL
#define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL cxx_dup_lang_specific_decl
#undef LANG_HOOKS_UNSAVE_EXPR_NOW
ggc_add_tree_root (¤t_enum_type, 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
+Sun Mar 17 20:57:30 2002 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * com.c (LANG_HOOKS_PARSE_FILE): Redefine.
+ * com.h (ffe_parse_file): New.
+ * parse.c (NAME_OF_STDIN): Remove.
+ (yyparse): Rename ffe_parse_file.
+
Tue Mar 12 20:23:18 2002 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* com.c (tree_code_type, tree_code_length, tree_code_name):
Returns 1 on success. If the DECLARATOR is not suitable for a function
(it defines a datum instead), we return 0, which tells
- yyparse to report a parse error.
+ ffe_parse_file to report a parse error.
NESTED is nonzero for a function nested within another function. */
#define LANG_HOOKS_INIT_OPTIONS ffe_init_options
#undef LANG_HOOKS_DECODE_OPTION
#define LANG_HOOKS_DECODE_OPTION ffe_decode_option
+#undef LANG_HOOKS_PARSE_FILE
+#define LANG_HOOKS_PARSE_FILE ffe_parse_file
#undef LANG_HOOKS_PRINT_IDENTIFIER
#define LANG_HOOKS_PRINT_IDENTIFIER ffe_print_identifier
tree ffecom_truth_value_invert (tree expr);
tree ffecom_type_expr (ffebld expr);
tree ffecom_which_entrypoint_decl (void);
+void ffe_parse_file ();
/* Define macros. */
#include "version.h"
#include "flags.h"
-#define NAME_OF_STDIN "<stdin>"
-
extern FILE *finput;
-int
-yyparse ()
+void
+ffe_parse_file ()
{
ffewhereFile wf;
ffe_file (wf, finput);
ffecom_finish_compile ();
-
- return 0;
}
+2002-03-17 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * java-tree.h (java_parse_file): New.
+ * jcf-parse.c (yyparse): Rename java_parse_file.
+ * lang.c (LANG_HOOKS_PARSE_FILE): Redefine.
+
2002-03-16 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
* parse.y (craft_constructor): Return the constructor decl.
#define JCF_u2 unsigned short
extern void java_set_yydebug PARAMS ((int));
+extern void java_parse_file PARAMS ((void));
extern void add_assume_compiled PARAMS ((const char *, int));
extern tree lookup_class PARAMS ((tree));
extern tree lookup_java_constructor PARAMS ((tree, tree));
return 0;
}
-int
-yyparse ()
+void
+java_parse_file ()
{
int filename_count = 0;
char *list, *next;
resource_filename = IDENTIFIER_POINTER (TREE_VALUE (current_file_list));
compile_resource_file (resource_name, resource_filename);
- return 0;
+ return;
}
current_jcf = main_jcf;
if (flag_indirect_dispatch)
emit_offset_symbol_table ();
}
- return 0;
}
/* Process all class entries found in the zip file. */
#define LANG_HOOKS_DECODE_OPTION java_decode_option
#undef LANG_HOOKS_SET_YYDEBUG
#define LANG_HOOKS_SET_YYDEBUG java_set_yydebug
+#undef LANG_HOOKS_PARSE_FILE
+#define LANG_HOOKS_PARSE_FILE java_parse_file
#undef LANG_HOOKS_DUP_LANG_SPECIFIC_DECL
#define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL java_dup_lang_specific_decl
#define LANG_HOOKS_IDENTIFIER_SIZE sizeof (struct lang_identifier)
#define LANG_HOOKS_INIT lhd_do_nothing
#define LANG_HOOKS_FINISH lhd_do_nothing
+#define LANG_HOOKS_PARSE_FILE lhd_do_nothing
#define LANG_HOOKS_CLEAR_BINDING_STACK lhd_clear_binding_stack
#define LANG_HOOKS_INIT_OPTIONS lhd_do_nothing
#define LANG_HOOKS_DECODE_OPTION lhd_decode_option
LANG_HOOKS_POST_OPTIONS, \
LANG_HOOKS_INIT, \
LANG_HOOKS_FINISH, \
+ LANG_HOOKS_PARSE_FILE, \
LANG_HOOKS_CLEAR_BINDING_STACK, \
LANG_HOOKS_GET_ALIAS_SET, \
LANG_HOOKS_EXPAND_CONSTANT, \
/* Called at the end of compilation, as a finalizer. */
void (*finish) PARAMS ((void));
+ /* Parses the entire file. */
+ void (*parse_file) PARAMS ((void));
+
/* Called immediately after parsing to clear the binding stack. */
void (*clear_binding_stack) PARAMS ((void));
#define LANG_HOOKS_DECODE_OPTION objc_decode_option
#undef LANG_HOOKS_POST_OPTIONS
#define LANG_HOOKS_POST_OPTIONS objc_post_options
+#undef LANG_HOOKS_PARSE_FILE
+#define LANG_HOOKS_PARSE_FILE c_common_parse_file
#undef LANG_HOOKS_STATICP
#define LANG_HOOKS_STATICP c_staticp
#undef LANG_HOOKS_DUP_LANG_SPECIFIC_DECL
timevar_push (TV_PARSE);
- /* Call the parser, which parses the entire file
- (calling rest_of_compilation for each function). */
- yyparse ();
+ /* Call the parser, which parses the entire file (calling
+ rest_of_compilation for each function). */
+ (*lang_hooks.parse_file) ();
/* In case there were missing block closers,
get us back to the global binding level. */
/* Compilation is now finished except for writing
what's left of the symbol table output. */
-
timevar_pop (TV_PARSE);
if (flag_syntax_only)
timevar_pop (TV_SYMOUT);
}
-/* This is called from finish_function (within yyparse)
+/* This is called from finish_function (within langhooks.parse_file)
after each top-level definition is parsed.
It is supposed to compile that function or variable
and output the assembler code for it.
\f
/* The language front-end must define these functions. */
-/* Function called with no arguments to parse and compile the input. */
-extern int yyparse PARAMS ((void));
/* Functions for processing symbol declarations. */
/* Function to enter a new lexical scope.
Takes one argument: always zero when called from outside the front end. */