OSDN Git Service

* config/alpha/vms.h (INCLUDE_DEFAULTS): Add /gnu/lib/gcc-lib/include.
[pf3gnuchains/gcc-fork.git] / gcc / ch / parse.c
index e3593df..f8e0e54 100644 (file)
@@ -1,5 +1,6 @@
 /* Parser for GNU CHILL (CCITT High-Level Language)  -*- C -*-
-   Copyright (C) 1992, 1993, 1998, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1992, 1993, 1998, 1999, 2000, 2001
+   Free Software Foundation, Inc.
 
 This file is part of GNU CC.
 
@@ -70,31 +71,30 @@ const char * const language_string = "GNU CHILL";
 /* Cause the `yydebug' variable to be defined.  */
 #define YYDEBUG 1
 
-extern struct rtx_def* gen_label_rtx         PROTO((void));
-extern void emit_jump                         PROTO((struct rtx_def *));
-extern struct rtx_def* emit_label             PROTO((struct rtx_def *));
+extern struct rtx_def* gen_label_rtx         PARAMS ((void));
+extern void emit_jump                         PARAMS ((struct rtx_def *));
+extern struct rtx_def* emit_label             PARAMS ((struct rtx_def *));
 
 /* This is a hell of a lot easier than getting expr.h included in
    by parse.c.  */
-extern struct rtx_def *expand_expr     PROTO((tree, struct rtx_def *,
+extern struct rtx_def *expand_expr     PARAMS ((tree, struct rtx_def *,
                                               enum machine_mode, int));
 
-static int parse_action                                PROTO((void));
-static void ch_parse_init                      PROTO((void));
-static void check_end_label                    PROTO((tree, tree));
-static void end_function                               PROTO((void));
-static tree build_prefix_clause                        PROTO((tree));
-static enum terminal PEEK_TOKEN                        PROTO((void));
-static int peek_token_                         PROTO((int));
-static void pushback_token                     PROTO((int, tree));
-static void forward_token_                     PROTO((void));
-static void require                            PROTO((enum terminal));
-static int check_token                         PROTO((enum terminal));
-static int expect                              PROTO((enum terminal, const char *));
-static void define__PROCNAME__                 PROTO((void));
+static int parse_action                                PARAMS ((void));
+static void ch_parse_init                      PARAMS ((void));
+static void check_end_label                    PARAMS ((tree, tree));
+static void end_function                               PARAMS ((void));
+static tree build_prefix_clause                        PARAMS ((tree));
+static enum terminal PEEK_TOKEN                        PARAMS ((void));
+static int peek_token_                         PARAMS ((int));
+static void pushback_token                     PARAMS ((int, tree));
+static void forward_token_                     PARAMS ((void));
+static void require                            PARAMS ((enum terminal));
+static int check_token                         PARAMS ((enum terminal));
+static int expect                              PARAMS ((enum terminal, const char *));
+static void define__PROCNAME__                 PARAMS ((void));
 
 extern int  lineno;
-extern char *input_filename;
 extern tree generic_signal_type_node;
 extern tree signal_code;
 extern int all_static_flag;
@@ -223,7 +223,7 @@ end_function ()
          if (result_never_set
              && TREE_CODE (TREE_TYPE (TREE_TYPE (current_function_decl)))
              != VOID_TYPE)
-           warning ("No RETURN or RESULT in procedure");
+           warning ("no RETURN or RESULT in procedure");
          chill_expand_return (NULL_TREE, 1);
        }
     }
@@ -278,14 +278,15 @@ PEEK_TOKEN()
   return terminal_buffer[0];
 }
 #define PEEK_TREE() val_buffer[0].ttype
