+Thu Apr 9 00:18:44 1998 Dave Brolley (brolley@cygnus.com)
+
+ * lex.c (finput): New variable.
+ (init_cpp_parse): Renamed from init_parse.
+ (init_parse): Handle !USE_CPPLIB. Call init_cpp_parse when finished.
+ (finish_parse): New function.
+ * cp-tree.h (init_lex, init_parse): Remove declarations.
+
Mon Apr 6 02:25:05 1998 Jason Merrill <jason@yorick.cygnus.com>
* call.c (build_call): Still evaluate the actual argument.
#if 0
extern void reinit_lang_specific PROTO((void));
#endif
-extern void init_lex PROTO((void));
extern void reinit_parse_for_function PROTO((void));
-extern int *init_parse PROTO((void));
extern void print_parse_statistics PROTO((void));
extern void extract_interface_info PROTO((void));
extern void do_pending_inlines PROTO((void));
struct obstack inline_text_obstack;
char *inline_text_firstobj;
+#if !USE_CPPLIB
+FILE *finput;
+#endif
int end_of_file;
/* Pending language change.
/* Change by Bryan Boreham, Kewill, Thu Jul 27 09:46:05 1989.
Stuck this hack in to get the files open correctly; this is called
- in place of init_lex if we are an unexec'd binary. */
+ in place of init_parse if we are an unexec'd binary. */
#if 0
void
}
#endif
+static int *
+init_cpp_parse ()
+{
+#ifdef GATHER_STATISTICS
+#ifdef REDUCE_LENGTH
+ reduce_count = (int *)malloc (sizeof (int) * (REDUCE_LENGTH + 1));
+ bzero (reduce_count, sizeof (int) * (REDUCE_LENGTH + 1));
+ reduce_count += 1;
+ token_count = (int *)malloc (sizeof (int) * (TOKEN_LENGTH + 1));
+ bzero (token_count, sizeof (int) * (TOKEN_LENGTH + 1));
+ token_count += 1;
+#endif
+#endif
+ return token_count;
+}
+
void
-init_lex ()
+init_parse (filename)
+ char *filename;
{
extern int flag_no_gnu_keywords;
extern int flag_operator_names;
int i;
+#if !USE_CPPLIB
+ /* Open input file. */
+ if (filename == 0 || !strcmp (filename, "-"))
+ {
+ finput = stdin;
+ filename = "stdin";
+ }
+ else
+ finput = fopen (filename, "r");
+ if (finput == 0)
+ pfatal_with_name (filename);
+
+#ifdef IO_BUFFER_SIZE
+ setvbuf (finput, (char *) xmalloc (IO_BUFFER_SIZE), _IOFBF, IO_BUFFER_SIZE);
+#endif
+#endif /* !USE_CPPLIB */
+
/* Initialize the lookahead machinery. */
init_spew ();
UNSET_RESERVED_WORD ("xor_eq");
}
- token_count = init_parse ();
+ token_count = init_cpp_parse ();
interface_unknown = 1;
}
void
+finish_parse ()
+{
+#if USE_CPPLIB
+ cpp_finish (&parse_in);
+#else
+ fclose (finput);
+#endif
+}
+
+void
reinit_parse_for_function ()
{
current_base_init_list = NULL_TREE;
#define TOKEN_LENGTH (256 + sizeof (yytname) / sizeof (yytname[0]))
#endif
-int *
-init_parse ()
-{
-#ifdef GATHER_STATISTICS
-#ifdef REDUCE_LENGTH
- reduce_count = (int *)malloc (sizeof (int) * (REDUCE_LENGTH + 1));
- bzero (reduce_count, sizeof (int) * (REDUCE_LENGTH + 1));
- reduce_count += 1;
- token_count = (int *)malloc (sizeof (int) * (TOKEN_LENGTH + 1));
- bzero (token_count, sizeof (int) * (TOKEN_LENGTH + 1));
- token_count += 1;
-#endif
-#endif
- return token_count;
-}
-
#ifdef GATHER_STATISTICS
#ifdef REDUCE_LENGTH
void