* configure.tgt: Mark v850 as multi-arched.
[deliverable/binutils-gdb.git] / gdb / ch-exp.c
index 3d8318e0e5436939c0338ce4a71cc2dc05d1d59e..e96a6f8e5f89375cc01fdb16894e2990e8919feb 100644 (file)
@@ -1,5 +1,6 @@
 /* Parser for GNU CHILL (CCITT High-Level Language)  -*- C -*-
-   Copyright (C) 1992, 1993, 1995 Free Software Foundation, Inc.
+   Copyright 1992, 1993, 1995, 1996, 1997, 1999, 2000, 2001
+   Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -147,13 +148,14 @@ static enum ch_terminal match_integer_literal (void);
 static enum ch_terminal match_character_literal (void);
 static enum ch_terminal match_string_literal (void);
 static enum ch_terminal match_float_literal (void);
-static enum ch_terminal match_float_literal (void);
 static int decode_integer_literal (LONGEST *, char **);
 static int decode_integer_value (int, char **, LONGEST *);
 static char *match_simple_name_string (void);
 static void growbuf_by_size (int);
+static void parse_case_label (void);
 static void parse_untyped_expr (void);
 static void parse_if_expression (void);
+static void parse_if_expression_body (void);
 static void parse_else_alternative (void);
 static void parse_then_alternative (void);
 static void parse_expr (void);
@@ -176,13 +178,7 @@ static struct type *parse_mode_call (void);
 #endif
 static void parse_unary_call (void);
 static int parse_opt_untyped_expr (void);
-static void parse_case_label (void);
 static int expect (enum ch_terminal, char *);
-static void parse_expr (void);
-static void parse_primval (void);
-static void parse_untyped_expr (void);
-static int parse_opt_untyped_expr (void);
-static void parse_if_expression_body (void);
 static enum ch_terminal ch_lex (void);
 INLINE static enum ch_terminal PEEK_TOKEN (void);
 static enum ch_terminal peek_token_ (int);
@@ -216,7 +212,8 @@ static enum ch_terminal
 peek_token_ (int i)
 {
   if (i > MAX_LOOK_AHEAD)
-    internal_error ("ch-exp.c - too much lookahead");
+    internal_error (__FILE__, __LINE__,
+                   "too much lookahead");
   if (terminal_buffer[i] == TOKEN_NOT_READ)
     {
       terminal_buffer[i] = ch_lex ();
@@ -232,7 +229,8 @@ pushback_token (enum ch_terminal code, YYSTYPE node)
 {
   int i;
   if (terminal_buffer[MAX_LOOK_AHEAD] != TOKEN_NOT_READ)
-    internal_error ("ch-exp.c - cannot pushback token");
+    internal_error (__FILE__, __LINE__,
+                   "cannot pushback token");
   for (i = MAX_LOOK_AHEAD; i > 0; i--)
     {
       terminal_buffer[i] = terminal_buffer[i - 1];
@@ -265,7 +263,8 @@ require (enum ch_terminal token)
 {
   if (PEEK_TOKEN () != token)
     {
-      internal_error ("ch-exp.c - expected token %d", (int) token);
+      internal_error (__FILE__, __LINE__,
+                     "expected token %d", (int) token);
     }
   FORWARD_TOKEN ();
 }
@@ -301,9 +300,10 @@ expect (enum ch_terminal token, char *message)
 }
 
 #if 0
+/* Parse a name string.  If ALLOW_ALL is 1, ALL is allowed as a postfix. */
+
 static tree
-parse_opt_name_string (allow_all)
-     int allow_all;            /* 1 if ALL is allowed as a postfix */
+parse_opt_name_string (int allow_all)
 {
   int token = PEEK_TOKEN ();
   tree name;
@@ -1783,7 +1783,7 @@ match_integer_literal (void)
   else
     {
       yylval.typed_val.val = ival;
-#if defined(CC_HAS_LONG_LONG) && defined(__STDC__)
+#if defined(CC_HAS_LONG_LONG)
       if (ival > (LONGEST) 2147483647U || ival < -(LONGEST) 2147483648U)
        yylval.typed_val.type = builtin_type_long_long;
       else
@@ -1883,15 +1883,15 @@ match_bitstring_literal (void)
       else
        {
          /* Extract bits from digit, packing them into the bitstring byte. */
-         int k = TARGET_BYTE_ORDER == BIG_ENDIAN ? bits_per_char - 1 : 0;
-         for (; TARGET_BYTE_ORDER == BIG_ENDIAN ? k >= 0 : k < bits_per_char;
-              TARGET_BYTE_ORDER == BIG_ENDIAN ? k-- : k++)
+         int k = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? bits_per_char - 1 : 0;
+         for (; TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? k >= 0 : k < bits_per_char;
+              TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? k-- : k++)
            {
              bitcount++;
              if (digit & (1 << k))
                {
                  tempbuf[tempbufindex] |=
-                   (TARGET_BYTE_ORDER == BIG_ENDIAN)
+                   (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
                    ? (1 << (HOST_CHAR_BIT - 1 - bitoffset))
                    : (1 << bitoffset);
                }
@@ -2176,7 +2176,8 @@ ch_lex (void)
              error ("Symbol \"%s\" names no location.", inputname);
              break;
            default:
-             internal_error ("unhandled SYMBOL_CLASS in ch_lex()");
+             internal_error (__FILE__, __LINE__,
+                             "unhandled SYMBOL_CLASS in ch_lex()");
              break;
            }
        }
This page took 0.026034 seconds and 4 git commands to generate.