-#define PEEK_TOKEN1() peek_token_(1)
-#define PEEK_TOKEN2() peek_token_(2)
+#define PEEK_TOKEN1() peek_token_ (1)
+#define PEEK_TOKEN2() peek_token_ (2)
+
 static int
 peek_token_ (i)
      int i;
 {
   if (i > MAX_LOOK_AHEAD)
-    fatal ("internal error - too much lookahead");
+    abort ();
   if (terminal_buffer[i] == TOKEN_NOT_READ)
     {
       terminal_buffer[i] = yylex();
@@ -301,7 +302,7 @@ pushback_token (code, node)
 {
   int i;
   if (terminal_buffer[MAX_LOOK_AHEAD] != TOKEN_NOT_READ)
-    fatal ("internal error - cannot pushback token");
+    abort ();
   for (i = MAX_LOOK_AHEAD; i > 0; i--)
     { 
       terminal_buffer[i] = terminal_buffer[i - 1]; 
@@ -322,17 +323,17 @@ forward_token_()
     }
   terminal_buffer[MAX_LOOK_AHEAD] = TOKEN_NOT_READ;
 }
-#define FORWARD_TOKEN() forward_token_()
+#define FORWARD_TOKEN() forward_token_ ()
 
 /* Skip the next token.
    if it isn't TOKEN, the parser is broken. */
 
 static void
-require(token)
+require (token)
      enum terminal token;
 {
   if (PEEK_TOKEN() != token)
-    fatal ("internal parser error - expected token %d", (int)token);
+    internal_error ("internal parser error - expected token %d", (int) token);
   FORWARD_TOKEN();
 }
 
@@ -386,114 +387,115 @@ define__PROCNAME__ ()
 }
 
 /* Forward declarations. */
-static tree parse_expression PROTO((void));
-static tree parse_primval PROTO((void));
-static tree parse_mode PROTO((void));
-static tree parse_opt_mode PROTO((void));
-static tree parse_untyped_expr PROTO((void));
-static tree parse_opt_untyped_expr PROTO((void));
-static int parse_definition PROTO((int));
-static void parse_opt_actions PROTO((void));
-static void parse_body PROTO((void));
-static tree parse_if_expression_body PROTO((void));
-static tree parse_opt_handler PROTO((void));
-static tree parse_opt_name_string PROTO((int));
-static tree parse_simple_name_string PROTO((void));
-static tree parse_name_string PROTO((void));
-static tree parse_defining_occurrence PROTO((void));
-static tree parse_name PROTO((void));
-static tree parse_optlabel PROTO((void));
-static void parse_opt_end_label_semi_colon PROTO((tree));
-static void parse_modulion PROTO((tree));
-static void parse_spec_module PROTO((tree));
-static void parse_semi_colon PROTO((void));
-static tree parse_defining_occurrence_list PROTO((void));
-static void parse_mode_definition PROTO((int));
-static void parse_mode_definition_statement PROTO((int));
-static void parse_synonym_definition PROTO((void));
-static void parse_synonym_definition_statement PROTO((void));
-static tree parse_on_exception_list PROTO((void));
-static void parse_on_alternatives PROTO((void));
-static void parse_loc_declaration PROTO((int));
-static void parse_declaration_statement PROTO((int));
-static tree parse_optforbid PROTO((void));
-static tree parse_postfix PROTO((enum terminal));
-static tree parse_postfix_list PROTO((enum terminal));
-static void parse_rename_clauses PROTO((enum terminal));
-static tree parse_opt_prefix_clause PROTO((void));
-static void parse_grant_statement PROTO((void));
-static void parse_seize_statement PROTO((void));
-static tree parse_param_name_list PROTO((void));
-static tree parse_param_attr PROTO((void));
-static tree parse_formpar PROTO((void));
-static tree parse_formparlist PROTO((void));
-static tree parse_opt_result_spec PROTO((void));
-static tree parse_opt_except PROTO((void));
-static tree parse_opt_recursive PROTO((void));
-static tree parse_procedureattr PROTO((void));
-static void parse_proc_body PROTO((tree, tree));
-static void parse_procedure_definition PROTO((int));
-static tree parse_processpar PROTO((void));
-static tree parse_processparlist PROTO((void));
-static void parse_process_definition PROTO((int));
-static void parse_signal_definition PROTO((void));
-static void parse_signal_definition_statement PROTO((void));
-static void parse_then_clause PROTO((void));
-static void parse_opt_else_clause PROTO((void));
-static tree parse_expr_list PROTO((void));
-static tree parse_range_list_clause PROTO((void));
-static void pushback_paren_expr PROTO((tree));
-static tree parse_case_label PROTO((void));
-static tree parse_case_label_list PROTO((tree, int));
-static tree parse_case_label_specification PROTO((tree));
-static void parse_single_dimension_case_action PROTO((tree));
-static void parse_multi_dimension_case_action PROTO((tree));
-static void parse_case_action PROTO((tree));
-static tree parse_asm_operands PROTO((void));
-static tree parse_asm_clobbers PROTO((void));
-static void ch_expand_asm_operands PROTO((tree, tree, tree, tree, int, char *, int));
-static void parse_asm_action PROTO((void));
-static void parse_begin_end_block PROTO((tree));
-static void parse_if_action PROTO((tree));
-static void parse_iteration PROTO((void));
-static tree parse_delay_case_event_list PROTO((void));
-static void parse_delay_case_action PROTO((tree));
-static void parse_do_action PROTO((tree));
-static tree parse_receive_spec PROTO((void));
-static void parse_receive_case_action PROTO((tree));
-static void parse_send_action PROTO((void));
-static void parse_start_action PROTO((void));
-static tree parse_call PROTO((tree));
-static tree parse_tuple_fieldname_list PROTO((void));
-static tree parse_tuple_element PROTO((void));
-static tree parse_opt_element_list PROTO((void));
-static tree parse_tuple PROTO((tree));
-static tree parse_operand6 PROTO((void));
-static tree parse_operand5 PROTO((void));
-static tree parse_operand4 PROTO((void));
-static tree parse_operand3 PROTO((void));
-static tree parse_operand2 PROTO((void));
-static tree parse_operand1 PROTO((void));
-static tree parse_operand0 PROTO((void));
-static tree parse_case_expression PROTO((void));
-static tree parse_then_alternative PROTO((void));
-static tree parse_else_alternative PROTO((void));
-static tree parse_if_expression PROTO((void));
-static tree parse_index_mode PROTO((void));
-static tree parse_set_mode PROTO((void));
-static tree parse_pos PROTO((void));
-static tree parse_step PROTO((void));
-static tree parse_opt_layout PROTO((int));
-static tree parse_field_name_list PROTO((void));
-static tree parse_fixed_field PROTO((void));
-static tree parse_variant_field_list PROTO((void));
-static tree parse_variant_alternative PROTO((void));
-static tree parse_field PROTO((void));
-static tree parse_structure_mode PROTO((void));
-static tree parse_opt_queue_size PROTO((void));
-static tree parse_procedure_mode PROTO((void));
-static void parse_program PROTO((void));
-static void parse_pass_1_2 PROTO((void));
+static tree parse_expression PARAMS ((void));
+static tree parse_primval PARAMS ((void));
+static tree parse_mode PARAMS ((void));
+static tree parse_opt_mode PARAMS ((void));
+static tree parse_untyped_expr PARAMS ((void));
+static tree parse_opt_untyped_expr PARAMS ((void));
+static int parse_definition PARAMS ((int));
+static void parse_opt_actions PARAMS ((void));
+static void parse_body PARAMS ((void));
+static tree parse_if_expression_body PARAMS ((void));
+static tree parse_opt_handler PARAMS ((void));
+static tree parse_opt_name_string PARAMS ((int));
+static tree parse_simple_name_string PARAMS ((void));
+static tree parse_name_string PARAMS ((void));
+static tree parse_defining_occurrence PARAMS ((void));
+static tree parse_name PARAMS ((void));
+static tree parse_optlabel PARAMS ((void));
+static void parse_opt_end_label_semi_colon PARAMS ((tree));
+static void parse_modulion PARAMS ((tree));
+static void parse_spec_module PARAMS ((tree));
+static void parse_semi_colon PARAMS ((void));
+static tree parse_defining_occurrence_list PARAMS ((void));
+static void parse_mode_definition PARAMS ((int));
+static void parse_mode_definition_statement PARAMS ((int));
+static void parse_synonym_definition PARAMS ((void));
+static void parse_synonym_definition_statement PARAMS ((void));
+static tree parse_on_exception_list PARAMS ((void));
+static void parse_on_alternatives PARAMS ((void));
+static void parse_loc_declaration PARAMS ((int));
+static void parse_declaration_statement PARAMS ((int));
+static tree parse_optforbid PARAMS ((void));
+static tree parse_postfix PARAMS ((enum terminal));
+static tree parse_postfix_list PARAMS ((enum terminal));
+static void parse_rename_clauses PARAMS ((enum terminal));
+static tree parse_opt_prefix_clause PARAMS ((void));
+static void parse_grant_statement PARAMS ((void));
+static void parse_seize_statement PARAMS ((void));
+static tree parse_param_name_list PARAMS ((void));
+static tree parse_param_attr PARAMS ((void));
+static tree parse_formpar PARAMS ((void));
+static tree parse_formparlist PARAMS ((void));
+static tree parse_opt_result_spec PARAMS ((void));
+static tree parse_opt_except PARAMS ((void));
+static tree parse_opt_recursive PARAMS ((void));
+static tree parse_procedureattr PARAMS ((void));
+static void parse_proc_body PARAMS ((tree, tree));
+static void parse_procedure_definition PARAMS ((int));
+static tree parse_processpar PARAMS ((void));
+static tree parse_processparlist PARAMS ((void));
+static void parse_process_definition PARAMS ((int));
+static void parse_signal_definition PARAMS ((void));
+static void parse_signal_definition_statement PARAMS ((void));
+static void parse_then_clause PARAMS ((void));
+static void parse_opt_else_clause PARAMS ((void));
+static tree parse_expr_list PARAMS ((void));
+static tree parse_range_list_clause PARAMS ((void));
+static void pushback_paren_expr PARAMS ((tree));
+static tree parse_case_label PARAMS ((void));
+static tree parse_case_label_list PARAMS ((tree, int));
+static tree parse_case_label_specification PARAMS ((tree));
+static void parse_single_dimension_case_action PARAMS ((tree));
+static void parse_multi_dimension_case_action PARAMS ((tree));
+static void parse_case_action PARAMS ((tree));
+static tree parse_asm_operands PARAMS ((void));
+static tree parse_asm_clobbers PARAMS ((void));
+static void ch_expand_asm_operands PARAMS ((tree, tree, tree, tree,
+                                           int, const char *, int));
+static void parse_asm_action PARAMS ((void));
+static void parse_begin_end_block PARAMS ((tree));
+static void parse_if_action PARAMS ((tree));
+static void parse_iteration PARAMS ((void));
+static tree parse_delay_case_event_list PARAMS ((void));
+static void parse_delay_case_action PARAMS ((tree));
+static void parse_do_action PARAMS ((tree));
+static tree parse_receive_spec PARAMS ((void));
+static void parse_receive_case_action PARAMS ((tree));
+static void parse_send_action PARAMS ((void));
+static void parse_start_action PARAMS ((void));
+static tree parse_call PARAMS ((tree));
+static tree parse_tuple_fieldname_list PARAMS ((void));
+static tree parse_tuple_element PARAMS ((void));
+static tree parse_opt_element_list PARAMS ((void));
+static tree parse_tuple PARAMS ((tree));
+static tree parse_operand6 PARAMS ((void));
+static tree parse_operand5 PARAMS ((void));
+static tree parse_operand4 PARAMS ((void));
+static tree parse_operand3 PARAMS ((void));
+static tree parse_operand2 PARAMS ((void));
+static tree parse_operand1 PARAMS ((void));
+static tree parse_operand0 PARAMS ((void));
+static tree parse_case_expression PARAMS ((void));
+static tree parse_then_alternative PARAMS ((void));
+static tree parse_else_alternative PARAMS ((void));
+static tree parse_if_expression PARAMS ((void));
+static tree parse_index_mode PARAMS ((void));
+static tree parse_set_mode PARAMS ((void));
+static tree parse_pos PARAMS ((void));
+static tree parse_step PARAMS ((void));
+static tree parse_opt_layout PARAMS ((int));
+static tree parse_field_name_list PARAMS ((void));
+static tree parse_fixed_field PARAMS ((void));
+static tree parse_variant_field_list PARAMS ((void));
+static tree parse_variant_alternative PARAMS ((void));
+static tree parse_field PARAMS ((void));
+static tree parse_structure_mode PARAMS ((void));
+static tree parse_opt_queue_size PARAMS ((void));
+static tree parse_procedure_mode PARAMS ((void));
+static void parse_program PARAMS ((void));
+static void parse_pass_1_2 PARAMS ((void));
 
 static tree
 parse_opt_name_string (allow_all)
@@ -959,7 +961,7 @@ parse_loc_declaration (in_spec_module)
       ignoring = save_ignoring;
     }
   if (init_value == NULL_TREE && loc_decl && pass == 1)
