/* 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.
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);
#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);
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 ();
{
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];
{
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 ();
}
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
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);
}
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;
}
}