-    error ("loc-identity declaration without initialisation");
+    error ("loc-identity declaration without initialization");
   do_decls (names, mode,
            is_static || global_bindings_p ()
            /* the variable becomes STATIC if all_static_flag is set and
@@ -1785,7 +1787,7 @@ parse_multi_dimension_case_action (selector)
   tree action_labels = NULL_TREE;
   tree tests = NULL_TREE;
   int  save_lineno = lineno;
-  char *save_filename = input_filename;
+  const char *save_filename = input_filename;
 
   /* We can't compute the range of an (ELSE) label until all of the CASE
      label specifications have been seen, however, the code for the actions
@@ -2008,7 +2010,7 @@ static void
 ch_expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
      tree string, outputs, inputs, clobbers;
      int vol;
-     char *filename;
+     const char *filename;
      int line;
 {
   int noutputs = list_length (outputs);
@@ -2383,7 +2385,7 @@ parse_do_action (label)
     {
       push_handler ();
       parse_opt_actions ();
-      expect (OD, "Missing 'OD' after 'DO'");
+      expect (OD, "missing 'OD' after 'DO'");
       parse_opt_handler ();
       parse_opt_end_label_semi_colon (label);
       return;
@@ -2422,7 +2424,7 @@ parse_do_action (label)
   parse_opt_actions ();
   if (! ignoring)
     build_loop_end (); 
-  expect (OD, "Missing 'OD' after 'DO'");
+  expect (OD, "missing 'OD' after 'DO'");
   /* Note that the handler is inside the reach of the DO. */
   parse_opt_handler ();
   end_loop_scope (label);
@@ -2940,7 +2942,7 @@ parse_action ()
 
  no_handler_action:
   if (parse_opt_handler () != NULL_TREE && pass == 1)
-    error ("no handler is permitted on this action.");
+    error ("no handler is permitted on this action");
   parse_semi_colon ();
   return 1;
 
@@ -4324,7 +4326,7 @@ set_yydebug (value)
 #if YYDEBUG != 0
   yydebug = value;
 #else
-  warning ("YYDEBUG not defined.");
+  warning ("YYDEBUG not defined");
 #endif
 }
 #endif