binutils-gdb/gdb/ch-exp.y

1807 lines
44 KiB
Plaintext
Raw Normal View History

* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
/* YACC grammar for Chill expressions, for GDB.
Copyright 1992, 1993, 1994 Free Software Foundation, Inc.
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
1995-08-02 05:41:12 +02:00
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
/* Parse a Chill expression from text in a string,
and return the result as a struct expression pointer.
That structure contains arithmetic operations in reverse polish,
with constants represented by operations that are followed by special data.
See expression.h for the details of the format.
What is important here is that it can be built up sequentially
during the process of parsing; the lower levels of the tree always
come first in the result.
Note that malloc's and realloc's in this file are transformed to
xmalloc and xrealloc respectively by the same sed command in the
makefile that remaps any other malloc/realloc inserted by the parser
generator. Doing this with #defines and trying to control the interaction
with include files (<malloc.h> and <stdlib.h> for example) just became
too messy, particularly when such includes can be inserted at random
times by the parser generator.
Also note that the language accepted by this parser is more liberal
than the one accepted by an actual Chill compiler. For example, the
language rule that a simple name string can not be one of the reserved
simple name strings is not enforced (e.g "case" is not treated as a
reserved name). Another example is that Chill is a strongly typed
language, and certain expressions that violate the type constraints
may still be evaluated if gdb can do so in a meaningful manner, while
such expressions would be rejected by the compiler. The reason for
this more liberal behavior is the philosophy that the debugger
is intended to be a tool that is used by the programmer when things
go wrong, and as such, it should provide as few artificial barriers
to it's use as possible. If it can do something meaningful, even
something that violates language contraints that are enforced by the
compiler, it should do so without complaint.
*/
%{
#include "defs.h"
#include <string.h>
#include <ctype.h>
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
#include "expression.h"
#include "language.h"
#include "value.h"
#include "parser-defs.h"
#include "ch-lang.h"
* Makefile.in (c-exp.tab.o): Remove notice about shift/reduce conflicts which no longer occur. gcc -Wall lint: * findvar.c (symbol_read_needs_frame), corelow.c (ignore), inflow.c (gdb_has_a_terminal): Make sure to return a value. * regex.h: Declare re_set_syntax. * printcmd.c: Include valprint.h. * infcmd.c, exec.c, maint.c, core.c: Include language.h. * maint.c: Include expression.h. * infrun.c, fork-child.c, corelow.c, inflow.c: Include thread.h. * inftarg.c: Include command.h. * coredep.c: Include value.h. * c-exp.y, m2-exp.y, ch-exp.y: Include bfd.h, symfile.h and objfiles.h. * ch-typeprint.c: Include typeprint.h. * ch-valprint.c: Include c-lang.h. * nlmread.c: Include buildsym.h. * environ.c: Include gdbcore.h. Only include defs.h once. (set_in_environ): Cast const char * to char * when passing to set_gnutarget. Remove unused variables: * printcmd.c (printf_command): args_to_vprintf. * coffread.c (coff_symfile_init): strsection. Move variables to within the #ifdefs where they are used: * symtab.c (gdb_mangle_name): opname. * inftarg.c (child_attach): pid and exec_file. * inftarg.c (child_detach): siggnal. * objfiles.c (allocate_objfile): mapto, md, and fd. * objfiles.c (free_objfile): mmfd. * infrun.c (wait_for_inferior): Include BPSTAT_WHAT_LAST in switch. * infrun.c (wait_for_inferior): Remove unused same_pid label. * inferior.h: Declare set_sigint_trap and clear_sigint_trap. * parser-defs.h: Declare write_exp_elt_block. * stabsread.h: Declare elfstab_offset_sections and coffstab_build_psymtabs.
1993-10-21 21:41:50 +01:00
#include "bfd.h" /* Required by objfiles.h. */
#include "symfile.h" /* Required by objfiles.h. */
#include "objfiles.h" /* For have_full_symbols and have_partial_symbols */
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
/* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc),
as well as gratuitiously global symbol names, so we can have multiple
yacc generated parsers in gdb. Note that these are only the variables
produced by yacc. If other parser generators (bison, byacc, etc) produce
additional global names that conflict at link time, then those parser
generators need to be fixed instead of adding those names to this list. */
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
#define yymaxdepth chill_maxdepth
#define yyparse chill_parse
#define yylex chill_lex
#define yyerror chill_error
#define yylval chill_lval
#define yychar chill_char
#define yydebug chill_debug
#define yypact chill_pact
#define yyr1 chill_r1
#define yyr2 chill_r2
#define yydef chill_def
#define yychk chill_chk
#define yypgo chill_pgo
#define yyact chill_act
#define yyexca chill_exca
#define yyerrflag chill_errflag
#define yynerrs chill_nerrs
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
#define yyps chill_ps
#define yypv chill_pv
#define yys chill_s
#define yy_yys chill_yys
#define yystate chill_state
#define yytmp chill_tmp
#define yyv chill_v
#define yy_yyv chill_yyv
#define yyval chill_val
#define yylloc chill_lloc
#define yyreds chill_reds /* With YYDEBUG defined */
#define yytoks chill_toks /* With YYDEBUG defined */
1995-03-01 18:23:41 +01:00
#define yylhs chill_yylhs
#define yylen chill_yylen
#define yydefred chill_yydefred
#define yydgoto chill_yydgoto
#define yysindex chill_yysindex
#define yyrindex chill_yyrindex
#define yygindex chill_yygindex
#define yytable chill_yytable
#define yycheck chill_yycheck
#ifndef YYDEBUG
#define YYDEBUG 0 /* Default to no yydebug support */
#endif
static void
write_lower_upper_value PARAMS ((enum exp_opcode, struct type *type));
int
yyparse PARAMS ((void));
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
static int
yylex PARAMS ((void));
void
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
yyerror PARAMS ((char *));
%}
/* Although the yacc "value" of an expression is not used,
since the result is stored in the structure being created,
other node types do have values. */
%union
{
LONGEST lval;
unsigned LONGEST ulval;
struct {
LONGEST val;
struct type *type;
} typed_val;
double dval;
struct symbol *sym;
struct type *tval;
struct stoken sval;
struct ttype tsym;
struct symtoken ssym;
int voidval;
struct block *bval;
enum exp_opcode opcode;
struct internalvar *ivar;
struct type **tvec;
int *ivec;
}
%token <typed_val> INTEGER_LITERAL
%token <ulval> BOOLEAN_LITERAL
%token <typed_val> CHARACTER_LITERAL
%token <dval> FLOAT_LITERAL
%token <ssym> GENERAL_PROCEDURE_NAME
%token <ssym> LOCATION_NAME
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
%token <voidval> EMPTINESS_LITERAL
%token <sval> CHARACTER_STRING_LITERAL
* defs.h (HOST_CHAR_BIT): New macro, defaults to either CHAR_BIT from a configuration file (typically including <limits.h>), or to TARGET_CHAR_BIT if CHAR_BIT is not defined. * eval.c (evaluate_subexp): Use new BYTES_TO_EXP_ELEM macro. * eval.c (evaluate_subexp): Add case for OP_BITSTRING. * expprint.c (print_subexp): Use new BYTES_TO_EXP_ELEM macro. * exppritn.c (print_subexp, dump_expression): Add case for OP_BITSTRING. * expression.h (OP_BITSTRING): New expression element type for packed bitstrings. * expression.h (EXP_ELEM_TO_BYTES, BYTES_TO_EXP_ELEM): New macros to convert between number of expression elements and bytes to store that many elements. * i960-tdep.c (leafproc_return): Use new macros to access minimal symbol name and address fields. * m88k-pinsn.c (sprint_address): Use new macros to access minimal symbol name and address fields. * nindy-tdep.c (nindy_frame_chain_valid): Use new macro to access minimal symbol address field. * parse.c (write_exp_elt, write_exp_string, prefixify_expression, parse_exp_1): Use new EXP_ELEM_TO_BYTES macro. * parse.c (write_exp_string, length_of_subexp, prefixify_expression): Use new BYTES_TO_EXP_ELEM macro. * parse.c (write_exp_bitstring): New function to write packed bitstrings into the expression element vector. * parse.c (length_of_subexp, prefixify_subexp): Add case for OP_BITSTRING. * parser-defs.h (struct stoken): Document that it is used for OP_BITSTRING as well as OP_STRING. * parser-defs.h (write_exp_bitstring): Add prototype. **** start-sanitize-chill **** * ch-exp.y (BIT_STRING_LITERAL): Change token type to sval. * ch-exp.y (NUM, PRED, SUCC, ABS, CARD, MAX, MIN, SIZE, UPPER, LOWER, LENGTH): New tokens for keywords. * ch-exp.y (chill_value_built_in_routine_call, mode_argument, upper_lower_argument, length_argument, array_mode_name, string_mode_name, variant_structure_mode_name): New non-terminals and productions. * ch-exp.y (literal): Useful production for BIT_STRING_LITERAL. * ch-exp.y (match_bitstring_literal): New lexer support function to recognize bitstring literals. * ch-exp.y (tokentab6): New token table for 6 character keywords. * ch-exp.y (tokentab5): Add LOWER, UPPER. * ch-exp.y (tokentab4): Add PRED, SUCC, CARD, SIZE. * ch-exp.y (tokentab3): Add NUM, ABS, MIN, MAX. * ch-exp.y (yylex): Check tokentab6. * ch-exp.y (yylex): Call match_bitstring_literal. **** end-sanitize-chill ****
1993-01-06 17:52:10 +01:00
%token <sval> BIT_STRING_LITERAL
%token <tsym> TYPENAME
%token <sval> FIELD_NAME
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
%token <voidval> '.'
%token <voidval> ';'
%token <voidval> ':'
%token <voidval> CASE
%token <voidval> OF
%token <voidval> ESAC
%token <voidval> LOGIOR
%token <voidval> ORIF
%token <voidval> LOGXOR
%token <voidval> LOGAND
%token <voidval> ANDIF
%token <voidval> '='
%token <voidval> NOTEQUAL
%token <voidval> '>'
%token <voidval> GTR
%token <voidval> '<'
%token <voidval> LEQ
%token <voidval> IN
%token <voidval> '+'
%token <voidval> '-'
%token <voidval> '*'
%token <voidval> '/'
%token <voidval> SLASH_SLASH
%token <voidval> MOD
%token <voidval> REM
%token <voidval> NOT
%token <voidval> POINTER
%token <voidval> RECEIVE
%token <voidval> '['
%token <voidval> ']'
%token <voidval> '('
%token <voidval> ')'
%token <voidval> UP
%token <voidval> IF
%token <voidval> THEN
%token <voidval> ELSE
%token <voidval> FI
%token <voidval> ELSIF
%token <voidval> ILLEGAL_TOKEN
* defs.h (HOST_CHAR_BIT): New macro, defaults to either CHAR_BIT from a configuration file (typically including <limits.h>), or to TARGET_CHAR_BIT if CHAR_BIT is not defined. * eval.c (evaluate_subexp): Use new BYTES_TO_EXP_ELEM macro. * eval.c (evaluate_subexp): Add case for OP_BITSTRING. * expprint.c (print_subexp): Use new BYTES_TO_EXP_ELEM macro. * exppritn.c (print_subexp, dump_expression): Add case for OP_BITSTRING. * expression.h (OP_BITSTRING): New expression element type for packed bitstrings. * expression.h (EXP_ELEM_TO_BYTES, BYTES_TO_EXP_ELEM): New macros to convert between number of expression elements and bytes to store that many elements. * i960-tdep.c (leafproc_return): Use new macros to access minimal symbol name and address fields. * m88k-pinsn.c (sprint_address): Use new macros to access minimal symbol name and address fields. * nindy-tdep.c (nindy_frame_chain_valid): Use new macro to access minimal symbol address field. * parse.c (write_exp_elt, write_exp_string, prefixify_expression, parse_exp_1): Use new EXP_ELEM_TO_BYTES macro. * parse.c (write_exp_string, length_of_subexp, prefixify_expression): Use new BYTES_TO_EXP_ELEM macro. * parse.c (write_exp_bitstring): New function to write packed bitstrings into the expression element vector. * parse.c (length_of_subexp, prefixify_subexp): Add case for OP_BITSTRING. * parser-defs.h (struct stoken): Document that it is used for OP_BITSTRING as well as OP_STRING. * parser-defs.h (write_exp_bitstring): Add prototype. **** start-sanitize-chill **** * ch-exp.y (BIT_STRING_LITERAL): Change token type to sval. * ch-exp.y (NUM, PRED, SUCC, ABS, CARD, MAX, MIN, SIZE, UPPER, LOWER, LENGTH): New tokens for keywords. * ch-exp.y (chill_value_built_in_routine_call, mode_argument, upper_lower_argument, length_argument, array_mode_name, string_mode_name, variant_structure_mode_name): New non-terminals and productions. * ch-exp.y (literal): Useful production for BIT_STRING_LITERAL. * ch-exp.y (match_bitstring_literal): New lexer support function to recognize bitstring literals. * ch-exp.y (tokentab6): New token table for 6 character keywords. * ch-exp.y (tokentab5): Add LOWER, UPPER. * ch-exp.y (tokentab4): Add PRED, SUCC, CARD, SIZE. * ch-exp.y (tokentab3): Add NUM, ABS, MIN, MAX. * ch-exp.y (yylex): Check tokentab6. * ch-exp.y (yylex): Call match_bitstring_literal. **** end-sanitize-chill ****
1993-01-06 17:52:10 +01:00
%token <voidval> NUM
%token <voidval> PRED
%token <voidval> SUCC
%token <voidval> ABS
%token <voidval> CARD
%token <voidval> MAX_TOKEN
%token <voidval> MIN_TOKEN
%token <voidval> ADDR_TOKEN
* defs.h (HOST_CHAR_BIT): New macro, defaults to either CHAR_BIT from a configuration file (typically including <limits.h>), or to TARGET_CHAR_BIT if CHAR_BIT is not defined. * eval.c (evaluate_subexp): Use new BYTES_TO_EXP_ELEM macro. * eval.c (evaluate_subexp): Add case for OP_BITSTRING. * expprint.c (print_subexp): Use new BYTES_TO_EXP_ELEM macro. * exppritn.c (print_subexp, dump_expression): Add case for OP_BITSTRING. * expression.h (OP_BITSTRING): New expression element type for packed bitstrings. * expression.h (EXP_ELEM_TO_BYTES, BYTES_TO_EXP_ELEM): New macros to convert between number of expression elements and bytes to store that many elements. * i960-tdep.c (leafproc_return): Use new macros to access minimal symbol name and address fields. * m88k-pinsn.c (sprint_address): Use new macros to access minimal symbol name and address fields. * nindy-tdep.c (nindy_frame_chain_valid): Use new macro to access minimal symbol address field. * parse.c (write_exp_elt, write_exp_string, prefixify_expression, parse_exp_1): Use new EXP_ELEM_TO_BYTES macro. * parse.c (write_exp_string, length_of_subexp, prefixify_expression): Use new BYTES_TO_EXP_ELEM macro. * parse.c (write_exp_bitstring): New function to write packed bitstrings into the expression element vector. * parse.c (length_of_subexp, prefixify_subexp): Add case for OP_BITSTRING. * parser-defs.h (struct stoken): Document that it is used for OP_BITSTRING as well as OP_STRING. * parser-defs.h (write_exp_bitstring): Add prototype. **** start-sanitize-chill **** * ch-exp.y (BIT_STRING_LITERAL): Change token type to sval. * ch-exp.y (NUM, PRED, SUCC, ABS, CARD, MAX, MIN, SIZE, UPPER, LOWER, LENGTH): New tokens for keywords. * ch-exp.y (chill_value_built_in_routine_call, mode_argument, upper_lower_argument, length_argument, array_mode_name, string_mode_name, variant_structure_mode_name): New non-terminals and productions. * ch-exp.y (literal): Useful production for BIT_STRING_LITERAL. * ch-exp.y (match_bitstring_literal): New lexer support function to recognize bitstring literals. * ch-exp.y (tokentab6): New token table for 6 character keywords. * ch-exp.y (tokentab5): Add LOWER, UPPER. * ch-exp.y (tokentab4): Add PRED, SUCC, CARD, SIZE. * ch-exp.y (tokentab3): Add NUM, ABS, MIN, MAX. * ch-exp.y (yylex): Check tokentab6. * ch-exp.y (yylex): Call match_bitstring_literal. **** end-sanitize-chill ****
1993-01-06 17:52:10 +01:00
%token <voidval> SIZE
%token <voidval> UPPER
%token <voidval> LOWER
%token <voidval> LENGTH
%token <voidval> ARRAY
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
/* Tokens which are not Chill tokens used in expressions, but rather GDB
specific things that we recognize in the same context as Chill tokens
(register names for example). */
%token <lval> GDB_REGNAME /* Machine register name */
%token <lval> GDB_LAST /* Value history */
%token <ivar> GDB_VARIABLE /* Convenience variable */
%token <voidval> GDB_ASSIGNMENT /* Assign value to somewhere */
%type <voidval> access_name
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
%type <voidval> primitive_value
%type <voidval> value_name
%type <voidval> literal
%type <voidval> tuple
%type <voidval> slice
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
%type <voidval> expression_conversion
%type <voidval> value_built_in_routine_call
%type <voidval> parenthesised_expression
%type <voidval> value
%type <voidval> expression
%type <voidval> conditional_expression
%type <voidval> then_alternative
%type <voidval> else_alternative
%type <voidval> operand_0
%type <voidval> operand_1
%type <voidval> operand_2
%type <voidval> operand_3
%type <voidval> operand_4
%type <voidval> operand_5
%type <voidval> operand_6
%type <voidval> expression_list
%type <tval> mode_argument
%type <voidval> single_assignment_action
%type <tsym> mode_name
%type <lval> rparen
/* Not implemented:
%type <voidval> undefined_value
%type <voidval> array_mode_name
%type <voidval> string_mode_name
%type <voidval> variant_structure_mode_name
*/
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
%%
/* Z.200, 5.3.1 */
start : value { }
| mode_name
{ write_exp_elt_opcode(OP_TYPE);
write_exp_elt_type($1.type);
write_exp_elt_opcode(OP_TYPE);}
;
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
value : expression
/*
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
| undefined_value
{ ??? }
*/
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
;
/* Z.200, 4.2.2 */
access_name : LOCATION_NAME
{
write_exp_elt_opcode (OP_VAR_VALUE);
write_exp_elt_block (NULL);
write_exp_elt_sym ($1.sym);
write_exp_elt_opcode (OP_VAR_VALUE);
}
| GDB_LAST /* gdb specific */
{
write_exp_elt_opcode (OP_LAST);
write_exp_elt_longcst ($1);
write_exp_elt_opcode (OP_LAST);
}
| GDB_REGNAME /* gdb specific */
{
write_exp_elt_opcode (OP_REGISTER);
write_exp_elt_longcst ($1);
write_exp_elt_opcode (OP_REGISTER);
}
| GDB_VARIABLE /* gdb specific */
{
write_exp_elt_opcode (OP_INTERNALVAR);
write_exp_elt_intern ($1);
write_exp_elt_opcode (OP_INTERNALVAR);
}
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
;
/* Z.200, 4.2.8 */
expression_list : expression
{
arglist_len = 1;
}
| expression_list ',' expression
{
arglist_len++;
}
;
maybe_expression_list: /* EMPTY */
{
arglist_len = 0;
}
| expression_list
;
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
/* Z.200, 5.2.1 */
primitive_value_lparen: primitive_value '('
/* This is to save the value of arglist_len
being accumulated for each dimension. */
{ start_arglist (); }
;
rparen : ')'
{ $$ = end_arglist (); }
;
primitive_value :
access_name
| primitive_value_lparen maybe_expression_list rparen
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
{
write_exp_elt_opcode (MULTI_SUBSCRIPT);
write_exp_elt_longcst ($3);
write_exp_elt_opcode (MULTI_SUBSCRIPT);
}
| primitive_value FIELD_NAME
{ write_exp_elt_opcode (STRUCTOP_STRUCT);
write_exp_string ($2);
write_exp_elt_opcode (STRUCTOP_STRUCT);
}
| primitive_value POINTER
{
write_exp_elt_opcode (UNOP_IND);
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
}
| primitive_value POINTER mode_name
{
write_exp_elt_opcode (UNOP_CAST);
write_exp_elt_type (lookup_pointer_type ($3.type));
write_exp_elt_opcode (UNOP_CAST);
write_exp_elt_opcode (UNOP_IND);
}
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
| value_name
| literal
| tuple
| slice
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
| expression_conversion
| value_built_in_routine_call
/*
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
| start_expression
{ ??? }
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
| zero_adic_operator
{ ??? }
*/
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
| parenthesised_expression
;
/* Z.200, 5.2.3 */
value_name : GENERAL_PROCEDURE_NAME
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
{
write_exp_elt_opcode (OP_VAR_VALUE);
write_exp_elt_block (NULL);
write_exp_elt_sym ($1.sym);
write_exp_elt_opcode (OP_VAR_VALUE);
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
}
;
/* Z.200, 5.2.4.1 */
literal : INTEGER_LITERAL
{
write_exp_elt_opcode (OP_LONG);
write_exp_elt_type ($1.type);
write_exp_elt_longcst ((LONGEST) ($1.val));
write_exp_elt_opcode (OP_LONG);
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
}
| BOOLEAN_LITERAL
{
write_exp_elt_opcode (OP_BOOL);
write_exp_elt_longcst ((LONGEST) $1);
write_exp_elt_opcode (OP_BOOL);
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
}
| CHARACTER_LITERAL
{
write_exp_elt_opcode (OP_LONG);
write_exp_elt_type ($1.type);
write_exp_elt_longcst ((LONGEST) ($1.val));
write_exp_elt_opcode (OP_LONG);
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
}
| FLOAT_LITERAL
{
write_exp_elt_opcode (OP_DOUBLE);
write_exp_elt_type (builtin_type_double);
write_exp_elt_dblcst ($1);
write_exp_elt_opcode (OP_DOUBLE);
}
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
| EMPTINESS_LITERAL
{
struct type *void_ptr_type
= lookup_pointer_type (builtin_type_void);
write_exp_elt_opcode (OP_LONG);
write_exp_elt_type (void_ptr_type);
write_exp_elt_longcst (0);
write_exp_elt_opcode (OP_LONG);
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
}
| CHARACTER_STRING_LITERAL
{
write_exp_elt_opcode (OP_STRING);
write_exp_string ($1);
write_exp_elt_opcode (OP_STRING);
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
}
| BIT_STRING_LITERAL
{
* defs.h (HOST_CHAR_BIT): New macro, defaults to either CHAR_BIT from a configuration file (typically including <limits.h>), or to TARGET_CHAR_BIT if CHAR_BIT is not defined. * eval.c (evaluate_subexp): Use new BYTES_TO_EXP_ELEM macro. * eval.c (evaluate_subexp): Add case for OP_BITSTRING. * expprint.c (print_subexp): Use new BYTES_TO_EXP_ELEM macro. * exppritn.c (print_subexp, dump_expression): Add case for OP_BITSTRING. * expression.h (OP_BITSTRING): New expression element type for packed bitstrings. * expression.h (EXP_ELEM_TO_BYTES, BYTES_TO_EXP_ELEM): New macros to convert between number of expression elements and bytes to store that many elements. * i960-tdep.c (leafproc_return): Use new macros to access minimal symbol name and address fields. * m88k-pinsn.c (sprint_address): Use new macros to access minimal symbol name and address fields. * nindy-tdep.c (nindy_frame_chain_valid): Use new macro to access minimal symbol address field. * parse.c (write_exp_elt, write_exp_string, prefixify_expression, parse_exp_1): Use new EXP_ELEM_TO_BYTES macro. * parse.c (write_exp_string, length_of_subexp, prefixify_expression): Use new BYTES_TO_EXP_ELEM macro. * parse.c (write_exp_bitstring): New function to write packed bitstrings into the expression element vector. * parse.c (length_of_subexp, prefixify_subexp): Add case for OP_BITSTRING. * parser-defs.h (struct stoken): Document that it is used for OP_BITSTRING as well as OP_STRING. * parser-defs.h (write_exp_bitstring): Add prototype. **** start-sanitize-chill **** * ch-exp.y (BIT_STRING_LITERAL): Change token type to sval. * ch-exp.y (NUM, PRED, SUCC, ABS, CARD, MAX, MIN, SIZE, UPPER, LOWER, LENGTH): New tokens for keywords. * ch-exp.y (chill_value_built_in_routine_call, mode_argument, upper_lower_argument, length_argument, array_mode_name, string_mode_name, variant_structure_mode_name): New non-terminals and productions. * ch-exp.y (literal): Useful production for BIT_STRING_LITERAL. * ch-exp.y (match_bitstring_literal): New lexer support function to recognize bitstring literals. * ch-exp.y (tokentab6): New token table for 6 character keywords. * ch-exp.y (tokentab5): Add LOWER, UPPER. * ch-exp.y (tokentab4): Add PRED, SUCC, CARD, SIZE. * ch-exp.y (tokentab3): Add NUM, ABS, MIN, MAX. * ch-exp.y (yylex): Check tokentab6. * ch-exp.y (yylex): Call match_bitstring_literal. **** end-sanitize-chill ****
1993-01-06 17:52:10 +01:00
write_exp_elt_opcode (OP_BITSTRING);
write_exp_bitstring ($1);
write_exp_elt_opcode (OP_BITSTRING);
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
}
;
/* Z.200, 5.2.5 */
tuple_element : expression
| named_record_element
;
named_record_element: FIELD_NAME ',' named_record_element
{ write_exp_elt_opcode (OP_LABELED);
write_exp_string ($1);
write_exp_elt_opcode (OP_LABELED);
}
| FIELD_NAME ':' expression
{ write_exp_elt_opcode (OP_LABELED);
write_exp_string ($1);
write_exp_elt_opcode (OP_LABELED);
}
;
tuple_elements : tuple_element
{
arglist_len = 1;
}
| tuple_elements ',' tuple_element
{
arglist_len++;
}
;
maybe_tuple_elements : tuple_elements
| /* EMPTY */
;
tuple : '['
{ start_arglist (); }
maybe_tuple_elements ']'
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
{
write_exp_elt_opcode (OP_ARRAY);
write_exp_elt_longcst ((LONGEST) 0);
write_exp_elt_longcst ((LONGEST) end_arglist () - 1);
write_exp_elt_opcode (OP_ARRAY);
}
|
mode_name '['
{ start_arglist (); }
maybe_tuple_elements ']'
{
write_exp_elt_opcode (OP_ARRAY);
write_exp_elt_longcst ((LONGEST) 0);
write_exp_elt_longcst ((LONGEST) end_arglist () - 1);
write_exp_elt_opcode (OP_ARRAY);
write_exp_elt_opcode (UNOP_CAST);
write_exp_elt_type ($1.type);
write_exp_elt_opcode (UNOP_CAST);
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
}
;
/* Z.200, 5.2.6 */
slice: primitive_value_lparen expression ':' expression rparen
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
{
write_exp_elt_opcode (TERNOP_SLICE);
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
}
| primitive_value_lparen expression UP expression rparen
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
{
write_exp_elt_opcode (TERNOP_SLICE_COUNT);
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
}
;
/* Z.200, 5.2.11 */
expression_conversion: mode_name parenthesised_expression
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
{
write_exp_elt_opcode (UNOP_CAST);
write_exp_elt_type ($1.type);
write_exp_elt_opcode (UNOP_CAST);
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
}
| ARRAY '(' ')' mode_name parenthesised_expression
/* This is pseudo-Chill, similar to C's '(TYPE[])EXPR'
which casts to an artificial array. */
{
struct type *range_type
= create_range_type ((struct type *) NULL,
builtin_type_int, 0, 0);
struct type *array_type
= create_array_type ((struct type *) NULL,
$4.type, range_type);
TYPE_ARRAY_UPPER_BOUND_TYPE(array_type)
= BOUND_CANNOT_BE_DETERMINED;
write_exp_elt_opcode (UNOP_CAST);
write_exp_elt_type (array_type);
write_exp_elt_opcode (UNOP_CAST);
}
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
;
/* Z.200, 5.2.16 */
parenthesised_expression: '(' expression ')'
;
/* Z.200, 5.3.2 */
expression : operand_0
| single_assignment_action
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
| conditional_expression
;
conditional_expression : IF expression then_alternative else_alternative FI
{ write_exp_elt_opcode (TERNOP_COND); }
/*
| CASE case_selector_list OF value_case_alternative ELSE expression ESAC
{ error ("not implemented: CASE expression" }
*/
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
;
then_alternative: THEN expression
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
;
else_alternative: ELSE expression
| ELSIF expression then_alternative else_alternative
{ write_exp_elt_opcode (TERNOP_COND); }
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
;
/* Z.200, 5.3.3 */
operand_0 : operand_1
| operand_0 LOGIOR operand_1
{
write_exp_elt_opcode (BINOP_BITWISE_IOR);
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
}
| operand_0 ORIF operand_1
{
write_exp_elt_opcode (BINOP_LOGICAL_OR);
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
}
| operand_0 LOGXOR operand_1
{
write_exp_elt_opcode (BINOP_BITWISE_XOR);
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
}
;
/* Z.200, 5.3.4 */
operand_1 : operand_2
| operand_1 LOGAND operand_2
{
write_exp_elt_opcode (BINOP_BITWISE_AND);
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
}
| operand_1 ANDIF operand_2
{
write_exp_elt_opcode (BINOP_LOGICAL_AND);
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
}
;
/* Z.200, 5.3.5 */
operand_2 : operand_3
| operand_2 '=' operand_3
{
write_exp_elt_opcode (BINOP_EQUAL);
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
}
| operand_2 NOTEQUAL operand_3
{
write_exp_elt_opcode (BINOP_NOTEQUAL);
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
}
| operand_2 '>' operand_3
{
write_exp_elt_opcode (BINOP_GTR);
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
}
| operand_2 GTR operand_3
{
write_exp_elt_opcode (BINOP_GEQ);
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
}
| operand_2 '<' operand_3
{
write_exp_elt_opcode (BINOP_LESS);
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
}
| operand_2 LEQ operand_3
{
write_exp_elt_opcode (BINOP_LEQ);
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
}
| operand_2 IN operand_3
{
write_exp_elt_opcode (BINOP_IN);
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
}
;
/* Z.200, 5.3.6 */
operand_3 : operand_4
| operand_3 '+' operand_4
{
write_exp_elt_opcode (BINOP_ADD);
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
}
| operand_3 '-' operand_4
{
write_exp_elt_opcode (BINOP_SUB);
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
}
| operand_3 SLASH_SLASH operand_4
{
write_exp_elt_opcode (BINOP_CONCAT);
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
}
;
/* Z.200, 5.3.7 */
operand_4 : operand_5
| operand_4 '*' operand_5
{
write_exp_elt_opcode (BINOP_MUL);
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
}
| operand_4 '/' operand_5
{
write_exp_elt_opcode (BINOP_DIV);
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
}
| operand_4 MOD operand_5
{
write_exp_elt_opcode (BINOP_MOD);
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
}
| operand_4 REM operand_5
{
write_exp_elt_opcode (BINOP_REM);
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
}
;
/* Z.200, 5.3.8 */
operand_5 : operand_6
| '-' operand_6
{
write_exp_elt_opcode (UNOP_NEG);
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
}
| NOT operand_6
{
write_exp_elt_opcode (UNOP_LOGICAL_NOT);
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
}
| parenthesised_expression literal
/* We require the string operand to be a literal, to avoid some
nasty parsing ambiguities. */
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
{
write_exp_elt_opcode (BINOP_CONCAT);
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
}
;
/* Z.200, 5.3.9 */
operand_6 : POINTER primitive_value
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
{
write_exp_elt_opcode (UNOP_ADDR);
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
}
| RECEIVE expression
{ error ("not implemented: RECEIVE expression"); }
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
| primitive_value
;
/* Z.200, 6.2 */
* defs.h (HOST_CHAR_BIT): New macro, defaults to either CHAR_BIT from a configuration file (typically including <limits.h>), or to TARGET_CHAR_BIT if CHAR_BIT is not defined. * eval.c (evaluate_subexp): Use new BYTES_TO_EXP_ELEM macro. * eval.c (evaluate_subexp): Add case for OP_BITSTRING. * expprint.c (print_subexp): Use new BYTES_TO_EXP_ELEM macro. * exppritn.c (print_subexp, dump_expression): Add case for OP_BITSTRING. * expression.h (OP_BITSTRING): New expression element type for packed bitstrings. * expression.h (EXP_ELEM_TO_BYTES, BYTES_TO_EXP_ELEM): New macros to convert between number of expression elements and bytes to store that many elements. * i960-tdep.c (leafproc_return): Use new macros to access minimal symbol name and address fields. * m88k-pinsn.c (sprint_address): Use new macros to access minimal symbol name and address fields. * nindy-tdep.c (nindy_frame_chain_valid): Use new macro to access minimal symbol address field. * parse.c (write_exp_elt, write_exp_string, prefixify_expression, parse_exp_1): Use new EXP_ELEM_TO_BYTES macro. * parse.c (write_exp_string, length_of_subexp, prefixify_expression): Use new BYTES_TO_EXP_ELEM macro. * parse.c (write_exp_bitstring): New function to write packed bitstrings into the expression element vector. * parse.c (length_of_subexp, prefixify_subexp): Add case for OP_BITSTRING. * parser-defs.h (struct stoken): Document that it is used for OP_BITSTRING as well as OP_STRING. * parser-defs.h (write_exp_bitstring): Add prototype. **** start-sanitize-chill **** * ch-exp.y (BIT_STRING_LITERAL): Change token type to sval. * ch-exp.y (NUM, PRED, SUCC, ABS, CARD, MAX, MIN, SIZE, UPPER, LOWER, LENGTH): New tokens for keywords. * ch-exp.y (chill_value_built_in_routine_call, mode_argument, upper_lower_argument, length_argument, array_mode_name, string_mode_name, variant_structure_mode_name): New non-terminals and productions. * ch-exp.y (literal): Useful production for BIT_STRING_LITERAL. * ch-exp.y (match_bitstring_literal): New lexer support function to recognize bitstring literals. * ch-exp.y (tokentab6): New token table for 6 character keywords. * ch-exp.y (tokentab5): Add LOWER, UPPER. * ch-exp.y (tokentab4): Add PRED, SUCC, CARD, SIZE. * ch-exp.y (tokentab3): Add NUM, ABS, MIN, MAX. * ch-exp.y (yylex): Check tokentab6. * ch-exp.y (yylex): Call match_bitstring_literal. **** end-sanitize-chill ****
1993-01-06 17:52:10 +01:00
single_assignment_action :
primitive_value GDB_ASSIGNMENT value
{
write_exp_elt_opcode (BINOP_ASSIGN);
}
* defs.h (HOST_CHAR_BIT): New macro, defaults to either CHAR_BIT from a configuration file (typically including <limits.h>), or to TARGET_CHAR_BIT if CHAR_BIT is not defined. * eval.c (evaluate_subexp): Use new BYTES_TO_EXP_ELEM macro. * eval.c (evaluate_subexp): Add case for OP_BITSTRING. * expprint.c (print_subexp): Use new BYTES_TO_EXP_ELEM macro. * exppritn.c (print_subexp, dump_expression): Add case for OP_BITSTRING. * expression.h (OP_BITSTRING): New expression element type for packed bitstrings. * expression.h (EXP_ELEM_TO_BYTES, BYTES_TO_EXP_ELEM): New macros to convert between number of expression elements and bytes to store that many elements. * i960-tdep.c (leafproc_return): Use new macros to access minimal symbol name and address fields. * m88k-pinsn.c (sprint_address): Use new macros to access minimal symbol name and address fields. * nindy-tdep.c (nindy_frame_chain_valid): Use new macro to access minimal symbol address field. * parse.c (write_exp_elt, write_exp_string, prefixify_expression, parse_exp_1): Use new EXP_ELEM_TO_BYTES macro. * parse.c (write_exp_string, length_of_subexp, prefixify_expression): Use new BYTES_TO_EXP_ELEM macro. * parse.c (write_exp_bitstring): New function to write packed bitstrings into the expression element vector. * parse.c (length_of_subexp, prefixify_subexp): Add case for OP_BITSTRING. * parser-defs.h (struct stoken): Document that it is used for OP_BITSTRING as well as OP_STRING. * parser-defs.h (write_exp_bitstring): Add prototype. **** start-sanitize-chill **** * ch-exp.y (BIT_STRING_LITERAL): Change token type to sval. * ch-exp.y (NUM, PRED, SUCC, ABS, CARD, MAX, MIN, SIZE, UPPER, LOWER, LENGTH): New tokens for keywords. * ch-exp.y (chill_value_built_in_routine_call, mode_argument, upper_lower_argument, length_argument, array_mode_name, string_mode_name, variant_structure_mode_name): New non-terminals and productions. * ch-exp.y (literal): Useful production for BIT_STRING_LITERAL. * ch-exp.y (match_bitstring_literal): New lexer support function to recognize bitstring literals. * ch-exp.y (tokentab6): New token table for 6 character keywords. * ch-exp.y (tokentab5): Add LOWER, UPPER. * ch-exp.y (tokentab4): Add PRED, SUCC, CARD, SIZE. * ch-exp.y (tokentab3): Add NUM, ABS, MIN, MAX. * ch-exp.y (yylex): Check tokentab6. * ch-exp.y (yylex): Call match_bitstring_literal. **** end-sanitize-chill ****
1993-01-06 17:52:10 +01:00
;
/* Z.200, 6.20.3 */
value_built_in_routine_call :
* defs.h (HOST_CHAR_BIT): New macro, defaults to either CHAR_BIT from a configuration file (typically including <limits.h>), or to TARGET_CHAR_BIT if CHAR_BIT is not defined. * eval.c (evaluate_subexp): Use new BYTES_TO_EXP_ELEM macro. * eval.c (evaluate_subexp): Add case for OP_BITSTRING. * expprint.c (print_subexp): Use new BYTES_TO_EXP_ELEM macro. * exppritn.c (print_subexp, dump_expression): Add case for OP_BITSTRING. * expression.h (OP_BITSTRING): New expression element type for packed bitstrings. * expression.h (EXP_ELEM_TO_BYTES, BYTES_TO_EXP_ELEM): New macros to convert between number of expression elements and bytes to store that many elements. * i960-tdep.c (leafproc_return): Use new macros to access minimal symbol name and address fields. * m88k-pinsn.c (sprint_address): Use new macros to access minimal symbol name and address fields. * nindy-tdep.c (nindy_frame_chain_valid): Use new macro to access minimal symbol address field. * parse.c (write_exp_elt, write_exp_string, prefixify_expression, parse_exp_1): Use new EXP_ELEM_TO_BYTES macro. * parse.c (write_exp_string, length_of_subexp, prefixify_expression): Use new BYTES_TO_EXP_ELEM macro. * parse.c (write_exp_bitstring): New function to write packed bitstrings into the expression element vector. * parse.c (length_of_subexp, prefixify_subexp): Add case for OP_BITSTRING. * parser-defs.h (struct stoken): Document that it is used for OP_BITSTRING as well as OP_STRING. * parser-defs.h (write_exp_bitstring): Add prototype. **** start-sanitize-chill **** * ch-exp.y (BIT_STRING_LITERAL): Change token type to sval. * ch-exp.y (NUM, PRED, SUCC, ABS, CARD, MAX, MIN, SIZE, UPPER, LOWER, LENGTH): New tokens for keywords. * ch-exp.y (chill_value_built_in_routine_call, mode_argument, upper_lower_argument, length_argument, array_mode_name, string_mode_name, variant_structure_mode_name): New non-terminals and productions. * ch-exp.y (literal): Useful production for BIT_STRING_LITERAL. * ch-exp.y (match_bitstring_literal): New lexer support function to recognize bitstring literals. * ch-exp.y (tokentab6): New token table for 6 character keywords. * ch-exp.y (tokentab5): Add LOWER, UPPER. * ch-exp.y (tokentab4): Add PRED, SUCC, CARD, SIZE. * ch-exp.y (tokentab3): Add NUM, ABS, MIN, MAX. * ch-exp.y (yylex): Check tokentab6. * ch-exp.y (yylex): Call match_bitstring_literal. **** end-sanitize-chill ****
1993-01-06 17:52:10 +01:00
NUM '(' expression ')'
{
write_exp_elt_opcode (UNOP_CAST);
write_exp_elt_type (builtin_type_int);
write_exp_elt_opcode (UNOP_CAST);
* defs.h (HOST_CHAR_BIT): New macro, defaults to either CHAR_BIT from a configuration file (typically including <limits.h>), or to TARGET_CHAR_BIT if CHAR_BIT is not defined. * eval.c (evaluate_subexp): Use new BYTES_TO_EXP_ELEM macro. * eval.c (evaluate_subexp): Add case for OP_BITSTRING. * expprint.c (print_subexp): Use new BYTES_TO_EXP_ELEM macro. * exppritn.c (print_subexp, dump_expression): Add case for OP_BITSTRING. * expression.h (OP_BITSTRING): New expression element type for packed bitstrings. * expression.h (EXP_ELEM_TO_BYTES, BYTES_TO_EXP_ELEM): New macros to convert between number of expression elements and bytes to store that many elements. * i960-tdep.c (leafproc_return): Use new macros to access minimal symbol name and address fields. * m88k-pinsn.c (sprint_address): Use new macros to access minimal symbol name and address fields. * nindy-tdep.c (nindy_frame_chain_valid): Use new macro to access minimal symbol address field. * parse.c (write_exp_elt, write_exp_string, prefixify_expression, parse_exp_1): Use new EXP_ELEM_TO_BYTES macro. * parse.c (write_exp_string, length_of_subexp, prefixify_expression): Use new BYTES_TO_EXP_ELEM macro. * parse.c (write_exp_bitstring): New function to write packed bitstrings into the expression element vector. * parse.c (length_of_subexp, prefixify_subexp): Add case for OP_BITSTRING. * parser-defs.h (struct stoken): Document that it is used for OP_BITSTRING as well as OP_STRING. * parser-defs.h (write_exp_bitstring): Add prototype. **** start-sanitize-chill **** * ch-exp.y (BIT_STRING_LITERAL): Change token type to sval. * ch-exp.y (NUM, PRED, SUCC, ABS, CARD, MAX, MIN, SIZE, UPPER, LOWER, LENGTH): New tokens for keywords. * ch-exp.y (chill_value_built_in_routine_call, mode_argument, upper_lower_argument, length_argument, array_mode_name, string_mode_name, variant_structure_mode_name): New non-terminals and productions. * ch-exp.y (literal): Useful production for BIT_STRING_LITERAL. * ch-exp.y (match_bitstring_literal): New lexer support function to recognize bitstring literals. * ch-exp.y (tokentab6): New token table for 6 character keywords. * ch-exp.y (tokentab5): Add LOWER, UPPER. * ch-exp.y (tokentab4): Add PRED, SUCC, CARD, SIZE. * ch-exp.y (tokentab3): Add NUM, ABS, MIN, MAX. * ch-exp.y (yylex): Check tokentab6. * ch-exp.y (yylex): Call match_bitstring_literal. **** end-sanitize-chill ****
1993-01-06 17:52:10 +01:00
}
| PRED '(' expression ')'
{ error ("not implemented: PRED builtin function"); }
* defs.h (HOST_CHAR_BIT): New macro, defaults to either CHAR_BIT from a configuration file (typically including <limits.h>), or to TARGET_CHAR_BIT if CHAR_BIT is not defined. * eval.c (evaluate_subexp): Use new BYTES_TO_EXP_ELEM macro. * eval.c (evaluate_subexp): Add case for OP_BITSTRING. * expprint.c (print_subexp): Use new BYTES_TO_EXP_ELEM macro. * exppritn.c (print_subexp, dump_expression): Add case for OP_BITSTRING. * expression.h (OP_BITSTRING): New expression element type for packed bitstrings. * expression.h (EXP_ELEM_TO_BYTES, BYTES_TO_EXP_ELEM): New macros to convert between number of expression elements and bytes to store that many elements. * i960-tdep.c (leafproc_return): Use new macros to access minimal symbol name and address fields. * m88k-pinsn.c (sprint_address): Use new macros to access minimal symbol name and address fields. * nindy-tdep.c (nindy_frame_chain_valid): Use new macro to access minimal symbol address field. * parse.c (write_exp_elt, write_exp_string, prefixify_expression, parse_exp_1): Use new EXP_ELEM_TO_BYTES macro. * parse.c (write_exp_string, length_of_subexp, prefixify_expression): Use new BYTES_TO_EXP_ELEM macro. * parse.c (write_exp_bitstring): New function to write packed bitstrings into the expression element vector. * parse.c (length_of_subexp, prefixify_subexp): Add case for OP_BITSTRING. * parser-defs.h (struct stoken): Document that it is used for OP_BITSTRING as well as OP_STRING. * parser-defs.h (write_exp_bitstring): Add prototype. **** start-sanitize-chill **** * ch-exp.y (BIT_STRING_LITERAL): Change token type to sval. * ch-exp.y (NUM, PRED, SUCC, ABS, CARD, MAX, MIN, SIZE, UPPER, LOWER, LENGTH): New tokens for keywords. * ch-exp.y (chill_value_built_in_routine_call, mode_argument, upper_lower_argument, length_argument, array_mode_name, string_mode_name, variant_structure_mode_name): New non-terminals and productions. * ch-exp.y (literal): Useful production for BIT_STRING_LITERAL. * ch-exp.y (match_bitstring_literal): New lexer support function to recognize bitstring literals. * ch-exp.y (tokentab6): New token table for 6 character keywords. * ch-exp.y (tokentab5): Add LOWER, UPPER. * ch-exp.y (tokentab4): Add PRED, SUCC, CARD, SIZE. * ch-exp.y (tokentab3): Add NUM, ABS, MIN, MAX. * ch-exp.y (yylex): Check tokentab6. * ch-exp.y (yylex): Call match_bitstring_literal. **** end-sanitize-chill ****
1993-01-06 17:52:10 +01:00
| SUCC '(' expression ')'
{ error ("not implemented: SUCC builtin function"); }
| ADDR_TOKEN '(' expression ')'
{ write_exp_elt_opcode (UNOP_ADDR); }
* defs.h (HOST_CHAR_BIT): New macro, defaults to either CHAR_BIT from a configuration file (typically including <limits.h>), or to TARGET_CHAR_BIT if CHAR_BIT is not defined. * eval.c (evaluate_subexp): Use new BYTES_TO_EXP_ELEM macro. * eval.c (evaluate_subexp): Add case for OP_BITSTRING. * expprint.c (print_subexp): Use new BYTES_TO_EXP_ELEM macro. * exppritn.c (print_subexp, dump_expression): Add case for OP_BITSTRING. * expression.h (OP_BITSTRING): New expression element type for packed bitstrings. * expression.h (EXP_ELEM_TO_BYTES, BYTES_TO_EXP_ELEM): New macros to convert between number of expression elements and bytes to store that many elements. * i960-tdep.c (leafproc_return): Use new macros to access minimal symbol name and address fields. * m88k-pinsn.c (sprint_address): Use new macros to access minimal symbol name and address fields. * nindy-tdep.c (nindy_frame_chain_valid): Use new macro to access minimal symbol address field. * parse.c (write_exp_elt, write_exp_string, prefixify_expression, parse_exp_1): Use new EXP_ELEM_TO_BYTES macro. * parse.c (write_exp_string, length_of_subexp, prefixify_expression): Use new BYTES_TO_EXP_ELEM macro. * parse.c (write_exp_bitstring): New function to write packed bitstrings into the expression element vector. * parse.c (length_of_subexp, prefixify_subexp): Add case for OP_BITSTRING. * parser-defs.h (struct stoken): Document that it is used for OP_BITSTRING as well as OP_STRING. * parser-defs.h (write_exp_bitstring): Add prototype. **** start-sanitize-chill **** * ch-exp.y (BIT_STRING_LITERAL): Change token type to sval. * ch-exp.y (NUM, PRED, SUCC, ABS, CARD, MAX, MIN, SIZE, UPPER, LOWER, LENGTH): New tokens for keywords. * ch-exp.y (chill_value_built_in_routine_call, mode_argument, upper_lower_argument, length_argument, array_mode_name, string_mode_name, variant_structure_mode_name): New non-terminals and productions. * ch-exp.y (literal): Useful production for BIT_STRING_LITERAL. * ch-exp.y (match_bitstring_literal): New lexer support function to recognize bitstring literals. * ch-exp.y (tokentab6): New token table for 6 character keywords. * ch-exp.y (tokentab5): Add LOWER, UPPER. * ch-exp.y (tokentab4): Add PRED, SUCC, CARD, SIZE. * ch-exp.y (tokentab3): Add NUM, ABS, MIN, MAX. * ch-exp.y (yylex): Check tokentab6. * ch-exp.y (yylex): Call match_bitstring_literal. **** end-sanitize-chill ****
1993-01-06 17:52:10 +01:00
| ABS '(' expression ')'
{ error ("not implemented: ABS builtin function"); }
* defs.h (HOST_CHAR_BIT): New macro, defaults to either CHAR_BIT from a configuration file (typically including <limits.h>), or to TARGET_CHAR_BIT if CHAR_BIT is not defined. * eval.c (evaluate_subexp): Use new BYTES_TO_EXP_ELEM macro. * eval.c (evaluate_subexp): Add case for OP_BITSTRING. * expprint.c (print_subexp): Use new BYTES_TO_EXP_ELEM macro. * exppritn.c (print_subexp, dump_expression): Add case for OP_BITSTRING. * expression.h (OP_BITSTRING): New expression element type for packed bitstrings. * expression.h (EXP_ELEM_TO_BYTES, BYTES_TO_EXP_ELEM): New macros to convert between number of expression elements and bytes to store that many elements. * i960-tdep.c (leafproc_return): Use new macros to access minimal symbol name and address fields. * m88k-pinsn.c (sprint_address): Use new macros to access minimal symbol name and address fields. * nindy-tdep.c (nindy_frame_chain_valid): Use new macro to access minimal symbol address field. * parse.c (write_exp_elt, write_exp_string, prefixify_expression, parse_exp_1): Use new EXP_ELEM_TO_BYTES macro. * parse.c (write_exp_string, length_of_subexp, prefixify_expression): Use new BYTES_TO_EXP_ELEM macro. * parse.c (write_exp_bitstring): New function to write packed bitstrings into the expression element vector. * parse.c (length_of_subexp, prefixify_subexp): Add case for OP_BITSTRING. * parser-defs.h (struct stoken): Document that it is used for OP_BITSTRING as well as OP_STRING. * parser-defs.h (write_exp_bitstring): Add prototype. **** start-sanitize-chill **** * ch-exp.y (BIT_STRING_LITERAL): Change token type to sval. * ch-exp.y (NUM, PRED, SUCC, ABS, CARD, MAX, MIN, SIZE, UPPER, LOWER, LENGTH): New tokens for keywords. * ch-exp.y (chill_value_built_in_routine_call, mode_argument, upper_lower_argument, length_argument, array_mode_name, string_mode_name, variant_structure_mode_name): New non-terminals and productions. * ch-exp.y (literal): Useful production for BIT_STRING_LITERAL. * ch-exp.y (match_bitstring_literal): New lexer support function to recognize bitstring literals. * ch-exp.y (tokentab6): New token table for 6 character keywords. * ch-exp.y (tokentab5): Add LOWER, UPPER. * ch-exp.y (tokentab4): Add PRED, SUCC, CARD, SIZE. * ch-exp.y (tokentab3): Add NUM, ABS, MIN, MAX. * ch-exp.y (yylex): Check tokentab6. * ch-exp.y (yylex): Call match_bitstring_literal. **** end-sanitize-chill ****
1993-01-06 17:52:10 +01:00
| CARD '(' expression ')'
{ error ("not implemented: CARD builtin function"); }
| MAX_TOKEN '(' expression ')'
{ error ("not implemented: MAX builtin function"); }
| MIN_TOKEN '(' expression ')'
{ error ("not implemented: MIN builtin function"); }
| SIZE '(' expression ')'
{ write_exp_elt_opcode (UNOP_SIZEOF); }
* defs.h (HOST_CHAR_BIT): New macro, defaults to either CHAR_BIT from a configuration file (typically including <limits.h>), or to TARGET_CHAR_BIT if CHAR_BIT is not defined. * eval.c (evaluate_subexp): Use new BYTES_TO_EXP_ELEM macro. * eval.c (evaluate_subexp): Add case for OP_BITSTRING. * expprint.c (print_subexp): Use new BYTES_TO_EXP_ELEM macro. * exppritn.c (print_subexp, dump_expression): Add case for OP_BITSTRING. * expression.h (OP_BITSTRING): New expression element type for packed bitstrings. * expression.h (EXP_ELEM_TO_BYTES, BYTES_TO_EXP_ELEM): New macros to convert between number of expression elements and bytes to store that many elements. * i960-tdep.c (leafproc_return): Use new macros to access minimal symbol name and address fields. * m88k-pinsn.c (sprint_address): Use new macros to access minimal symbol name and address fields. * nindy-tdep.c (nindy_frame_chain_valid): Use new macro to access minimal symbol address field. * parse.c (write_exp_elt, write_exp_string, prefixify_expression, parse_exp_1): Use new EXP_ELEM_TO_BYTES macro. * parse.c (write_exp_string, length_of_subexp, prefixify_expression): Use new BYTES_TO_EXP_ELEM macro. * parse.c (write_exp_bitstring): New function to write packed bitstrings into the expression element vector. * parse.c (length_of_subexp, prefixify_subexp): Add case for OP_BITSTRING. * parser-defs.h (struct stoken): Document that it is used for OP_BITSTRING as well as OP_STRING. * parser-defs.h (write_exp_bitstring): Add prototype. **** start-sanitize-chill **** * ch-exp.y (BIT_STRING_LITERAL): Change token type to sval. * ch-exp.y (NUM, PRED, SUCC, ABS, CARD, MAX, MIN, SIZE, UPPER, LOWER, LENGTH): New tokens for keywords. * ch-exp.y (chill_value_built_in_routine_call, mode_argument, upper_lower_argument, length_argument, array_mode_name, string_mode_name, variant_structure_mode_name): New non-terminals and productions. * ch-exp.y (literal): Useful production for BIT_STRING_LITERAL. * ch-exp.y (match_bitstring_literal): New lexer support function to recognize bitstring literals. * ch-exp.y (tokentab6): New token table for 6 character keywords. * ch-exp.y (tokentab5): Add LOWER, UPPER. * ch-exp.y (tokentab4): Add PRED, SUCC, CARD, SIZE. * ch-exp.y (tokentab3): Add NUM, ABS, MIN, MAX. * ch-exp.y (yylex): Check tokentab6. * ch-exp.y (yylex): Call match_bitstring_literal. **** end-sanitize-chill ****
1993-01-06 17:52:10 +01:00
| SIZE '(' mode_argument ')'
{ write_exp_elt_opcode (OP_LONG);
write_exp_elt_type (builtin_type_int);
write_exp_elt_longcst ((LONGEST) TYPE_LENGTH ($3));
write_exp_elt_opcode (OP_LONG); }
| LOWER '(' mode_argument ')'
{ write_lower_upper_value (UNOP_LOWER, $3); }
| UPPER '(' mode_argument ')'
{ write_lower_upper_value (UNOP_UPPER, $3); }
| LOWER '(' expression ')'
{ write_exp_elt_opcode (UNOP_LOWER); }
| UPPER '(' expression ')'
{ write_exp_elt_opcode (UNOP_UPPER); }
| LENGTH '(' expression ')'
{ write_exp_elt_opcode (UNOP_LENGTH); }
* defs.h (HOST_CHAR_BIT): New macro, defaults to either CHAR_BIT from a configuration file (typically including <limits.h>), or to TARGET_CHAR_BIT if CHAR_BIT is not defined. * eval.c (evaluate_subexp): Use new BYTES_TO_EXP_ELEM macro. * eval.c (evaluate_subexp): Add case for OP_BITSTRING. * expprint.c (print_subexp): Use new BYTES_TO_EXP_ELEM macro. * exppritn.c (print_subexp, dump_expression): Add case for OP_BITSTRING. * expression.h (OP_BITSTRING): New expression element type for packed bitstrings. * expression.h (EXP_ELEM_TO_BYTES, BYTES_TO_EXP_ELEM): New macros to convert between number of expression elements and bytes to store that many elements. * i960-tdep.c (leafproc_return): Use new macros to access minimal symbol name and address fields. * m88k-pinsn.c (sprint_address): Use new macros to access minimal symbol name and address fields. * nindy-tdep.c (nindy_frame_chain_valid): Use new macro to access minimal symbol address field. * parse.c (write_exp_elt, write_exp_string, prefixify_expression, parse_exp_1): Use new EXP_ELEM_TO_BYTES macro. * parse.c (write_exp_string, length_of_subexp, prefixify_expression): Use new BYTES_TO_EXP_ELEM macro. * parse.c (write_exp_bitstring): New function to write packed bitstrings into the expression element vector. * parse.c (length_of_subexp, prefixify_subexp): Add case for OP_BITSTRING. * parser-defs.h (struct stoken): Document that it is used for OP_BITSTRING as well as OP_STRING. * parser-defs.h (write_exp_bitstring): Add prototype. **** start-sanitize-chill **** * ch-exp.y (BIT_STRING_LITERAL): Change token type to sval. * ch-exp.y (NUM, PRED, SUCC, ABS, CARD, MAX, MIN, SIZE, UPPER, LOWER, LENGTH): New tokens for keywords. * ch-exp.y (chill_value_built_in_routine_call, mode_argument, upper_lower_argument, length_argument, array_mode_name, string_mode_name, variant_structure_mode_name): New non-terminals and productions. * ch-exp.y (literal): Useful production for BIT_STRING_LITERAL. * ch-exp.y (match_bitstring_literal): New lexer support function to recognize bitstring literals. * ch-exp.y (tokentab6): New token table for 6 character keywords. * ch-exp.y (tokentab5): Add LOWER, UPPER. * ch-exp.y (tokentab4): Add PRED, SUCC, CARD, SIZE. * ch-exp.y (tokentab3): Add NUM, ABS, MIN, MAX. * ch-exp.y (yylex): Check tokentab6. * ch-exp.y (yylex): Call match_bitstring_literal. **** end-sanitize-chill ****
1993-01-06 17:52:10 +01:00
;
mode_argument : mode_name
{
$$ = $1.type;
* defs.h (HOST_CHAR_BIT): New macro, defaults to either CHAR_BIT from a configuration file (typically including <limits.h>), or to TARGET_CHAR_BIT if CHAR_BIT is not defined. * eval.c (evaluate_subexp): Use new BYTES_TO_EXP_ELEM macro. * eval.c (evaluate_subexp): Add case for OP_BITSTRING. * expprint.c (print_subexp): Use new BYTES_TO_EXP_ELEM macro. * exppritn.c (print_subexp, dump_expression): Add case for OP_BITSTRING. * expression.h (OP_BITSTRING): New expression element type for packed bitstrings. * expression.h (EXP_ELEM_TO_BYTES, BYTES_TO_EXP_ELEM): New macros to convert between number of expression elements and bytes to store that many elements. * i960-tdep.c (leafproc_return): Use new macros to access minimal symbol name and address fields. * m88k-pinsn.c (sprint_address): Use new macros to access minimal symbol name and address fields. * nindy-tdep.c (nindy_frame_chain_valid): Use new macro to access minimal symbol address field. * parse.c (write_exp_elt, write_exp_string, prefixify_expression, parse_exp_1): Use new EXP_ELEM_TO_BYTES macro. * parse.c (write_exp_string, length_of_subexp, prefixify_expression): Use new BYTES_TO_EXP_ELEM macro. * parse.c (write_exp_bitstring): New function to write packed bitstrings into the expression element vector. * parse.c (length_of_subexp, prefixify_subexp): Add case for OP_BITSTRING. * parser-defs.h (struct stoken): Document that it is used for OP_BITSTRING as well as OP_STRING. * parser-defs.h (write_exp_bitstring): Add prototype. **** start-sanitize-chill **** * ch-exp.y (BIT_STRING_LITERAL): Change token type to sval. * ch-exp.y (NUM, PRED, SUCC, ABS, CARD, MAX, MIN, SIZE, UPPER, LOWER, LENGTH): New tokens for keywords. * ch-exp.y (chill_value_built_in_routine_call, mode_argument, upper_lower_argument, length_argument, array_mode_name, string_mode_name, variant_structure_mode_name): New non-terminals and productions. * ch-exp.y (literal): Useful production for BIT_STRING_LITERAL. * ch-exp.y (match_bitstring_literal): New lexer support function to recognize bitstring literals. * ch-exp.y (tokentab6): New token table for 6 character keywords. * ch-exp.y (tokentab5): Add LOWER, UPPER. * ch-exp.y (tokentab4): Add PRED, SUCC, CARD, SIZE. * ch-exp.y (tokentab3): Add NUM, ABS, MIN, MAX. * ch-exp.y (yylex): Check tokentab6. * ch-exp.y (yylex): Call match_bitstring_literal. **** end-sanitize-chill ****
1993-01-06 17:52:10 +01:00
}
/*
* defs.h (HOST_CHAR_BIT): New macro, defaults to either CHAR_BIT from a configuration file (typically including <limits.h>), or to TARGET_CHAR_BIT if CHAR_BIT is not defined. * eval.c (evaluate_subexp): Use new BYTES_TO_EXP_ELEM macro. * eval.c (evaluate_subexp): Add case for OP_BITSTRING. * expprint.c (print_subexp): Use new BYTES_TO_EXP_ELEM macro. * exppritn.c (print_subexp, dump_expression): Add case for OP_BITSTRING. * expression.h (OP_BITSTRING): New expression element type for packed bitstrings. * expression.h (EXP_ELEM_TO_BYTES, BYTES_TO_EXP_ELEM): New macros to convert between number of expression elements and bytes to store that many elements. * i960-tdep.c (leafproc_return): Use new macros to access minimal symbol name and address fields. * m88k-pinsn.c (sprint_address): Use new macros to access minimal symbol name and address fields. * nindy-tdep.c (nindy_frame_chain_valid): Use new macro to access minimal symbol address field. * parse.c (write_exp_elt, write_exp_string, prefixify_expression, parse_exp_1): Use new EXP_ELEM_TO_BYTES macro. * parse.c (write_exp_string, length_of_subexp, prefixify_expression): Use new BYTES_TO_EXP_ELEM macro. * parse.c (write_exp_bitstring): New function to write packed bitstrings into the expression element vector. * parse.c (length_of_subexp, prefixify_subexp): Add case for OP_BITSTRING. * parser-defs.h (struct stoken): Document that it is used for OP_BITSTRING as well as OP_STRING. * parser-defs.h (write_exp_bitstring): Add prototype. **** start-sanitize-chill **** * ch-exp.y (BIT_STRING_LITERAL): Change token type to sval. * ch-exp.y (NUM, PRED, SUCC, ABS, CARD, MAX, MIN, SIZE, UPPER, LOWER, LENGTH): New tokens for keywords. * ch-exp.y (chill_value_built_in_routine_call, mode_argument, upper_lower_argument, length_argument, array_mode_name, string_mode_name, variant_structure_mode_name): New non-terminals and productions. * ch-exp.y (literal): Useful production for BIT_STRING_LITERAL. * ch-exp.y (match_bitstring_literal): New lexer support function to recognize bitstring literals. * ch-exp.y (tokentab6): New token table for 6 character keywords. * ch-exp.y (tokentab5): Add LOWER, UPPER. * ch-exp.y (tokentab4): Add PRED, SUCC, CARD, SIZE. * ch-exp.y (tokentab3): Add NUM, ABS, MIN, MAX. * ch-exp.y (yylex): Check tokentab6. * ch-exp.y (yylex): Call match_bitstring_literal. **** end-sanitize-chill ****
1993-01-06 17:52:10 +01:00
| array_mode_name '(' expression ')'
{ ??? }
* defs.h (HOST_CHAR_BIT): New macro, defaults to either CHAR_BIT from a configuration file (typically including <limits.h>), or to TARGET_CHAR_BIT if CHAR_BIT is not defined. * eval.c (evaluate_subexp): Use new BYTES_TO_EXP_ELEM macro. * eval.c (evaluate_subexp): Add case for OP_BITSTRING. * expprint.c (print_subexp): Use new BYTES_TO_EXP_ELEM macro. * exppritn.c (print_subexp, dump_expression): Add case for OP_BITSTRING. * expression.h (OP_BITSTRING): New expression element type for packed bitstrings. * expression.h (EXP_ELEM_TO_BYTES, BYTES_TO_EXP_ELEM): New macros to convert between number of expression elements and bytes to store that many elements. * i960-tdep.c (leafproc_return): Use new macros to access minimal symbol name and address fields. * m88k-pinsn.c (sprint_address): Use new macros to access minimal symbol name and address fields. * nindy-tdep.c (nindy_frame_chain_valid): Use new macro to access minimal symbol address field. * parse.c (write_exp_elt, write_exp_string, prefixify_expression, parse_exp_1): Use new EXP_ELEM_TO_BYTES macro. * parse.c (write_exp_string, length_of_subexp, prefixify_expression): Use new BYTES_TO_EXP_ELEM macro. * parse.c (write_exp_bitstring): New function to write packed bitstrings into the expression element vector. * parse.c (length_of_subexp, prefixify_subexp): Add case for OP_BITSTRING. * parser-defs.h (struct stoken): Document that it is used for OP_BITSTRING as well as OP_STRING. * parser-defs.h (write_exp_bitstring): Add prototype. **** start-sanitize-chill **** * ch-exp.y (BIT_STRING_LITERAL): Change token type to sval. * ch-exp.y (NUM, PRED, SUCC, ABS, CARD, MAX, MIN, SIZE, UPPER, LOWER, LENGTH): New tokens for keywords. * ch-exp.y (chill_value_built_in_routine_call, mode_argument, upper_lower_argument, length_argument, array_mode_name, string_mode_name, variant_structure_mode_name): New non-terminals and productions. * ch-exp.y (literal): Useful production for BIT_STRING_LITERAL. * ch-exp.y (match_bitstring_literal): New lexer support function to recognize bitstring literals. * ch-exp.y (tokentab6): New token table for 6 character keywords. * ch-exp.y (tokentab5): Add LOWER, UPPER. * ch-exp.y (tokentab4): Add PRED, SUCC, CARD, SIZE. * ch-exp.y (tokentab3): Add NUM, ABS, MIN, MAX. * ch-exp.y (yylex): Check tokentab6. * ch-exp.y (yylex): Call match_bitstring_literal. **** end-sanitize-chill ****
1993-01-06 17:52:10 +01:00
| string_mode_name '(' expression ')'
{ ??? }
* defs.h (HOST_CHAR_BIT): New macro, defaults to either CHAR_BIT from a configuration file (typically including <limits.h>), or to TARGET_CHAR_BIT if CHAR_BIT is not defined. * eval.c (evaluate_subexp): Use new BYTES_TO_EXP_ELEM macro. * eval.c (evaluate_subexp): Add case for OP_BITSTRING. * expprint.c (print_subexp): Use new BYTES_TO_EXP_ELEM macro. * exppritn.c (print_subexp, dump_expression): Add case for OP_BITSTRING. * expression.h (OP_BITSTRING): New expression element type for packed bitstrings. * expression.h (EXP_ELEM_TO_BYTES, BYTES_TO_EXP_ELEM): New macros to convert between number of expression elements and bytes to store that many elements. * i960-tdep.c (leafproc_return): Use new macros to access minimal symbol name and address fields. * m88k-pinsn.c (sprint_address): Use new macros to access minimal symbol name and address fields. * nindy-tdep.c (nindy_frame_chain_valid): Use new macro to access minimal symbol address field. * parse.c (write_exp_elt, write_exp_string, prefixify_expression, parse_exp_1): Use new EXP_ELEM_TO_BYTES macro. * parse.c (write_exp_string, length_of_subexp, prefixify_expression): Use new BYTES_TO_EXP_ELEM macro. * parse.c (write_exp_bitstring): New function to write packed bitstrings into the expression element vector. * parse.c (length_of_subexp, prefixify_subexp): Add case for OP_BITSTRING. * parser-defs.h (struct stoken): Document that it is used for OP_BITSTRING as well as OP_STRING. * parser-defs.h (write_exp_bitstring): Add prototype. **** start-sanitize-chill **** * ch-exp.y (BIT_STRING_LITERAL): Change token type to sval. * ch-exp.y (NUM, PRED, SUCC, ABS, CARD, MAX, MIN, SIZE, UPPER, LOWER, LENGTH): New tokens for keywords. * ch-exp.y (chill_value_built_in_routine_call, mode_argument, upper_lower_argument, length_argument, array_mode_name, string_mode_name, variant_structure_mode_name): New non-terminals and productions. * ch-exp.y (literal): Useful production for BIT_STRING_LITERAL. * ch-exp.y (match_bitstring_literal): New lexer support function to recognize bitstring literals. * ch-exp.y (tokentab6): New token table for 6 character keywords. * ch-exp.y (tokentab5): Add LOWER, UPPER. * ch-exp.y (tokentab4): Add PRED, SUCC, CARD, SIZE. * ch-exp.y (tokentab3): Add NUM, ABS, MIN, MAX. * ch-exp.y (yylex): Check tokentab6. * ch-exp.y (yylex): Call match_bitstring_literal. **** end-sanitize-chill ****
1993-01-06 17:52:10 +01:00
| variant_structure_mode_name '(' expression_list ')'
{ ??? }
*/
* defs.h (HOST_CHAR_BIT): New macro, defaults to either CHAR_BIT from a configuration file (typically including <limits.h>), or to TARGET_CHAR_BIT if CHAR_BIT is not defined. * eval.c (evaluate_subexp): Use new BYTES_TO_EXP_ELEM macro. * eval.c (evaluate_subexp): Add case for OP_BITSTRING. * expprint.c (print_subexp): Use new BYTES_TO_EXP_ELEM macro. * exppritn.c (print_subexp, dump_expression): Add case for OP_BITSTRING. * expression.h (OP_BITSTRING): New expression element type for packed bitstrings. * expression.h (EXP_ELEM_TO_BYTES, BYTES_TO_EXP_ELEM): New macros to convert between number of expression elements and bytes to store that many elements. * i960-tdep.c (leafproc_return): Use new macros to access minimal symbol name and address fields. * m88k-pinsn.c (sprint_address): Use new macros to access minimal symbol name and address fields. * nindy-tdep.c (nindy_frame_chain_valid): Use new macro to access minimal symbol address field. * parse.c (write_exp_elt, write_exp_string, prefixify_expression, parse_exp_1): Use new EXP_ELEM_TO_BYTES macro. * parse.c (write_exp_string, length_of_subexp, prefixify_expression): Use new BYTES_TO_EXP_ELEM macro. * parse.c (write_exp_bitstring): New function to write packed bitstrings into the expression element vector. * parse.c (length_of_subexp, prefixify_subexp): Add case for OP_BITSTRING. * parser-defs.h (struct stoken): Document that it is used for OP_BITSTRING as well as OP_STRING. * parser-defs.h (write_exp_bitstring): Add prototype. **** start-sanitize-chill **** * ch-exp.y (BIT_STRING_LITERAL): Change token type to sval. * ch-exp.y (NUM, PRED, SUCC, ABS, CARD, MAX, MIN, SIZE, UPPER, LOWER, LENGTH): New tokens for keywords. * ch-exp.y (chill_value_built_in_routine_call, mode_argument, upper_lower_argument, length_argument, array_mode_name, string_mode_name, variant_structure_mode_name): New non-terminals and productions. * ch-exp.y (literal): Useful production for BIT_STRING_LITERAL. * ch-exp.y (match_bitstring_literal): New lexer support function to recognize bitstring literals. * ch-exp.y (tokentab6): New token table for 6 character keywords. * ch-exp.y (tokentab5): Add LOWER, UPPER. * ch-exp.y (tokentab4): Add PRED, SUCC, CARD, SIZE. * ch-exp.y (tokentab3): Add NUM, ABS, MIN, MAX. * ch-exp.y (yylex): Check tokentab6. * ch-exp.y (yylex): Call match_bitstring_literal. **** end-sanitize-chill ****
1993-01-06 17:52:10 +01:00
;
mode_name : TYPENAME
;
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
%%
/* Implementation of a dynamically expandable buffer for processing input
characters acquired through lexptr and building a value to return in
yylval. */
static char *tempbuf; /* Current buffer contents */
static int tempbufsize; /* Size of allocated buffer */
static int tempbufindex; /* Current index into buffer */
#define GROWBY_MIN_SIZE 64 /* Minimum amount to grow buffer by */
#define CHECKBUF(size) \
do { \
if (tempbufindex + (size) >= tempbufsize) \
{ \
growbuf_by_size (size); \
} \
} while (0);
/* Grow the static temp buffer if necessary, including allocating the first one
on demand. */
static void
growbuf_by_size (count)
int count;
{
int growby;
growby = max (count, GROWBY_MIN_SIZE);
tempbufsize += growby;
if (tempbuf == NULL)
{
tempbuf = (char *) malloc (tempbufsize);
}
else
{
tempbuf = (char *) realloc (tempbuf, tempbufsize);
}
}
/* Try to consume a simple name string token. If successful, returns
a pointer to a nullbyte terminated copy of the name that can be used
in symbol table lookups. If not successful, returns NULL. */
static char *
match_simple_name_string ()
{
char *tokptr = lexptr;
if (isalpha (*tokptr) || *tokptr == '_')
{
char *result;
do {
tokptr++;
} while (isalnum (*tokptr) || (*tokptr == '_'));
yylval.sval.ptr = lexptr;
yylval.sval.length = tokptr - lexptr;
lexptr = tokptr;
result = copy_name (yylval.sval);
return result;
}
return (NULL);
}
* defs.h (sevenbit_strings): Add declaration. * defs.h (printchar): Replace with gdb_printchar. * language.h (language_defn): Add new function pointers la_printchar and la_printstr, to do language dependent printing of characters and strings. * language.h (local_printchar, local_printstr): New macros to call language dependent functions pointed to by la_printchar and la_printstr respectively. * c-exp.y (emit_char, c_printchar, c_printstr): New language dependent functions for printing characters and strings. * c-exp.y (c_language_defn, cplus_language_defn): Add c_printchar and c_printstr. * command.c (do_setshow_command): Rename printchar use to gdb_printchar. * expprint.c (print_subexp): Replace C style string output with call to local_printstr. * language.c (unk_lang_printchar, unk_lang_printstr): New stubs, currently errors. * language.c (unknown_language_defn, auto_language_defn, local_language_defn): Add unk_lang_printchar and unk_lang_printstr. * m2-exp.y (emit_char, m2_printchar, m2_printstr): New language dependent functions to print characters and strings. * m2-exp.y (m2_language_defn): Add m2_printchar and m2_printstr. * utils.c (printchar): Renamed to gdb_printchar. * valprint.c (print_string): Remove prototype, function moved to c-exp.y, where it becomes c_printstr. * valprint.c (print_max): Made global for reference from the language dependent printing routines in *-exp.y. * valprint.c (repeat_count_threshold): New variable with function of old REPEAT_COUNT_THREHOLD define, but now settable by user. Change all references to old macro to references to new variable. * valprint.c (value_print, val_print): Replace calls to print_string with calls to local_printstr. * valprint.c (val_print): Replace C style character printing with call to local_printchar. * valprint.c (val_print): Add case for TYPE_CODE_CHAR. * valprint.c (_initialize_valprint): Add add_show_from_set call for setting up repeat_count_threshold as print variable. **** start-sanitize-chill **** * ch-exp.y (decode_integer_value): New function. * ch-exp.y (decode_integer_literal): Use decode_integer_value. * ch-exp.y (chill_printchar, chill_printstr): New language dependent functions for printing characters and strings. * ch-exp.y (chill_language_defn): Add chill_printchar and chill_printstr. **** end-sanitize-chill ****
1992-11-21 07:10:08 +01:00
/* Start looking for a value composed of valid digits as set by the base
in use. Note that '_' characters are valid anywhere, in any quantity,
and are simply ignored. Since we must find at least one valid digit,
or reject this token as an integer literal, we keep track of how many
digits we have encountered. */
static int
decode_integer_value (base, tokptrptr, ivalptr)
int base;
char **tokptrptr;
int *ivalptr;
{
char *tokptr = *tokptrptr;
int temp;
int digits = 0;
while (*tokptr != '\0')
{
* ch-exp.y (decode_integer_value, match_character_literal, match_bitstring_literal): Guard tolower calls with isupper, tolower on old BSD systems blindly subtracts a constant. * dbxread.c (read_ofile_symtab): Check for __gnu_compiled_* as well when determining the producer of the object file. * mdebugread.c (has_opaque_xref): New function to check for cross reference to an opaque aggregate. * mdebugread.c (parse_symbol, parse_partial_symbols): Do not enter typedefs to opaque aggregates into the symbol tables. * mdebugread.c (parse_external): Remove skip_procedures argument, it has always been 1. Remove code that handled stProc symbols, it was never executed and was wrong, as the index of a stProc symbol points to the local symbol table and not to the auxiliary symbol info. Update caller. * mdebugread.c (parse_partial_symbols): Do not enter external stProc symbols into the partial symbol table, they are already entered into the minimal symbol table. * config/i386/tm-symmetry.h: Clean up, it is now only used for Dynix. Remove all conditionals and definitions for ptx. I386_REGNO_TO_SYMMETRY moved to here from symm-tdep.c. Fix addresses of floating point registers in REGISTER_U_ADDR. STORE_STRUCT_RETURN now handles cc and gcc conventions. FRAME_CHAIN, FRAMELESS_FUNCTION_INVOCATION, FRAME_SAVED_PC, IN_SIGTRAMP, SIGCONTEXT_PC_OFFSET defined to make backtracing through signal trampoline code work. * config/i386/xm-symmetry.h: Clean up, it is now only used for Dynix. Remove all conditionals and definitions for ptx. Remove KDB definitions. * symm-nat.c (store_inferior_registers): Fetch registers before storing them to obtain valid floating point control registers. Store fpu registers. * symm-nat.c (print_1167_control_word): Dynix 3.1.1 defines FPA_PCR_CC_C0 and FPA_PCR_CC_C1, avoid duplicate case value. * symm-nat.c (fetch_inferior_registers, child_xfer_memory): Fix typos. * symm-nat.c (child_resume): Update type of `signal' parameter. * symm-tdep.c (I386_REGNO_TO_SYMMETRY): Moved to tm-symmetry.h.
1994-03-30 11:57:08 +02:00
temp = *tokptr;
if (isupper (temp))
temp = tolower (temp);
* defs.h (sevenbit_strings): Add declaration. * defs.h (printchar): Replace with gdb_printchar. * language.h (language_defn): Add new function pointers la_printchar and la_printstr, to do language dependent printing of characters and strings. * language.h (local_printchar, local_printstr): New macros to call language dependent functions pointed to by la_printchar and la_printstr respectively. * c-exp.y (emit_char, c_printchar, c_printstr): New language dependent functions for printing characters and strings. * c-exp.y (c_language_defn, cplus_language_defn): Add c_printchar and c_printstr. * command.c (do_setshow_command): Rename printchar use to gdb_printchar. * expprint.c (print_subexp): Replace C style string output with call to local_printstr. * language.c (unk_lang_printchar, unk_lang_printstr): New stubs, currently errors. * language.c (unknown_language_defn, auto_language_defn, local_language_defn): Add unk_lang_printchar and unk_lang_printstr. * m2-exp.y (emit_char, m2_printchar, m2_printstr): New language dependent functions to print characters and strings. * m2-exp.y (m2_language_defn): Add m2_printchar and m2_printstr. * utils.c (printchar): Renamed to gdb_printchar. * valprint.c (print_string): Remove prototype, function moved to c-exp.y, where it becomes c_printstr. * valprint.c (print_max): Made global for reference from the language dependent printing routines in *-exp.y. * valprint.c (repeat_count_threshold): New variable with function of old REPEAT_COUNT_THREHOLD define, but now settable by user. Change all references to old macro to references to new variable. * valprint.c (value_print, val_print): Replace calls to print_string with calls to local_printstr. * valprint.c (val_print): Replace C style character printing with call to local_printchar. * valprint.c (val_print): Add case for TYPE_CODE_CHAR. * valprint.c (_initialize_valprint): Add add_show_from_set call for setting up repeat_count_threshold as print variable. **** start-sanitize-chill **** * ch-exp.y (decode_integer_value): New function. * ch-exp.y (decode_integer_literal): Use decode_integer_value. * ch-exp.y (chill_printchar, chill_printstr): New language dependent functions for printing characters and strings. * ch-exp.y (chill_language_defn): Add chill_printchar and chill_printstr. **** end-sanitize-chill ****
1992-11-21 07:10:08 +01:00
tokptr++;
switch (temp)
{
case '_':
continue;
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
temp -= '0';
break;
case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
temp -= 'a';
temp += 10;
break;
default:
temp = base;
break;
}
if (temp < base)
{
digits++;
*ivalptr *= base;
*ivalptr += temp;
}
else
{
/* Found something not in domain for current base. */
tokptr--; /* Unconsume what gave us indigestion. */
break;
}
}
/* If we didn't find any digits, then we don't have a valid integer
value, so reject the entire token. Otherwise, update the lexical
scan pointer, and return non-zero for success. */
if (digits == 0)
{
return (0);
}
else
{
*tokptrptr = tokptr;
return (1);
}
}
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
static int
decode_integer_literal (valptr, tokptrptr)
* defs.h (sevenbit_strings): Add declaration. * defs.h (printchar): Replace with gdb_printchar. * language.h (language_defn): Add new function pointers la_printchar and la_printstr, to do language dependent printing of characters and strings. * language.h (local_printchar, local_printstr): New macros to call language dependent functions pointed to by la_printchar and la_printstr respectively. * c-exp.y (emit_char, c_printchar, c_printstr): New language dependent functions for printing characters and strings. * c-exp.y (c_language_defn, cplus_language_defn): Add c_printchar and c_printstr. * command.c (do_setshow_command): Rename printchar use to gdb_printchar. * expprint.c (print_subexp): Replace C style string output with call to local_printstr. * language.c (unk_lang_printchar, unk_lang_printstr): New stubs, currently errors. * language.c (unknown_language_defn, auto_language_defn, local_language_defn): Add unk_lang_printchar and unk_lang_printstr. * m2-exp.y (emit_char, m2_printchar, m2_printstr): New language dependent functions to print characters and strings. * m2-exp.y (m2_language_defn): Add m2_printchar and m2_printstr. * utils.c (printchar): Renamed to gdb_printchar. * valprint.c (print_string): Remove prototype, function moved to c-exp.y, where it becomes c_printstr. * valprint.c (print_max): Made global for reference from the language dependent printing routines in *-exp.y. * valprint.c (repeat_count_threshold): New variable with function of old REPEAT_COUNT_THREHOLD define, but now settable by user. Change all references to old macro to references to new variable. * valprint.c (value_print, val_print): Replace calls to print_string with calls to local_printstr. * valprint.c (val_print): Replace C style character printing with call to local_printchar. * valprint.c (val_print): Add case for TYPE_CODE_CHAR. * valprint.c (_initialize_valprint): Add add_show_from_set call for setting up repeat_count_threshold as print variable. **** start-sanitize-chill **** * ch-exp.y (decode_integer_value): New function. * ch-exp.y (decode_integer_literal): Use decode_integer_value. * ch-exp.y (chill_printchar, chill_printstr): New language dependent functions for printing characters and strings. * ch-exp.y (chill_language_defn): Add chill_printchar and chill_printstr. **** end-sanitize-chill ****
1992-11-21 07:10:08 +01:00
int *valptr;
char **tokptrptr;
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
{
char *tokptr = *tokptrptr;
int base = 0;
int ival = 0;
int explicit_base = 0;
/* Look for an explicit base specifier, which is optional. */
switch (*tokptr)
{
case 'd':
case 'D':
explicit_base++;
base = 10;
tokptr++;
break;
case 'b':
case 'B':
explicit_base++;
base = 2;
tokptr++;
break;
case 'h':
case 'H':
explicit_base++;
base = 16;
tokptr++;
break;
case 'o':
case 'O':
explicit_base++;
base = 8;
tokptr++;
break;
default:
base = 10;
break;
}
/* If we found an explicit base ensure that the character after the
explicit base is a single quote. */
if (explicit_base && (*tokptr++ != '\''))
{
return (0);
}
* defs.h (sevenbit_strings): Add declaration. * defs.h (printchar): Replace with gdb_printchar. * language.h (language_defn): Add new function pointers la_printchar and la_printstr, to do language dependent printing of characters and strings. * language.h (local_printchar, local_printstr): New macros to call language dependent functions pointed to by la_printchar and la_printstr respectively. * c-exp.y (emit_char, c_printchar, c_printstr): New language dependent functions for printing characters and strings. * c-exp.y (c_language_defn, cplus_language_defn): Add c_printchar and c_printstr. * command.c (do_setshow_command): Rename printchar use to gdb_printchar. * expprint.c (print_subexp): Replace C style string output with call to local_printstr. * language.c (unk_lang_printchar, unk_lang_printstr): New stubs, currently errors. * language.c (unknown_language_defn, auto_language_defn, local_language_defn): Add unk_lang_printchar and unk_lang_printstr. * m2-exp.y (emit_char, m2_printchar, m2_printstr): New language dependent functions to print characters and strings. * m2-exp.y (m2_language_defn): Add m2_printchar and m2_printstr. * utils.c (printchar): Renamed to gdb_printchar. * valprint.c (print_string): Remove prototype, function moved to c-exp.y, where it becomes c_printstr. * valprint.c (print_max): Made global for reference from the language dependent printing routines in *-exp.y. * valprint.c (repeat_count_threshold): New variable with function of old REPEAT_COUNT_THREHOLD define, but now settable by user. Change all references to old macro to references to new variable. * valprint.c (value_print, val_print): Replace calls to print_string with calls to local_printstr. * valprint.c (val_print): Replace C style character printing with call to local_printchar. * valprint.c (val_print): Add case for TYPE_CODE_CHAR. * valprint.c (_initialize_valprint): Add add_show_from_set call for setting up repeat_count_threshold as print variable. **** start-sanitize-chill **** * ch-exp.y (decode_integer_value): New function. * ch-exp.y (decode_integer_literal): Use decode_integer_value. * ch-exp.y (chill_printchar, chill_printstr): New language dependent functions for printing characters and strings. * ch-exp.y (chill_language_defn): Add chill_printchar and chill_printstr. **** end-sanitize-chill ****
1992-11-21 07:10:08 +01:00
/* Attempt to decode whatever follows as an integer value in the
indicated base, updating the token pointer in the process and
computing the value into ival. Also, if we have an explicit
base, then the next character must not be a single quote, or we
* defs.h (sevenbit_strings): Add declaration. * defs.h (printchar): Replace with gdb_printchar. * language.h (language_defn): Add new function pointers la_printchar and la_printstr, to do language dependent printing of characters and strings. * language.h (local_printchar, local_printstr): New macros to call language dependent functions pointed to by la_printchar and la_printstr respectively. * c-exp.y (emit_char, c_printchar, c_printstr): New language dependent functions for printing characters and strings. * c-exp.y (c_language_defn, cplus_language_defn): Add c_printchar and c_printstr. * command.c (do_setshow_command): Rename printchar use to gdb_printchar. * expprint.c (print_subexp): Replace C style string output with call to local_printstr. * language.c (unk_lang_printchar, unk_lang_printstr): New stubs, currently errors. * language.c (unknown_language_defn, auto_language_defn, local_language_defn): Add unk_lang_printchar and unk_lang_printstr. * m2-exp.y (emit_char, m2_printchar, m2_printstr): New language dependent functions to print characters and strings. * m2-exp.y (m2_language_defn): Add m2_printchar and m2_printstr. * utils.c (printchar): Renamed to gdb_printchar. * valprint.c (print_string): Remove prototype, function moved to c-exp.y, where it becomes c_printstr. * valprint.c (print_max): Made global for reference from the language dependent printing routines in *-exp.y. * valprint.c (repeat_count_threshold): New variable with function of old REPEAT_COUNT_THREHOLD define, but now settable by user. Change all references to old macro to references to new variable. * valprint.c (value_print, val_print): Replace calls to print_string with calls to local_printstr. * valprint.c (val_print): Replace C style character printing with call to local_printchar. * valprint.c (val_print): Add case for TYPE_CODE_CHAR. * valprint.c (_initialize_valprint): Add add_show_from_set call for setting up repeat_count_threshold as print variable. **** start-sanitize-chill **** * ch-exp.y (decode_integer_value): New function. * ch-exp.y (decode_integer_literal): Use decode_integer_value. * ch-exp.y (chill_printchar, chill_printstr): New language dependent functions for printing characters and strings. * ch-exp.y (chill_language_defn): Add chill_printchar and chill_printstr. **** end-sanitize-chill ****
1992-11-21 07:10:08 +01:00
have a bitstring literal, so reject the entire token in this case.
Otherwise, update the lexical scan pointer, and return non-zero
for success. */
if (!decode_integer_value (base, &tokptr, &ival))
{
return (0);
}
else if (explicit_base && (*tokptr == '\''))
{
return (0);
}
else
{
*valptr = ival;
*tokptrptr = tokptr;
return (1);
}
}
/* If it wasn't for the fact that floating point values can contain '_'
characters, we could just let strtod do all the hard work by letting it
try to consume as much of the current token buffer as possible and
find a legal conversion. Unfortunately we need to filter out the '_'
characters before calling strtod, which we do by copying the other
legal chars to a local buffer to be converted. However since we also
need to keep track of where the last unconsumed character in the input
buffer is, we have transfer only as many characters as may compose a
legal floating point value. */
static int
match_float_literal ()
{
char *tokptr = lexptr;
char *buf;
char *copy;
double dval;
extern double strtod ();
/* Make local buffer in which to build the string to convert. This is
required because underscores are valid in chill floating point numbers
but not in the string passed to strtod to convert. The string will be
no longer than our input string. */
copy = buf = (char *) alloca (strlen (tokptr) + 1);
/* Transfer all leading digits to the conversion buffer, discarding any
underscores. */
while (isdigit (*tokptr) || *tokptr == '_')
{
if (*tokptr != '_')
{
*copy++ = *tokptr;
}
tokptr++;
}
/* Now accept either a '.', or one of [eEdD]. Dot is legal regardless
of whether we found any leading digits, and we simply accept it and
continue on to look for the fractional part and/or exponent. One of
[eEdD] is legal only if we have seen digits, and means that there
is no fractional part. If we find neither of these, then this is
not a floating point number, so return failure. */
switch (*tokptr++)
{
case '.':
/* Accept and then look for fractional part and/or exponent. */
*copy++ = '.';
break;
case 'e':
case 'E':
case 'd':
case 'D':
if (copy == buf)
{
return (0);
}
*copy++ = 'e';
goto collect_exponent;
break;
default:
return (0);
break;
}
/* We found a '.', copy any fractional digits to the conversion buffer, up
to the first nondigit, non-underscore character. */
while (isdigit (*tokptr) || *tokptr == '_')
{
if (*tokptr != '_')
{
*copy++ = *tokptr;
}
tokptr++;
}
/* Look for an exponent, which must start with one of [eEdD]. If none
is found, jump directly to trying to convert what we have collected
so far. */
switch (*tokptr)
{
case 'e':
case 'E':
case 'd':
case 'D':
*copy++ = 'e';
tokptr++;
break;
default:
goto convert_float;
break;
}
/* Accept an optional '-' or '+' following one of [eEdD]. */
collect_exponent:
if (*tokptr == '+' || *tokptr == '-')
{
*copy++ = *tokptr++;
}
/* Now copy an exponent into the conversion buffer. Note that at the
moment underscores are *not* allowed in exponents. */
while (isdigit (*tokptr))
{
*copy++ = *tokptr++;
}
/* If we transfered any chars to the conversion buffer, try to interpret its
contents as a floating point value. If any characters remain, then we
must not have a valid floating point string. */
convert_float:
*copy = '\0';
if (copy != buf)
{
dval = strtod (buf, &copy);
if (*copy == '\0')
{
yylval.dval = dval;
lexptr = tokptr;
return (FLOAT_LITERAL);
}
}
return (0);
}
/* Recognize a string literal. A string literal is a sequence
of characters enclosed in matching single or double quotes, except that
a single character inside single quotes is a character literal, which
we reject as a string literal. To embed the terminator character inside
a string, it is simply doubled (I.E. "this""is""one""string") */
static int
match_string_literal ()
{
char *tokptr = lexptr;
for (tempbufindex = 0, tokptr++; *tokptr != '\0'; tokptr++)
{
CHECKBUF (1);
if (*tokptr == *lexptr)
{
if (*(tokptr + 1) == *lexptr)
{
tokptr++;
}
else
{
break;
}
}
tempbuf[tempbufindex++] = *tokptr;
}
if (*tokptr == '\0' /* no terminator */
|| (tempbufindex == 1 && *tokptr == '\'')) /* char literal */
{
return (0);
}
else
{
tempbuf[tempbufindex] = '\0';
yylval.sval.ptr = tempbuf;
yylval.sval.length = tempbufindex;
lexptr = ++tokptr;
return (CHARACTER_STRING_LITERAL);
}
}
/* Recognize a character literal. A character literal is single character
or a control sequence, enclosed in single quotes. A control sequence
is a comma separated list of one or more integer literals, enclosed
in parenthesis and introduced with a circumflex character.
EX: 'a' '^(7)' '^(7,8)'
* defs.h (sevenbit_strings): Add declaration. * defs.h (printchar): Replace with gdb_printchar. * language.h (language_defn): Add new function pointers la_printchar and la_printstr, to do language dependent printing of characters and strings. * language.h (local_printchar, local_printstr): New macros to call language dependent functions pointed to by la_printchar and la_printstr respectively. * c-exp.y (emit_char, c_printchar, c_printstr): New language dependent functions for printing characters and strings. * c-exp.y (c_language_defn, cplus_language_defn): Add c_printchar and c_printstr. * command.c (do_setshow_command): Rename printchar use to gdb_printchar. * expprint.c (print_subexp): Replace C style string output with call to local_printstr. * language.c (unk_lang_printchar, unk_lang_printstr): New stubs, currently errors. * language.c (unknown_language_defn, auto_language_defn, local_language_defn): Add unk_lang_printchar and unk_lang_printstr. * m2-exp.y (emit_char, m2_printchar, m2_printstr): New language dependent functions to print characters and strings. * m2-exp.y (m2_language_defn): Add m2_printchar and m2_printstr. * utils.c (printchar): Renamed to gdb_printchar. * valprint.c (print_string): Remove prototype, function moved to c-exp.y, where it becomes c_printstr. * valprint.c (print_max): Made global for reference from the language dependent printing routines in *-exp.y. * valprint.c (repeat_count_threshold): New variable with function of old REPEAT_COUNT_THREHOLD define, but now settable by user. Change all references to old macro to references to new variable. * valprint.c (value_print, val_print): Replace calls to print_string with calls to local_printstr. * valprint.c (val_print): Replace C style character printing with call to local_printchar. * valprint.c (val_print): Add case for TYPE_CODE_CHAR. * valprint.c (_initialize_valprint): Add add_show_from_set call for setting up repeat_count_threshold as print variable. **** start-sanitize-chill **** * ch-exp.y (decode_integer_value): New function. * ch-exp.y (decode_integer_literal): Use decode_integer_value. * ch-exp.y (chill_printchar, chill_printstr): New language dependent functions for printing characters and strings. * ch-exp.y (chill_language_defn): Add chill_printchar and chill_printstr. **** end-sanitize-chill ****
1992-11-21 07:10:08 +01:00
As a GNU chill extension, the syntax C'xx' is also recognized as a
character literal, where xx is a hex value for the character.
Note that more than a single character, enclosed in single quotes, is
a string literal.
* c-exp.y (exp:STRING): Convert C strings into array-of-char constants with an explicit null byte terminator. OP_STRING is now used for real string types. * c-lang.c (builtin_type_*): Move declarations to lang.c since they are used by all languages. * c-lang.c (_initialize_c_language): Move initializations of builtin_type_* to lang.c. * c-typeprint.c (c_type_print_varspec_prefix, c_type_print_varspec_suffix): TYPE_CODE_PASCAL_ARRAY renamed to TYPE_CODE_STRING. * c-valprint.c (c_val_print): Change the way character arrays are printed as strings to be consistent with the way strings are printed when pointer-to-char types are dereferenced. Remove test of print_max before calling val_print_string, which now does it's own test. * eval.c (evaluate_subexp): Add case for OP_ARRAY. * expprint.c (print_subexp, dump_expression): Add case for OP_ARRAY. * expression.h (enum exp_opcode): Add OP_ARRAY and document. * gdbtypes.c (builtin_type_*): Add declarations moved from c-lang.c. * gdbtypes.c (create_string_type): New function to create real string types. * gdbtypes.c (recursive_dump_type): TYPE_CODE_PASCAL_ARRAY renamed to TYPE_CODE_STRING. * gdbtypes.c (_initialize_gdbtypes): Add initializations of builtin_type_* types moved from c-lang.c. * gdbtypes.h (enum type_code): TYPE_CODE_PASCAL_ARRAY renamed to TYPE_CODE_STRING. * gdbtypes.h (builtin_type_string): Add extern declaration. * gdbtypes.h (create_string_type): Add prototype. * m2-lang.c (m2_create_fundamental_type): TYPE_CODE_PASCAL_ARRAY renamed to TYPE_CODE_STRING. * m88k-tdep.c (pushed_size): TYPE_CODE_PASCAL_ARRAY renamed to TYPE_CODE_STRING. * mipsread.c (_initialize_mipsread): TYPE_CODE_PASCAL_ARRAY renamed to TYPE_CODE_STRING. * parse.c (length_of_subexp, prefixify_subexp): Add case for OP_ARRAY. * printcmd.c (print_formatted): Recognize TYPE_CODE_STRING. * typeprint.c (print_type_scalar): TYPE_CODE_PASCAL_ARRAY renamed to TYPE_CODE_STRING. * valops.c (allocate_space_in_inferior): New function and prototype, using code ripped out of value_string. * valops.c (value_string): Rewritten to use new function allocate_space_in_inferior, but temporarily disabled until some other support is in place. * valops.c (value_array): New function to create array constants. * valprint.c (val_print_string): Add comment to document use, complete rewrite to fix several small buglets. * value.h (value_array): Add prototype. * value.h (val_print_string): Change prototype to match rewrite. **** start-sanitize-chill **** * ch-valprint.c (chill_val_print): Add case for TYPE_CODE_STRING. * ch-exp.y (match_character_literal): Disable recognition of control sequence form of character literals and document why. **** end-sanitize-chill ****
1993-01-16 06:15:58 +01:00
Also note that the control sequence form is not in GNU Chill since it
is ambiguous with the string literal form using single quotes. I.E.
is '^(7)' a character literal or a string literal. In theory it it
possible to tell by context, but GNU Chill doesn't accept the control
sequence form, so neither do we (for now the code is disabled).
Returns CHARACTER_LITERAL if a match is found.
*/
static int
match_character_literal ()
{
char *tokptr = lexptr;
int ival = 0;
* ch-exp.y (decode_integer_value, match_character_literal, match_bitstring_literal): Guard tolower calls with isupper, tolower on old BSD systems blindly subtracts a constant. * dbxread.c (read_ofile_symtab): Check for __gnu_compiled_* as well when determining the producer of the object file. * mdebugread.c (has_opaque_xref): New function to check for cross reference to an opaque aggregate. * mdebugread.c (parse_symbol, parse_partial_symbols): Do not enter typedefs to opaque aggregates into the symbol tables. * mdebugread.c (parse_external): Remove skip_procedures argument, it has always been 1. Remove code that handled stProc symbols, it was never executed and was wrong, as the index of a stProc symbol points to the local symbol table and not to the auxiliary symbol info. Update caller. * mdebugread.c (parse_partial_symbols): Do not enter external stProc symbols into the partial symbol table, they are already entered into the minimal symbol table. * config/i386/tm-symmetry.h: Clean up, it is now only used for Dynix. Remove all conditionals and definitions for ptx. I386_REGNO_TO_SYMMETRY moved to here from symm-tdep.c. Fix addresses of floating point registers in REGISTER_U_ADDR. STORE_STRUCT_RETURN now handles cc and gcc conventions. FRAME_CHAIN, FRAMELESS_FUNCTION_INVOCATION, FRAME_SAVED_PC, IN_SIGTRAMP, SIGCONTEXT_PC_OFFSET defined to make backtracing through signal trampoline code work. * config/i386/xm-symmetry.h: Clean up, it is now only used for Dynix. Remove all conditionals and definitions for ptx. Remove KDB definitions. * symm-nat.c (store_inferior_registers): Fetch registers before storing them to obtain valid floating point control registers. Store fpu registers. * symm-nat.c (print_1167_control_word): Dynix 3.1.1 defines FPA_PCR_CC_C0 and FPA_PCR_CC_C1, avoid duplicate case value. * symm-nat.c (fetch_inferior_registers, child_xfer_memory): Fix typos. * symm-nat.c (child_resume): Update type of `signal' parameter. * symm-tdep.c (I386_REGNO_TO_SYMMETRY): Moved to tm-symmetry.h.
1994-03-30 11:57:08 +02:00
if ((*tokptr == 'c' || *tokptr == 'C') && (*(tokptr + 1) == '\''))
{
* defs.h (sevenbit_strings): Add declaration. * defs.h (printchar): Replace with gdb_printchar. * language.h (language_defn): Add new function pointers la_printchar and la_printstr, to do language dependent printing of characters and strings. * language.h (local_printchar, local_printstr): New macros to call language dependent functions pointed to by la_printchar and la_printstr respectively. * c-exp.y (emit_char, c_printchar, c_printstr): New language dependent functions for printing characters and strings. * c-exp.y (c_language_defn, cplus_language_defn): Add c_printchar and c_printstr. * command.c (do_setshow_command): Rename printchar use to gdb_printchar. * expprint.c (print_subexp): Replace C style string output with call to local_printstr. * language.c (unk_lang_printchar, unk_lang_printstr): New stubs, currently errors. * language.c (unknown_language_defn, auto_language_defn, local_language_defn): Add unk_lang_printchar and unk_lang_printstr. * m2-exp.y (emit_char, m2_printchar, m2_printstr): New language dependent functions to print characters and strings. * m2-exp.y (m2_language_defn): Add m2_printchar and m2_printstr. * utils.c (printchar): Renamed to gdb_printchar. * valprint.c (print_string): Remove prototype, function moved to c-exp.y, where it becomes c_printstr. * valprint.c (print_max): Made global for reference from the language dependent printing routines in *-exp.y. * valprint.c (repeat_count_threshold): New variable with function of old REPEAT_COUNT_THREHOLD define, but now settable by user. Change all references to old macro to references to new variable. * valprint.c (value_print, val_print): Replace calls to print_string with calls to local_printstr. * valprint.c (val_print): Replace C style character printing with call to local_printchar. * valprint.c (val_print): Add case for TYPE_CODE_CHAR. * valprint.c (_initialize_valprint): Add add_show_from_set call for setting up repeat_count_threshold as print variable. **** start-sanitize-chill **** * ch-exp.y (decode_integer_value): New function. * ch-exp.y (decode_integer_literal): Use decode_integer_value. * ch-exp.y (chill_printchar, chill_printstr): New language dependent functions for printing characters and strings. * ch-exp.y (chill_language_defn): Add chill_printchar and chill_printstr. **** end-sanitize-chill ****
1992-11-21 07:10:08 +01:00
/* We have a GNU chill extension form, so skip the leading "C'",
decode the hex value, and then ensure that we have a trailing
single quote character. */
tokptr += 2;
* defs.h (sevenbit_strings): Add declaration. * defs.h (printchar): Replace with gdb_printchar. * language.h (language_defn): Add new function pointers la_printchar and la_printstr, to do language dependent printing of characters and strings. * language.h (local_printchar, local_printstr): New macros to call language dependent functions pointed to by la_printchar and la_printstr respectively. * c-exp.y (emit_char, c_printchar, c_printstr): New language dependent functions for printing characters and strings. * c-exp.y (c_language_defn, cplus_language_defn): Add c_printchar and c_printstr. * command.c (do_setshow_command): Rename printchar use to gdb_printchar. * expprint.c (print_subexp): Replace C style string output with call to local_printstr. * language.c (unk_lang_printchar, unk_lang_printstr): New stubs, currently errors. * language.c (unknown_language_defn, auto_language_defn, local_language_defn): Add unk_lang_printchar and unk_lang_printstr. * m2-exp.y (emit_char, m2_printchar, m2_printstr): New language dependent functions to print characters and strings. * m2-exp.y (m2_language_defn): Add m2_printchar and m2_printstr. * utils.c (printchar): Renamed to gdb_printchar. * valprint.c (print_string): Remove prototype, function moved to c-exp.y, where it becomes c_printstr. * valprint.c (print_max): Made global for reference from the language dependent printing routines in *-exp.y. * valprint.c (repeat_count_threshold): New variable with function of old REPEAT_COUNT_THREHOLD define, but now settable by user. Change all references to old macro to references to new variable. * valprint.c (value_print, val_print): Replace calls to print_string with calls to local_printstr. * valprint.c (val_print): Replace C style character printing with call to local_printchar. * valprint.c (val_print): Add case for TYPE_CODE_CHAR. * valprint.c (_initialize_valprint): Add add_show_from_set call for setting up repeat_count_threshold as print variable. **** start-sanitize-chill **** * ch-exp.y (decode_integer_value): New function. * ch-exp.y (decode_integer_literal): Use decode_integer_value. * ch-exp.y (chill_printchar, chill_printstr): New language dependent functions for printing characters and strings. * ch-exp.y (chill_language_defn): Add chill_printchar and chill_printstr. **** end-sanitize-chill ****
1992-11-21 07:10:08 +01:00
if (!decode_integer_value (16, &tokptr, &ival) || (*tokptr != '\''))
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
{
return (0);
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
}
* defs.h (sevenbit_strings): Add declaration. * defs.h (printchar): Replace with gdb_printchar. * language.h (language_defn): Add new function pointers la_printchar and la_printstr, to do language dependent printing of characters and strings. * language.h (local_printchar, local_printstr): New macros to call language dependent functions pointed to by la_printchar and la_printstr respectively. * c-exp.y (emit_char, c_printchar, c_printstr): New language dependent functions for printing characters and strings. * c-exp.y (c_language_defn, cplus_language_defn): Add c_printchar and c_printstr. * command.c (do_setshow_command): Rename printchar use to gdb_printchar. * expprint.c (print_subexp): Replace C style string output with call to local_printstr. * language.c (unk_lang_printchar, unk_lang_printstr): New stubs, currently errors. * language.c (unknown_language_defn, auto_language_defn, local_language_defn): Add unk_lang_printchar and unk_lang_printstr. * m2-exp.y (emit_char, m2_printchar, m2_printstr): New language dependent functions to print characters and strings. * m2-exp.y (m2_language_defn): Add m2_printchar and m2_printstr. * utils.c (printchar): Renamed to gdb_printchar. * valprint.c (print_string): Remove prototype, function moved to c-exp.y, where it becomes c_printstr. * valprint.c (print_max): Made global for reference from the language dependent printing routines in *-exp.y. * valprint.c (repeat_count_threshold): New variable with function of old REPEAT_COUNT_THREHOLD define, but now settable by user. Change all references to old macro to references to new variable. * valprint.c (value_print, val_print): Replace calls to print_string with calls to local_printstr. * valprint.c (val_print): Replace C style character printing with call to local_printchar. * valprint.c (val_print): Add case for TYPE_CODE_CHAR. * valprint.c (_initialize_valprint): Add add_show_from_set call for setting up repeat_count_threshold as print variable. **** start-sanitize-chill **** * ch-exp.y (decode_integer_value): New function. * ch-exp.y (decode_integer_literal): Use decode_integer_value. * ch-exp.y (chill_printchar, chill_printstr): New language dependent functions for printing characters and strings. * ch-exp.y (chill_language_defn): Add chill_printchar and chill_printstr. **** end-sanitize-chill ****
1992-11-21 07:10:08 +01:00
tokptr++;
}
* defs.h (sevenbit_strings): Add declaration. * defs.h (printchar): Replace with gdb_printchar. * language.h (language_defn): Add new function pointers la_printchar and la_printstr, to do language dependent printing of characters and strings. * language.h (local_printchar, local_printstr): New macros to call language dependent functions pointed to by la_printchar and la_printstr respectively. * c-exp.y (emit_char, c_printchar, c_printstr): New language dependent functions for printing characters and strings. * c-exp.y (c_language_defn, cplus_language_defn): Add c_printchar and c_printstr. * command.c (do_setshow_command): Rename printchar use to gdb_printchar. * expprint.c (print_subexp): Replace C style string output with call to local_printstr. * language.c (unk_lang_printchar, unk_lang_printstr): New stubs, currently errors. * language.c (unknown_language_defn, auto_language_defn, local_language_defn): Add unk_lang_printchar and unk_lang_printstr. * m2-exp.y (emit_char, m2_printchar, m2_printstr): New language dependent functions to print characters and strings. * m2-exp.y (m2_language_defn): Add m2_printchar and m2_printstr. * utils.c (printchar): Renamed to gdb_printchar. * valprint.c (print_string): Remove prototype, function moved to c-exp.y, where it becomes c_printstr. * valprint.c (print_max): Made global for reference from the language dependent printing routines in *-exp.y. * valprint.c (repeat_count_threshold): New variable with function of old REPEAT_COUNT_THREHOLD define, but now settable by user. Change all references to old macro to references to new variable. * valprint.c (value_print, val_print): Replace calls to print_string with calls to local_printstr. * valprint.c (val_print): Replace C style character printing with call to local_printchar. * valprint.c (val_print): Add case for TYPE_CODE_CHAR. * valprint.c (_initialize_valprint): Add add_show_from_set call for setting up repeat_count_threshold as print variable. **** start-sanitize-chill **** * ch-exp.y (decode_integer_value): New function. * ch-exp.y (decode_integer_literal): Use decode_integer_value. * ch-exp.y (chill_printchar, chill_printstr): New language dependent functions for printing characters and strings. * ch-exp.y (chill_language_defn): Add chill_printchar and chill_printstr. **** end-sanitize-chill ****
1992-11-21 07:10:08 +01:00
else if (*tokptr == '\'')
{
* defs.h (sevenbit_strings): Add declaration. * defs.h (printchar): Replace with gdb_printchar. * language.h (language_defn): Add new function pointers la_printchar and la_printstr, to do language dependent printing of characters and strings. * language.h (local_printchar, local_printstr): New macros to call language dependent functions pointed to by la_printchar and la_printstr respectively. * c-exp.y (emit_char, c_printchar, c_printstr): New language dependent functions for printing characters and strings. * c-exp.y (c_language_defn, cplus_language_defn): Add c_printchar and c_printstr. * command.c (do_setshow_command): Rename printchar use to gdb_printchar. * expprint.c (print_subexp): Replace C style string output with call to local_printstr. * language.c (unk_lang_printchar, unk_lang_printstr): New stubs, currently errors. * language.c (unknown_language_defn, auto_language_defn, local_language_defn): Add unk_lang_printchar and unk_lang_printstr. * m2-exp.y (emit_char, m2_printchar, m2_printstr): New language dependent functions to print characters and strings. * m2-exp.y (m2_language_defn): Add m2_printchar and m2_printstr. * utils.c (printchar): Renamed to gdb_printchar. * valprint.c (print_string): Remove prototype, function moved to c-exp.y, where it becomes c_printstr. * valprint.c (print_max): Made global for reference from the language dependent printing routines in *-exp.y. * valprint.c (repeat_count_threshold): New variable with function of old REPEAT_COUNT_THREHOLD define, but now settable by user. Change all references to old macro to references to new variable. * valprint.c (value_print, val_print): Replace calls to print_string with calls to local_printstr. * valprint.c (val_print): Replace C style character printing with call to local_printchar. * valprint.c (val_print): Add case for TYPE_CODE_CHAR. * valprint.c (_initialize_valprint): Add add_show_from_set call for setting up repeat_count_threshold as print variable. **** start-sanitize-chill **** * ch-exp.y (decode_integer_value): New function. * ch-exp.y (decode_integer_literal): Use decode_integer_value. * ch-exp.y (chill_printchar, chill_printstr): New language dependent functions for printing characters and strings. * ch-exp.y (chill_language_defn): Add chill_printchar and chill_printstr. **** end-sanitize-chill ****
1992-11-21 07:10:08 +01:00
tokptr++;
* defs.h (sevenbit_strings): Add declaration. * defs.h (printchar): Replace with gdb_printchar. * language.h (language_defn): Add new function pointers la_printchar and la_printstr, to do language dependent printing of characters and strings. * language.h (local_printchar, local_printstr): New macros to call language dependent functions pointed to by la_printchar and la_printstr respectively. * c-exp.y (emit_char, c_printchar, c_printstr): New language dependent functions for printing characters and strings. * c-exp.y (c_language_defn, cplus_language_defn): Add c_printchar and c_printstr. * command.c (do_setshow_command): Rename printchar use to gdb_printchar. * expprint.c (print_subexp): Replace C style string output with call to local_printstr. * language.c (unk_lang_printchar, unk_lang_printstr): New stubs, currently errors. * language.c (unknown_language_defn, auto_language_defn, local_language_defn): Add unk_lang_printchar and unk_lang_printstr. * m2-exp.y (emit_char, m2_printchar, m2_printstr): New language dependent functions to print characters and strings. * m2-exp.y (m2_language_defn): Add m2_printchar and m2_printstr. * utils.c (printchar): Renamed to gdb_printchar. * valprint.c (print_string): Remove prototype, function moved to c-exp.y, where it becomes c_printstr. * valprint.c (print_max): Made global for reference from the language dependent printing routines in *-exp.y. * valprint.c (repeat_count_threshold): New variable with function of old REPEAT_COUNT_THREHOLD define, but now settable by user. Change all references to old macro to references to new variable. * valprint.c (value_print, val_print): Replace calls to print_string with calls to local_printstr. * valprint.c (val_print): Replace C style character printing with call to local_printchar. * valprint.c (val_print): Add case for TYPE_CODE_CHAR. * valprint.c (_initialize_valprint): Add add_show_from_set call for setting up repeat_count_threshold as print variable. **** start-sanitize-chill **** * ch-exp.y (decode_integer_value): New function. * ch-exp.y (decode_integer_literal): Use decode_integer_value. * ch-exp.y (chill_printchar, chill_printstr): New language dependent functions for printing characters and strings. * ch-exp.y (chill_language_defn): Add chill_printchar and chill_printstr. **** end-sanitize-chill ****
1992-11-21 07:10:08 +01:00
/* Determine which form we have, either a control sequence or the
single character form. */
if ((*tokptr == '^') && (*(tokptr + 1) == '('))
{
#if 0 /* Disable, see note above. -fnf */
* defs.h (sevenbit_strings): Add declaration. * defs.h (printchar): Replace with gdb_printchar. * language.h (language_defn): Add new function pointers la_printchar and la_printstr, to do language dependent printing of characters and strings. * language.h (local_printchar, local_printstr): New macros to call language dependent functions pointed to by la_printchar and la_printstr respectively. * c-exp.y (emit_char, c_printchar, c_printstr): New language dependent functions for printing characters and strings. * c-exp.y (c_language_defn, cplus_language_defn): Add c_printchar and c_printstr. * command.c (do_setshow_command): Rename printchar use to gdb_printchar. * expprint.c (print_subexp): Replace C style string output with call to local_printstr. * language.c (unk_lang_printchar, unk_lang_printstr): New stubs, currently errors. * language.c (unknown_language_defn, auto_language_defn, local_language_defn): Add unk_lang_printchar and unk_lang_printstr. * m2-exp.y (emit_char, m2_printchar, m2_printstr): New language dependent functions to print characters and strings. * m2-exp.y (m2_language_defn): Add m2_printchar and m2_printstr. * utils.c (printchar): Renamed to gdb_printchar. * valprint.c (print_string): Remove prototype, function moved to c-exp.y, where it becomes c_printstr. * valprint.c (print_max): Made global for reference from the language dependent printing routines in *-exp.y. * valprint.c (repeat_count_threshold): New variable with function of old REPEAT_COUNT_THREHOLD define, but now settable by user. Change all references to old macro to references to new variable. * valprint.c (value_print, val_print): Replace calls to print_string with calls to local_printstr. * valprint.c (val_print): Replace C style character printing with call to local_printchar. * valprint.c (val_print): Add case for TYPE_CODE_CHAR. * valprint.c (_initialize_valprint): Add add_show_from_set call for setting up repeat_count_threshold as print variable. **** start-sanitize-chill **** * ch-exp.y (decode_integer_value): New function. * ch-exp.y (decode_integer_literal): Use decode_integer_value. * ch-exp.y (chill_printchar, chill_printstr): New language dependent functions for printing characters and strings. * ch-exp.y (chill_language_defn): Add chill_printchar and chill_printstr. **** end-sanitize-chill ****
1992-11-21 07:10:08 +01:00
/* Match and decode a control sequence. Return zero if we don't
find a valid integer literal, or if the next unconsumed character
after the integer literal is not the trailing ')'.
FIXME: We currently don't handle the multiple integer literal
form. */
tokptr += 2;
if (!decode_integer_literal (&ival, &tokptr) || (*tokptr++ != ')'))
{
return (0);
}
#else
return (0);
#endif
* defs.h (sevenbit_strings): Add declaration. * defs.h (printchar): Replace with gdb_printchar. * language.h (language_defn): Add new function pointers la_printchar and la_printstr, to do language dependent printing of characters and strings. * language.h (local_printchar, local_printstr): New macros to call language dependent functions pointed to by la_printchar and la_printstr respectively. * c-exp.y (emit_char, c_printchar, c_printstr): New language dependent functions for printing characters and strings. * c-exp.y (c_language_defn, cplus_language_defn): Add c_printchar and c_printstr. * command.c (do_setshow_command): Rename printchar use to gdb_printchar. * expprint.c (print_subexp): Replace C style string output with call to local_printstr. * language.c (unk_lang_printchar, unk_lang_printstr): New stubs, currently errors. * language.c (unknown_language_defn, auto_language_defn, local_language_defn): Add unk_lang_printchar and unk_lang_printstr. * m2-exp.y (emit_char, m2_printchar, m2_printstr): New language dependent functions to print characters and strings. * m2-exp.y (m2_language_defn): Add m2_printchar and m2_printstr. * utils.c (printchar): Renamed to gdb_printchar. * valprint.c (print_string): Remove prototype, function moved to c-exp.y, where it becomes c_printstr. * valprint.c (print_max): Made global for reference from the language dependent printing routines in *-exp.y. * valprint.c (repeat_count_threshold): New variable with function of old REPEAT_COUNT_THREHOLD define, but now settable by user. Change all references to old macro to references to new variable. * valprint.c (value_print, val_print): Replace calls to print_string with calls to local_printstr. * valprint.c (val_print): Replace C style character printing with call to local_printchar. * valprint.c (val_print): Add case for TYPE_CODE_CHAR. * valprint.c (_initialize_valprint): Add add_show_from_set call for setting up repeat_count_threshold as print variable. **** start-sanitize-chill **** * ch-exp.y (decode_integer_value): New function. * ch-exp.y (decode_integer_literal): Use decode_integer_value. * ch-exp.y (chill_printchar, chill_printstr): New language dependent functions for printing characters and strings. * ch-exp.y (chill_language_defn): Add chill_printchar and chill_printstr. **** end-sanitize-chill ****
1992-11-21 07:10:08 +01:00
}
else
{
ival = *tokptr++;
}
/* The trailing quote has not yet been consumed. If we don't find
it, then we have no match. */
if (*tokptr++ != '\'')
{
return (0);
}
}
else
{
/* Not a character literal. */
return (0);
}
yylval.typed_val.val = ival;
yylval.typed_val.type = builtin_type_chill_char;
lexptr = tokptr;
return (CHARACTER_LITERAL);
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
}
/* Recognize an integer literal, as specified in Z.200 sec 5.2.4.2.
Note that according to 5.2.4.2, a single "_" is also a valid integer
literal, however GNU-chill requires there to be at least one "digit"
in any integer literal. */
static int
match_integer_literal ()
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
{
char *tokptr = lexptr;
int ival;
if (!decode_integer_literal (&ival, &tokptr))
{
return (0);
}
else
{
yylval.typed_val.val = ival;
yylval.typed_val.type = builtin_type_int;
lexptr = tokptr;
return (INTEGER_LITERAL);
}
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
}
* defs.h (HOST_CHAR_BIT): New macro, defaults to either CHAR_BIT from a configuration file (typically including <limits.h>), or to TARGET_CHAR_BIT if CHAR_BIT is not defined. * eval.c (evaluate_subexp): Use new BYTES_TO_EXP_ELEM macro. * eval.c (evaluate_subexp): Add case for OP_BITSTRING. * expprint.c (print_subexp): Use new BYTES_TO_EXP_ELEM macro. * exppritn.c (print_subexp, dump_expression): Add case for OP_BITSTRING. * expression.h (OP_BITSTRING): New expression element type for packed bitstrings. * expression.h (EXP_ELEM_TO_BYTES, BYTES_TO_EXP_ELEM): New macros to convert between number of expression elements and bytes to store that many elements. * i960-tdep.c (leafproc_return): Use new macros to access minimal symbol name and address fields. * m88k-pinsn.c (sprint_address): Use new macros to access minimal symbol name and address fields. * nindy-tdep.c (nindy_frame_chain_valid): Use new macro to access minimal symbol address field. * parse.c (write_exp_elt, write_exp_string, prefixify_expression, parse_exp_1): Use new EXP_ELEM_TO_BYTES macro. * parse.c (write_exp_string, length_of_subexp, prefixify_expression): Use new BYTES_TO_EXP_ELEM macro. * parse.c (write_exp_bitstring): New function to write packed bitstrings into the expression element vector. * parse.c (length_of_subexp, prefixify_subexp): Add case for OP_BITSTRING. * parser-defs.h (struct stoken): Document that it is used for OP_BITSTRING as well as OP_STRING. * parser-defs.h (write_exp_bitstring): Add prototype. **** start-sanitize-chill **** * ch-exp.y (BIT_STRING_LITERAL): Change token type to sval. * ch-exp.y (NUM, PRED, SUCC, ABS, CARD, MAX, MIN, SIZE, UPPER, LOWER, LENGTH): New tokens for keywords. * ch-exp.y (chill_value_built_in_routine_call, mode_argument, upper_lower_argument, length_argument, array_mode_name, string_mode_name, variant_structure_mode_name): New non-terminals and productions. * ch-exp.y (literal): Useful production for BIT_STRING_LITERAL. * ch-exp.y (match_bitstring_literal): New lexer support function to recognize bitstring literals. * ch-exp.y (tokentab6): New token table for 6 character keywords. * ch-exp.y (tokentab5): Add LOWER, UPPER. * ch-exp.y (tokentab4): Add PRED, SUCC, CARD, SIZE. * ch-exp.y (tokentab3): Add NUM, ABS, MIN, MAX. * ch-exp.y (yylex): Check tokentab6. * ch-exp.y (yylex): Call match_bitstring_literal. **** end-sanitize-chill ****
1993-01-06 17:52:10 +01:00
/* Recognize a bit-string literal, as specified in Z.200 sec 5.2.4.8
Note that according to 5.2.4.8, a single "_" is also a valid bit-string
literal, however GNU-chill requires there to be at least one "digit"
in any bit-string literal. */
static int
match_bitstring_literal ()
{
register char *tokptr = lexptr;
* defs.h (HOST_CHAR_BIT): New macro, defaults to either CHAR_BIT from a configuration file (typically including <limits.h>), or to TARGET_CHAR_BIT if CHAR_BIT is not defined. * eval.c (evaluate_subexp): Use new BYTES_TO_EXP_ELEM macro. * eval.c (evaluate_subexp): Add case for OP_BITSTRING. * expprint.c (print_subexp): Use new BYTES_TO_EXP_ELEM macro. * exppritn.c (print_subexp, dump_expression): Add case for OP_BITSTRING. * expression.h (OP_BITSTRING): New expression element type for packed bitstrings. * expression.h (EXP_ELEM_TO_BYTES, BYTES_TO_EXP_ELEM): New macros to convert between number of expression elements and bytes to store that many elements. * i960-tdep.c (leafproc_return): Use new macros to access minimal symbol name and address fields. * m88k-pinsn.c (sprint_address): Use new macros to access minimal symbol name and address fields. * nindy-tdep.c (nindy_frame_chain_valid): Use new macro to access minimal symbol address field. * parse.c (write_exp_elt, write_exp_string, prefixify_expression, parse_exp_1): Use new EXP_ELEM_TO_BYTES macro. * parse.c (write_exp_string, length_of_subexp, prefixify_expression): Use new BYTES_TO_EXP_ELEM macro. * parse.c (write_exp_bitstring): New function to write packed bitstrings into the expression element vector. * parse.c (length_of_subexp, prefixify_subexp): Add case for OP_BITSTRING. * parser-defs.h (struct stoken): Document that it is used for OP_BITSTRING as well as OP_STRING. * parser-defs.h (write_exp_bitstring): Add prototype. **** start-sanitize-chill **** * ch-exp.y (BIT_STRING_LITERAL): Change token type to sval. * ch-exp.y (NUM, PRED, SUCC, ABS, CARD, MAX, MIN, SIZE, UPPER, LOWER, LENGTH): New tokens for keywords. * ch-exp.y (chill_value_built_in_routine_call, mode_argument, upper_lower_argument, length_argument, array_mode_name, string_mode_name, variant_structure_mode_name): New non-terminals and productions. * ch-exp.y (literal): Useful production for BIT_STRING_LITERAL. * ch-exp.y (match_bitstring_literal): New lexer support function to recognize bitstring literals. * ch-exp.y (tokentab6): New token table for 6 character keywords. * ch-exp.y (tokentab5): Add LOWER, UPPER. * ch-exp.y (tokentab4): Add PRED, SUCC, CARD, SIZE. * ch-exp.y (tokentab3): Add NUM, ABS, MIN, MAX. * ch-exp.y (yylex): Check tokentab6. * ch-exp.y (yylex): Call match_bitstring_literal. **** end-sanitize-chill ****
1993-01-06 17:52:10 +01:00
int bitoffset = 0;
int bitcount = 0;
int bits_per_char;
* defs.h (HOST_CHAR_BIT): New macro, defaults to either CHAR_BIT from a configuration file (typically including <limits.h>), or to TARGET_CHAR_BIT if CHAR_BIT is not defined. * eval.c (evaluate_subexp): Use new BYTES_TO_EXP_ELEM macro. * eval.c (evaluate_subexp): Add case for OP_BITSTRING. * expprint.c (print_subexp): Use new BYTES_TO_EXP_ELEM macro. * exppritn.c (print_subexp, dump_expression): Add case for OP_BITSTRING. * expression.h (OP_BITSTRING): New expression element type for packed bitstrings. * expression.h (EXP_ELEM_TO_BYTES, BYTES_TO_EXP_ELEM): New macros to convert between number of expression elements and bytes to store that many elements. * i960-tdep.c (leafproc_return): Use new macros to access minimal symbol name and address fields. * m88k-pinsn.c (sprint_address): Use new macros to access minimal symbol name and address fields. * nindy-tdep.c (nindy_frame_chain_valid): Use new macro to access minimal symbol address field. * parse.c (write_exp_elt, write_exp_string, prefixify_expression, parse_exp_1): Use new EXP_ELEM_TO_BYTES macro. * parse.c (write_exp_string, length_of_subexp, prefixify_expression): Use new BYTES_TO_EXP_ELEM macro. * parse.c (write_exp_bitstring): New function to write packed bitstrings into the expression element vector. * parse.c (length_of_subexp, prefixify_subexp): Add case for OP_BITSTRING. * parser-defs.h (struct stoken): Document that it is used for OP_BITSTRING as well as OP_STRING. * parser-defs.h (write_exp_bitstring): Add prototype. **** start-sanitize-chill **** * ch-exp.y (BIT_STRING_LITERAL): Change token type to sval. * ch-exp.y (NUM, PRED, SUCC, ABS, CARD, MAX, MIN, SIZE, UPPER, LOWER, LENGTH): New tokens for keywords. * ch-exp.y (chill_value_built_in_routine_call, mode_argument, upper_lower_argument, length_argument, array_mode_name, string_mode_name, variant_structure_mode_name): New non-terminals and productions. * ch-exp.y (literal): Useful production for BIT_STRING_LITERAL. * ch-exp.y (match_bitstring_literal): New lexer support function to recognize bitstring literals. * ch-exp.y (tokentab6): New token table for 6 character keywords. * ch-exp.y (tokentab5): Add LOWER, UPPER. * ch-exp.y (tokentab4): Add PRED, SUCC, CARD, SIZE. * ch-exp.y (tokentab3): Add NUM, ABS, MIN, MAX. * ch-exp.y (yylex): Check tokentab6. * ch-exp.y (yylex): Call match_bitstring_literal. **** end-sanitize-chill ****
1993-01-06 17:52:10 +01:00
int digit;
tempbufindex = 0;
CHECKBUF (1);
tempbuf[0] = 0;
* defs.h (HOST_CHAR_BIT): New macro, defaults to either CHAR_BIT from a configuration file (typically including <limits.h>), or to TARGET_CHAR_BIT if CHAR_BIT is not defined. * eval.c (evaluate_subexp): Use new BYTES_TO_EXP_ELEM macro. * eval.c (evaluate_subexp): Add case for OP_BITSTRING. * expprint.c (print_subexp): Use new BYTES_TO_EXP_ELEM macro. * exppritn.c (print_subexp, dump_expression): Add case for OP_BITSTRING. * expression.h (OP_BITSTRING): New expression element type for packed bitstrings. * expression.h (EXP_ELEM_TO_BYTES, BYTES_TO_EXP_ELEM): New macros to convert between number of expression elements and bytes to store that many elements. * i960-tdep.c (leafproc_return): Use new macros to access minimal symbol name and address fields. * m88k-pinsn.c (sprint_address): Use new macros to access minimal symbol name and address fields. * nindy-tdep.c (nindy_frame_chain_valid): Use new macro to access minimal symbol address field. * parse.c (write_exp_elt, write_exp_string, prefixify_expression, parse_exp_1): Use new EXP_ELEM_TO_BYTES macro. * parse.c (write_exp_string, length_of_subexp, prefixify_expression): Use new BYTES_TO_EXP_ELEM macro. * parse.c (write_exp_bitstring): New function to write packed bitstrings into the expression element vector. * parse.c (length_of_subexp, prefixify_subexp): Add case for OP_BITSTRING. * parser-defs.h (struct stoken): Document that it is used for OP_BITSTRING as well as OP_STRING. * parser-defs.h (write_exp_bitstring): Add prototype. **** start-sanitize-chill **** * ch-exp.y (BIT_STRING_LITERAL): Change token type to sval. * ch-exp.y (NUM, PRED, SUCC, ABS, CARD, MAX, MIN, SIZE, UPPER, LOWER, LENGTH): New tokens for keywords. * ch-exp.y (chill_value_built_in_routine_call, mode_argument, upper_lower_argument, length_argument, array_mode_name, string_mode_name, variant_structure_mode_name): New non-terminals and productions. * ch-exp.y (literal): Useful production for BIT_STRING_LITERAL. * ch-exp.y (match_bitstring_literal): New lexer support function to recognize bitstring literals. * ch-exp.y (tokentab6): New token table for 6 character keywords. * ch-exp.y (tokentab5): Add LOWER, UPPER. * ch-exp.y (tokentab4): Add PRED, SUCC, CARD, SIZE. * ch-exp.y (tokentab3): Add NUM, ABS, MIN, MAX. * ch-exp.y (yylex): Check tokentab6. * ch-exp.y (yylex): Call match_bitstring_literal. **** end-sanitize-chill ****
1993-01-06 17:52:10 +01:00
/* Look for the required explicit base specifier. */
switch (*tokptr++)
{
case 'b':
case 'B':
bits_per_char = 1;
* defs.h (HOST_CHAR_BIT): New macro, defaults to either CHAR_BIT from a configuration file (typically including <limits.h>), or to TARGET_CHAR_BIT if CHAR_BIT is not defined. * eval.c (evaluate_subexp): Use new BYTES_TO_EXP_ELEM macro. * eval.c (evaluate_subexp): Add case for OP_BITSTRING. * expprint.c (print_subexp): Use new BYTES_TO_EXP_ELEM macro. * exppritn.c (print_subexp, dump_expression): Add case for OP_BITSTRING. * expression.h (OP_BITSTRING): New expression element type for packed bitstrings. * expression.h (EXP_ELEM_TO_BYTES, BYTES_TO_EXP_ELEM): New macros to convert between number of expression elements and bytes to store that many elements. * i960-tdep.c (leafproc_return): Use new macros to access minimal symbol name and address fields. * m88k-pinsn.c (sprint_address): Use new macros to access minimal symbol name and address fields. * nindy-tdep.c (nindy_frame_chain_valid): Use new macro to access minimal symbol address field. * parse.c (write_exp_elt, write_exp_string, prefixify_expression, parse_exp_1): Use new EXP_ELEM_TO_BYTES macro. * parse.c (write_exp_string, length_of_subexp, prefixify_expression): Use new BYTES_TO_EXP_ELEM macro. * parse.c (write_exp_bitstring): New function to write packed bitstrings into the expression element vector. * parse.c (length_of_subexp, prefixify_subexp): Add case for OP_BITSTRING. * parser-defs.h (struct stoken): Document that it is used for OP_BITSTRING as well as OP_STRING. * parser-defs.h (write_exp_bitstring): Add prototype. **** start-sanitize-chill **** * ch-exp.y (BIT_STRING_LITERAL): Change token type to sval. * ch-exp.y (NUM, PRED, SUCC, ABS, CARD, MAX, MIN, SIZE, UPPER, LOWER, LENGTH): New tokens for keywords. * ch-exp.y (chill_value_built_in_routine_call, mode_argument, upper_lower_argument, length_argument, array_mode_name, string_mode_name, variant_structure_mode_name): New non-terminals and productions. * ch-exp.y (literal): Useful production for BIT_STRING_LITERAL. * ch-exp.y (match_bitstring_literal): New lexer support function to recognize bitstring literals. * ch-exp.y (tokentab6): New token table for 6 character keywords. * ch-exp.y (tokentab5): Add LOWER, UPPER. * ch-exp.y (tokentab4): Add PRED, SUCC, CARD, SIZE. * ch-exp.y (tokentab3): Add NUM, ABS, MIN, MAX. * ch-exp.y (yylex): Check tokentab6. * ch-exp.y (yylex): Call match_bitstring_literal. **** end-sanitize-chill ****
1993-01-06 17:52:10 +01:00
break;
case 'o':
case 'O':
bits_per_char = 3;
* defs.h (HOST_CHAR_BIT): New macro, defaults to either CHAR_BIT from a configuration file (typically including <limits.h>), or to TARGET_CHAR_BIT if CHAR_BIT is not defined. * eval.c (evaluate_subexp): Use new BYTES_TO_EXP_ELEM macro. * eval.c (evaluate_subexp): Add case for OP_BITSTRING. * expprint.c (print_subexp): Use new BYTES_TO_EXP_ELEM macro. * exppritn.c (print_subexp, dump_expression): Add case for OP_BITSTRING. * expression.h (OP_BITSTRING): New expression element type for packed bitstrings. * expression.h (EXP_ELEM_TO_BYTES, BYTES_TO_EXP_ELEM): New macros to convert between number of expression elements and bytes to store that many elements. * i960-tdep.c (leafproc_return): Use new macros to access minimal symbol name and address fields. * m88k-pinsn.c (sprint_address): Use new macros to access minimal symbol name and address fields. * nindy-tdep.c (nindy_frame_chain_valid): Use new macro to access minimal symbol address field. * parse.c (write_exp_elt, write_exp_string, prefixify_expression, parse_exp_1): Use new EXP_ELEM_TO_BYTES macro. * parse.c (write_exp_string, length_of_subexp, prefixify_expression): Use new BYTES_TO_EXP_ELEM macro. * parse.c (write_exp_bitstring): New function to write packed bitstrings into the expression element vector. * parse.c (length_of_subexp, prefixify_subexp): Add case for OP_BITSTRING. * parser-defs.h (struct stoken): Document that it is used for OP_BITSTRING as well as OP_STRING. * parser-defs.h (write_exp_bitstring): Add prototype. **** start-sanitize-chill **** * ch-exp.y (BIT_STRING_LITERAL): Change token type to sval. * ch-exp.y (NUM, PRED, SUCC, ABS, CARD, MAX, MIN, SIZE, UPPER, LOWER, LENGTH): New tokens for keywords. * ch-exp.y (chill_value_built_in_routine_call, mode_argument, upper_lower_argument, length_argument, array_mode_name, string_mode_name, variant_structure_mode_name): New non-terminals and productions. * ch-exp.y (literal): Useful production for BIT_STRING_LITERAL. * ch-exp.y (match_bitstring_literal): New lexer support function to recognize bitstring literals. * ch-exp.y (tokentab6): New token table for 6 character keywords. * ch-exp.y (tokentab5): Add LOWER, UPPER. * ch-exp.y (tokentab4): Add PRED, SUCC, CARD, SIZE. * ch-exp.y (tokentab3): Add NUM, ABS, MIN, MAX. * ch-exp.y (yylex): Check tokentab6. * ch-exp.y (yylex): Call match_bitstring_literal. **** end-sanitize-chill ****
1993-01-06 17:52:10 +01:00
break;
case 'h':
case 'H':
bits_per_char = 4;
* defs.h (HOST_CHAR_BIT): New macro, defaults to either CHAR_BIT from a configuration file (typically including <limits.h>), or to TARGET_CHAR_BIT if CHAR_BIT is not defined. * eval.c (evaluate_subexp): Use new BYTES_TO_EXP_ELEM macro. * eval.c (evaluate_subexp): Add case for OP_BITSTRING. * expprint.c (print_subexp): Use new BYTES_TO_EXP_ELEM macro. * exppritn.c (print_subexp, dump_expression): Add case for OP_BITSTRING. * expression.h (OP_BITSTRING): New expression element type for packed bitstrings. * expression.h (EXP_ELEM_TO_BYTES, BYTES_TO_EXP_ELEM): New macros to convert between number of expression elements and bytes to store that many elements. * i960-tdep.c (leafproc_return): Use new macros to access minimal symbol name and address fields. * m88k-pinsn.c (sprint_address): Use new macros to access minimal symbol name and address fields. * nindy-tdep.c (nindy_frame_chain_valid): Use new macro to access minimal symbol address field. * parse.c (write_exp_elt, write_exp_string, prefixify_expression, parse_exp_1): Use new EXP_ELEM_TO_BYTES macro. * parse.c (write_exp_string, length_of_subexp, prefixify_expression): Use new BYTES_TO_EXP_ELEM macro. * parse.c (write_exp_bitstring): New function to write packed bitstrings into the expression element vector. * parse.c (length_of_subexp, prefixify_subexp): Add case for OP_BITSTRING. * parser-defs.h (struct stoken): Document that it is used for OP_BITSTRING as well as OP_STRING. * parser-defs.h (write_exp_bitstring): Add prototype. **** start-sanitize-chill **** * ch-exp.y (BIT_STRING_LITERAL): Change token type to sval. * ch-exp.y (NUM, PRED, SUCC, ABS, CARD, MAX, MIN, SIZE, UPPER, LOWER, LENGTH): New tokens for keywords. * ch-exp.y (chill_value_built_in_routine_call, mode_argument, upper_lower_argument, length_argument, array_mode_name, string_mode_name, variant_structure_mode_name): New non-terminals and productions. * ch-exp.y (literal): Useful production for BIT_STRING_LITERAL. * ch-exp.y (match_bitstring_literal): New lexer support function to recognize bitstring literals. * ch-exp.y (tokentab6): New token table for 6 character keywords. * ch-exp.y (tokentab5): Add LOWER, UPPER. * ch-exp.y (tokentab4): Add PRED, SUCC, CARD, SIZE. * ch-exp.y (tokentab3): Add NUM, ABS, MIN, MAX. * ch-exp.y (yylex): Check tokentab6. * ch-exp.y (yylex): Call match_bitstring_literal. **** end-sanitize-chill ****
1993-01-06 17:52:10 +01:00
break;
default:
return (0);
break;
}
* defs.h (HOST_CHAR_BIT): New macro, defaults to either CHAR_BIT from a configuration file (typically including <limits.h>), or to TARGET_CHAR_BIT if CHAR_BIT is not defined. * eval.c (evaluate_subexp): Use new BYTES_TO_EXP_ELEM macro. * eval.c (evaluate_subexp): Add case for OP_BITSTRING. * expprint.c (print_subexp): Use new BYTES_TO_EXP_ELEM macro. * exppritn.c (print_subexp, dump_expression): Add case for OP_BITSTRING. * expression.h (OP_BITSTRING): New expression element type for packed bitstrings. * expression.h (EXP_ELEM_TO_BYTES, BYTES_TO_EXP_ELEM): New macros to convert between number of expression elements and bytes to store that many elements. * i960-tdep.c (leafproc_return): Use new macros to access minimal symbol name and address fields. * m88k-pinsn.c (sprint_address): Use new macros to access minimal symbol name and address fields. * nindy-tdep.c (nindy_frame_chain_valid): Use new macro to access minimal symbol address field. * parse.c (write_exp_elt, write_exp_string, prefixify_expression, parse_exp_1): Use new EXP_ELEM_TO_BYTES macro. * parse.c (write_exp_string, length_of_subexp, prefixify_expression): Use new BYTES_TO_EXP_ELEM macro. * parse.c (write_exp_bitstring): New function to write packed bitstrings into the expression element vector. * parse.c (length_of_subexp, prefixify_subexp): Add case for OP_BITSTRING. * parser-defs.h (struct stoken): Document that it is used for OP_BITSTRING as well as OP_STRING. * parser-defs.h (write_exp_bitstring): Add prototype. **** start-sanitize-chill **** * ch-exp.y (BIT_STRING_LITERAL): Change token type to sval. * ch-exp.y (NUM, PRED, SUCC, ABS, CARD, MAX, MIN, SIZE, UPPER, LOWER, LENGTH): New tokens for keywords. * ch-exp.y (chill_value_built_in_routine_call, mode_argument, upper_lower_argument, length_argument, array_mode_name, string_mode_name, variant_structure_mode_name): New non-terminals and productions. * ch-exp.y (literal): Useful production for BIT_STRING_LITERAL. * ch-exp.y (match_bitstring_literal): New lexer support function to recognize bitstring literals. * ch-exp.y (tokentab6): New token table for 6 character keywords. * ch-exp.y (tokentab5): Add LOWER, UPPER. * ch-exp.y (tokentab4): Add PRED, SUCC, CARD, SIZE. * ch-exp.y (tokentab3): Add NUM, ABS, MIN, MAX. * ch-exp.y (yylex): Check tokentab6. * ch-exp.y (yylex): Call match_bitstring_literal. **** end-sanitize-chill ****
1993-01-06 17:52:10 +01:00
/* Ensure that the character after the explicit base is a single quote. */
if (*tokptr++ != '\'')
{
return (0);
}
while (*tokptr != '\0' && *tokptr != '\'')
{
* ch-exp.y (decode_integer_value, match_character_literal, match_bitstring_literal): Guard tolower calls with isupper, tolower on old BSD systems blindly subtracts a constant. * dbxread.c (read_ofile_symtab): Check for __gnu_compiled_* as well when determining the producer of the object file. * mdebugread.c (has_opaque_xref): New function to check for cross reference to an opaque aggregate. * mdebugread.c (parse_symbol, parse_partial_symbols): Do not enter typedefs to opaque aggregates into the symbol tables. * mdebugread.c (parse_external): Remove skip_procedures argument, it has always been 1. Remove code that handled stProc symbols, it was never executed and was wrong, as the index of a stProc symbol points to the local symbol table and not to the auxiliary symbol info. Update caller. * mdebugread.c (parse_partial_symbols): Do not enter external stProc symbols into the partial symbol table, they are already entered into the minimal symbol table. * config/i386/tm-symmetry.h: Clean up, it is now only used for Dynix. Remove all conditionals and definitions for ptx. I386_REGNO_TO_SYMMETRY moved to here from symm-tdep.c. Fix addresses of floating point registers in REGISTER_U_ADDR. STORE_STRUCT_RETURN now handles cc and gcc conventions. FRAME_CHAIN, FRAMELESS_FUNCTION_INVOCATION, FRAME_SAVED_PC, IN_SIGTRAMP, SIGCONTEXT_PC_OFFSET defined to make backtracing through signal trampoline code work. * config/i386/xm-symmetry.h: Clean up, it is now only used for Dynix. Remove all conditionals and definitions for ptx. Remove KDB definitions. * symm-nat.c (store_inferior_registers): Fetch registers before storing them to obtain valid floating point control registers. Store fpu registers. * symm-nat.c (print_1167_control_word): Dynix 3.1.1 defines FPA_PCR_CC_C0 and FPA_PCR_CC_C1, avoid duplicate case value. * symm-nat.c (fetch_inferior_registers, child_xfer_memory): Fix typos. * symm-nat.c (child_resume): Update type of `signal' parameter. * symm-tdep.c (I386_REGNO_TO_SYMMETRY): Moved to tm-symmetry.h.
1994-03-30 11:57:08 +02:00
digit = *tokptr;
if (isupper (digit))
digit = tolower (digit);
* defs.h (HOST_CHAR_BIT): New macro, defaults to either CHAR_BIT from a configuration file (typically including <limits.h>), or to TARGET_CHAR_BIT if CHAR_BIT is not defined. * eval.c (evaluate_subexp): Use new BYTES_TO_EXP_ELEM macro. * eval.c (evaluate_subexp): Add case for OP_BITSTRING. * expprint.c (print_subexp): Use new BYTES_TO_EXP_ELEM macro. * exppritn.c (print_subexp, dump_expression): Add case for OP_BITSTRING. * expression.h (OP_BITSTRING): New expression element type for packed bitstrings. * expression.h (EXP_ELEM_TO_BYTES, BYTES_TO_EXP_ELEM): New macros to convert between number of expression elements and bytes to store that many elements. * i960-tdep.c (leafproc_return): Use new macros to access minimal symbol name and address fields. * m88k-pinsn.c (sprint_address): Use new macros to access minimal symbol name and address fields. * nindy-tdep.c (nindy_frame_chain_valid): Use new macro to access minimal symbol address field. * parse.c (write_exp_elt, write_exp_string, prefixify_expression, parse_exp_1): Use new EXP_ELEM_TO_BYTES macro. * parse.c (write_exp_string, length_of_subexp, prefixify_expression): Use new BYTES_TO_EXP_ELEM macro. * parse.c (write_exp_bitstring): New function to write packed bitstrings into the expression element vector. * parse.c (length_of_subexp, prefixify_subexp): Add case for OP_BITSTRING. * parser-defs.h (struct stoken): Document that it is used for OP_BITSTRING as well as OP_STRING. * parser-defs.h (write_exp_bitstring): Add prototype. **** start-sanitize-chill **** * ch-exp.y (BIT_STRING_LITERAL): Change token type to sval. * ch-exp.y (NUM, PRED, SUCC, ABS, CARD, MAX, MIN, SIZE, UPPER, LOWER, LENGTH): New tokens for keywords. * ch-exp.y (chill_value_built_in_routine_call, mode_argument, upper_lower_argument, length_argument, array_mode_name, string_mode_name, variant_structure_mode_name): New non-terminals and productions. * ch-exp.y (literal): Useful production for BIT_STRING_LITERAL. * ch-exp.y (match_bitstring_literal): New lexer support function to recognize bitstring literals. * ch-exp.y (tokentab6): New token table for 6 character keywords. * ch-exp.y (tokentab5): Add LOWER, UPPER. * ch-exp.y (tokentab4): Add PRED, SUCC, CARD, SIZE. * ch-exp.y (tokentab3): Add NUM, ABS, MIN, MAX. * ch-exp.y (yylex): Check tokentab6. * ch-exp.y (yylex): Call match_bitstring_literal. **** end-sanitize-chill ****
1993-01-06 17:52:10 +01:00
tokptr++;
switch (digit)
{
case '_':
continue;
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
digit -= '0';
break;
case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
digit -= 'a';
digit += 10;
break;
default:
return (0);
break;
}
if (digit >= 1 << bits_per_char)
* defs.h (HOST_CHAR_BIT): New macro, defaults to either CHAR_BIT from a configuration file (typically including <limits.h>), or to TARGET_CHAR_BIT if CHAR_BIT is not defined. * eval.c (evaluate_subexp): Use new BYTES_TO_EXP_ELEM macro. * eval.c (evaluate_subexp): Add case for OP_BITSTRING. * expprint.c (print_subexp): Use new BYTES_TO_EXP_ELEM macro. * exppritn.c (print_subexp, dump_expression): Add case for OP_BITSTRING. * expression.h (OP_BITSTRING): New expression element type for packed bitstrings. * expression.h (EXP_ELEM_TO_BYTES, BYTES_TO_EXP_ELEM): New macros to convert between number of expression elements and bytes to store that many elements. * i960-tdep.c (leafproc_return): Use new macros to access minimal symbol name and address fields. * m88k-pinsn.c (sprint_address): Use new macros to access minimal symbol name and address fields. * nindy-tdep.c (nindy_frame_chain_valid): Use new macro to access minimal symbol address field. * parse.c (write_exp_elt, write_exp_string, prefixify_expression, parse_exp_1): Use new EXP_ELEM_TO_BYTES macro. * parse.c (write_exp_string, length_of_subexp, prefixify_expression): Use new BYTES_TO_EXP_ELEM macro. * parse.c (write_exp_bitstring): New function to write packed bitstrings into the expression element vector. * parse.c (length_of_subexp, prefixify_subexp): Add case for OP_BITSTRING. * parser-defs.h (struct stoken): Document that it is used for OP_BITSTRING as well as OP_STRING. * parser-defs.h (write_exp_bitstring): Add prototype. **** start-sanitize-chill **** * ch-exp.y (BIT_STRING_LITERAL): Change token type to sval. * ch-exp.y (NUM, PRED, SUCC, ABS, CARD, MAX, MIN, SIZE, UPPER, LOWER, LENGTH): New tokens for keywords. * ch-exp.y (chill_value_built_in_routine_call, mode_argument, upper_lower_argument, length_argument, array_mode_name, string_mode_name, variant_structure_mode_name): New non-terminals and productions. * ch-exp.y (literal): Useful production for BIT_STRING_LITERAL. * ch-exp.y (match_bitstring_literal): New lexer support function to recognize bitstring literals. * ch-exp.y (tokentab6): New token table for 6 character keywords. * ch-exp.y (tokentab5): Add LOWER, UPPER. * ch-exp.y (tokentab4): Add PRED, SUCC, CARD, SIZE. * ch-exp.y (tokentab3): Add NUM, ABS, MIN, MAX. * ch-exp.y (yylex): Check tokentab6. * ch-exp.y (yylex): Call match_bitstring_literal. **** end-sanitize-chill ****
1993-01-06 17:52:10 +01:00
{
/* Found something not in domain for current base. */
return (0);
}
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++)
* defs.h (HOST_CHAR_BIT): New macro, defaults to either CHAR_BIT from a configuration file (typically including <limits.h>), or to TARGET_CHAR_BIT if CHAR_BIT is not defined. * eval.c (evaluate_subexp): Use new BYTES_TO_EXP_ELEM macro. * eval.c (evaluate_subexp): Add case for OP_BITSTRING. * expprint.c (print_subexp): Use new BYTES_TO_EXP_ELEM macro. * exppritn.c (print_subexp, dump_expression): Add case for OP_BITSTRING. * expression.h (OP_BITSTRING): New expression element type for packed bitstrings. * expression.h (EXP_ELEM_TO_BYTES, BYTES_TO_EXP_ELEM): New macros to convert between number of expression elements and bytes to store that many elements. * i960-tdep.c (leafproc_return): Use new macros to access minimal symbol name and address fields. * m88k-pinsn.c (sprint_address): Use new macros to access minimal symbol name and address fields. * nindy-tdep.c (nindy_frame_chain_valid): Use new macro to access minimal symbol address field. * parse.c (write_exp_elt, write_exp_string, prefixify_expression, parse_exp_1): Use new EXP_ELEM_TO_BYTES macro. * parse.c (write_exp_string, length_of_subexp, prefixify_expression): Use new BYTES_TO_EXP_ELEM macro. * parse.c (write_exp_bitstring): New function to write packed bitstrings into the expression element vector. * parse.c (length_of_subexp, prefixify_subexp): Add case for OP_BITSTRING. * parser-defs.h (struct stoken): Document that it is used for OP_BITSTRING as well as OP_STRING. * parser-defs.h (write_exp_bitstring): Add prototype. **** start-sanitize-chill **** * ch-exp.y (BIT_STRING_LITERAL): Change token type to sval. * ch-exp.y (NUM, PRED, SUCC, ABS, CARD, MAX, MIN, SIZE, UPPER, LOWER, LENGTH): New tokens for keywords. * ch-exp.y (chill_value_built_in_routine_call, mode_argument, upper_lower_argument, length_argument, array_mode_name, string_mode_name, variant_structure_mode_name): New non-terminals and productions. * ch-exp.y (literal): Useful production for BIT_STRING_LITERAL. * ch-exp.y (match_bitstring_literal): New lexer support function to recognize bitstring literals. * ch-exp.y (tokentab6): New token table for 6 character keywords. * ch-exp.y (tokentab5): Add LOWER, UPPER. * ch-exp.y (tokentab4): Add PRED, SUCC, CARD, SIZE. * ch-exp.y (tokentab3): Add NUM, ABS, MIN, MAX. * ch-exp.y (yylex): Check tokentab6. * ch-exp.y (yylex): Call match_bitstring_literal. **** end-sanitize-chill ****
1993-01-06 17:52:10 +01:00
{
bitcount++;
if (digit & (1 << k))
* defs.h (HOST_CHAR_BIT): New macro, defaults to either CHAR_BIT from a configuration file (typically including <limits.h>), or to TARGET_CHAR_BIT if CHAR_BIT is not defined. * eval.c (evaluate_subexp): Use new BYTES_TO_EXP_ELEM macro. * eval.c (evaluate_subexp): Add case for OP_BITSTRING. * expprint.c (print_subexp): Use new BYTES_TO_EXP_ELEM macro. * exppritn.c (print_subexp, dump_expression): Add case for OP_BITSTRING. * expression.h (OP_BITSTRING): New expression element type for packed bitstrings. * expression.h (EXP_ELEM_TO_BYTES, BYTES_TO_EXP_ELEM): New macros to convert between number of expression elements and bytes to store that many elements. * i960-tdep.c (leafproc_return): Use new macros to access minimal symbol name and address fields. * m88k-pinsn.c (sprint_address): Use new macros to access minimal symbol name and address fields. * nindy-tdep.c (nindy_frame_chain_valid): Use new macro to access minimal symbol address field. * parse.c (write_exp_elt, write_exp_string, prefixify_expression, parse_exp_1): Use new EXP_ELEM_TO_BYTES macro. * parse.c (write_exp_string, length_of_subexp, prefixify_expression): Use new BYTES_TO_EXP_ELEM macro. * parse.c (write_exp_bitstring): New function to write packed bitstrings into the expression element vector. * parse.c (length_of_subexp, prefixify_subexp): Add case for OP_BITSTRING. * parser-defs.h (struct stoken): Document that it is used for OP_BITSTRING as well as OP_STRING. * parser-defs.h (write_exp_bitstring): Add prototype. **** start-sanitize-chill **** * ch-exp.y (BIT_STRING_LITERAL): Change token type to sval. * ch-exp.y (NUM, PRED, SUCC, ABS, CARD, MAX, MIN, SIZE, UPPER, LOWER, LENGTH): New tokens for keywords. * ch-exp.y (chill_value_built_in_routine_call, mode_argument, upper_lower_argument, length_argument, array_mode_name, string_mode_name, variant_structure_mode_name): New non-terminals and productions. * ch-exp.y (literal): Useful production for BIT_STRING_LITERAL. * ch-exp.y (match_bitstring_literal): New lexer support function to recognize bitstring literals. * ch-exp.y (tokentab6): New token table for 6 character keywords. * ch-exp.y (tokentab5): Add LOWER, UPPER. * ch-exp.y (tokentab4): Add PRED, SUCC, CARD, SIZE. * ch-exp.y (tokentab3): Add NUM, ABS, MIN, MAX. * ch-exp.y (yylex): Check tokentab6. * ch-exp.y (yylex): Call match_bitstring_literal. **** end-sanitize-chill ****
1993-01-06 17:52:10 +01:00
{
tempbuf[tempbufindex] |=
(TARGET_BYTE_ORDER == BIG_ENDIAN)
? (1 << (HOST_CHAR_BIT - 1 - bitoffset))
: (1 << bitoffset);
* defs.h (HOST_CHAR_BIT): New macro, defaults to either CHAR_BIT from a configuration file (typically including <limits.h>), or to TARGET_CHAR_BIT if CHAR_BIT is not defined. * eval.c (evaluate_subexp): Use new BYTES_TO_EXP_ELEM macro. * eval.c (evaluate_subexp): Add case for OP_BITSTRING. * expprint.c (print_subexp): Use new BYTES_TO_EXP_ELEM macro. * exppritn.c (print_subexp, dump_expression): Add case for OP_BITSTRING. * expression.h (OP_BITSTRING): New expression element type for packed bitstrings. * expression.h (EXP_ELEM_TO_BYTES, BYTES_TO_EXP_ELEM): New macros to convert between number of expression elements and bytes to store that many elements. * i960-tdep.c (leafproc_return): Use new macros to access minimal symbol name and address fields. * m88k-pinsn.c (sprint_address): Use new macros to access minimal symbol name and address fields. * nindy-tdep.c (nindy_frame_chain_valid): Use new macro to access minimal symbol address field. * parse.c (write_exp_elt, write_exp_string, prefixify_expression, parse_exp_1): Use new EXP_ELEM_TO_BYTES macro. * parse.c (write_exp_string, length_of_subexp, prefixify_expression): Use new BYTES_TO_EXP_ELEM macro. * parse.c (write_exp_bitstring): New function to write packed bitstrings into the expression element vector. * parse.c (length_of_subexp, prefixify_subexp): Add case for OP_BITSTRING. * parser-defs.h (struct stoken): Document that it is used for OP_BITSTRING as well as OP_STRING. * parser-defs.h (write_exp_bitstring): Add prototype. **** start-sanitize-chill **** * ch-exp.y (BIT_STRING_LITERAL): Change token type to sval. * ch-exp.y (NUM, PRED, SUCC, ABS, CARD, MAX, MIN, SIZE, UPPER, LOWER, LENGTH): New tokens for keywords. * ch-exp.y (chill_value_built_in_routine_call, mode_argument, upper_lower_argument, length_argument, array_mode_name, string_mode_name, variant_structure_mode_name): New non-terminals and productions. * ch-exp.y (literal): Useful production for BIT_STRING_LITERAL. * ch-exp.y (match_bitstring_literal): New lexer support function to recognize bitstring literals. * ch-exp.y (tokentab6): New token table for 6 character keywords. * ch-exp.y (tokentab5): Add LOWER, UPPER. * ch-exp.y (tokentab4): Add PRED, SUCC, CARD, SIZE. * ch-exp.y (tokentab3): Add NUM, ABS, MIN, MAX. * ch-exp.y (yylex): Check tokentab6. * ch-exp.y (yylex): Call match_bitstring_literal. **** end-sanitize-chill ****
1993-01-06 17:52:10 +01:00
}
bitoffset++;
if (bitoffset == HOST_CHAR_BIT)
{
bitoffset = 0;
tempbufindex++;
CHECKBUF(1);
tempbuf[tempbufindex] = 0;
* defs.h (HOST_CHAR_BIT): New macro, defaults to either CHAR_BIT from a configuration file (typically including <limits.h>), or to TARGET_CHAR_BIT if CHAR_BIT is not defined. * eval.c (evaluate_subexp): Use new BYTES_TO_EXP_ELEM macro. * eval.c (evaluate_subexp): Add case for OP_BITSTRING. * expprint.c (print_subexp): Use new BYTES_TO_EXP_ELEM macro. * exppritn.c (print_subexp, dump_expression): Add case for OP_BITSTRING. * expression.h (OP_BITSTRING): New expression element type for packed bitstrings. * expression.h (EXP_ELEM_TO_BYTES, BYTES_TO_EXP_ELEM): New macros to convert between number of expression elements and bytes to store that many elements. * i960-tdep.c (leafproc_return): Use new macros to access minimal symbol name and address fields. * m88k-pinsn.c (sprint_address): Use new macros to access minimal symbol name and address fields. * nindy-tdep.c (nindy_frame_chain_valid): Use new macro to access minimal symbol address field. * parse.c (write_exp_elt, write_exp_string, prefixify_expression, parse_exp_1): Use new EXP_ELEM_TO_BYTES macro. * parse.c (write_exp_string, length_of_subexp, prefixify_expression): Use new BYTES_TO_EXP_ELEM macro. * parse.c (write_exp_bitstring): New function to write packed bitstrings into the expression element vector. * parse.c (length_of_subexp, prefixify_subexp): Add case for OP_BITSTRING. * parser-defs.h (struct stoken): Document that it is used for OP_BITSTRING as well as OP_STRING. * parser-defs.h (write_exp_bitstring): Add prototype. **** start-sanitize-chill **** * ch-exp.y (BIT_STRING_LITERAL): Change token type to sval. * ch-exp.y (NUM, PRED, SUCC, ABS, CARD, MAX, MIN, SIZE, UPPER, LOWER, LENGTH): New tokens for keywords. * ch-exp.y (chill_value_built_in_routine_call, mode_argument, upper_lower_argument, length_argument, array_mode_name, string_mode_name, variant_structure_mode_name): New non-terminals and productions. * ch-exp.y (literal): Useful production for BIT_STRING_LITERAL. * ch-exp.y (match_bitstring_literal): New lexer support function to recognize bitstring literals. * ch-exp.y (tokentab6): New token table for 6 character keywords. * ch-exp.y (tokentab5): Add LOWER, UPPER. * ch-exp.y (tokentab4): Add PRED, SUCC, CARD, SIZE. * ch-exp.y (tokentab3): Add NUM, ABS, MIN, MAX. * ch-exp.y (yylex): Check tokentab6. * ch-exp.y (yylex): Call match_bitstring_literal. **** end-sanitize-chill ****
1993-01-06 17:52:10 +01:00
}
}
}
}
/* Verify that we consumed everything up to the trailing single quote,
and that we found some bits (IE not just underbars). */
if (*tokptr++ != '\'')
{
return (0);
}
else
{
yylval.sval.ptr = tempbuf;
yylval.sval.length = bitcount;
lexptr = tokptr;
return (BIT_STRING_LITERAL);
}
}
/* Recognize tokens that start with '$'. These include:
$regname A native register name or a "standard
register name".
Return token GDB_REGNAME.
$variable A convenience variable with a name chosen
by the user.
Return token GDB_VARIABLE.
$digits Value history with index <digits>, starting
from the first value which has index 1.
Return GDB_LAST.
$$digits Value history with index <digits> relative
to the last value. I.E. $$0 is the last
value, $$1 is the one previous to that, $$2
is the one previous to $$1, etc.
Return token GDB_LAST.
$ | $0 | $$0 The last value in the value history.
Return token GDB_LAST.
$$ An abbreviation for the second to the last
value in the value history, I.E. $$1
Return token GDB_LAST.
Note that we currently assume that register names and convenience
variables follow the convention of starting with a letter or '_'.
*/
static int
match_dollar_tokens ()
{
char *tokptr;
int regno;
int namelength;
int negate;
int ival;
/* We will always have a successful match, even if it is just for
a single '$', the abbreviation for $$0. So advance lexptr. */
tokptr = ++lexptr;
if (*tokptr == '_' || isalpha (*tokptr))
{
/* Look for a match with a native register name, usually something
like "r0" for example. */
for (regno = 0; regno < NUM_REGS; regno++)
{
namelength = strlen (reg_names[regno]);
if (STREQN (tokptr, reg_names[regno], namelength)
&& !isalnum (tokptr[namelength]))
{
yylval.lval = regno;
lexptr += namelength;
return (GDB_REGNAME);
}
}
/* Look for a match with a standard register name, usually something
like "pc", which gdb always recognizes as the program counter
regardless of what the native register name is. */
for (regno = 0; regno < num_std_regs; regno++)
{
namelength = strlen (std_regs[regno].name);
if (STREQN (tokptr, std_regs[regno].name, namelength)
&& !isalnum (tokptr[namelength]))
{
yylval.lval = std_regs[regno].regnum;
lexptr += namelength;
return (GDB_REGNAME);
}
}
/* Attempt to match against a convenience variable. Note that
this will always succeed, because if no variable of that name
already exists, the lookup_internalvar will create one for us.
Also note that both lexptr and tokptr currently point to the
start of the input string we are trying to match, and that we
have already tested the first character for non-numeric, so we
don't have to treat it specially. */
while (*tokptr == '_' || isalnum (*tokptr))
{
tokptr++;
}
yylval.sval.ptr = lexptr;
yylval.sval.length = tokptr - lexptr;
yylval.ivar = lookup_internalvar (copy_name (yylval.sval));
lexptr = tokptr;
return (GDB_VARIABLE);
}
/* Since we didn't match against a register name or convenience
variable, our only choice left is a history value. */
if (*tokptr == '$')
{
negate = 1;
ival = 1;
tokptr++;
}
else
{
negate = 0;
ival = 0;
}
/* Attempt to decode more characters as an integer value giving
the index in the history list. If successful, the value will
overwrite ival (currently 0 or 1), and if not, ival will be
left alone, which is good since it is currently correct for
the '$' or '$$' case. */
decode_integer_literal (&ival, &tokptr);
yylval.lval = negate ? -ival : ival;
lexptr = tokptr;
return (GDB_LAST);
}
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
struct token
{
char *operator;
int token;
};
static const struct token idtokentab[] =
* defs.h (HOST_CHAR_BIT): New macro, defaults to either CHAR_BIT from a configuration file (typically including <limits.h>), or to TARGET_CHAR_BIT if CHAR_BIT is not defined. * eval.c (evaluate_subexp): Use new BYTES_TO_EXP_ELEM macro. * eval.c (evaluate_subexp): Add case for OP_BITSTRING. * expprint.c (print_subexp): Use new BYTES_TO_EXP_ELEM macro. * exppritn.c (print_subexp, dump_expression): Add case for OP_BITSTRING. * expression.h (OP_BITSTRING): New expression element type for packed bitstrings. * expression.h (EXP_ELEM_TO_BYTES, BYTES_TO_EXP_ELEM): New macros to convert between number of expression elements and bytes to store that many elements. * i960-tdep.c (leafproc_return): Use new macros to access minimal symbol name and address fields. * m88k-pinsn.c (sprint_address): Use new macros to access minimal symbol name and address fields. * nindy-tdep.c (nindy_frame_chain_valid): Use new macro to access minimal symbol address field. * parse.c (write_exp_elt, write_exp_string, prefixify_expression, parse_exp_1): Use new EXP_ELEM_TO_BYTES macro. * parse.c (write_exp_string, length_of_subexp, prefixify_expression): Use new BYTES_TO_EXP_ELEM macro. * parse.c (write_exp_bitstring): New function to write packed bitstrings into the expression element vector. * parse.c (length_of_subexp, prefixify_subexp): Add case for OP_BITSTRING. * parser-defs.h (struct stoken): Document that it is used for OP_BITSTRING as well as OP_STRING. * parser-defs.h (write_exp_bitstring): Add prototype. **** start-sanitize-chill **** * ch-exp.y (BIT_STRING_LITERAL): Change token type to sval. * ch-exp.y (NUM, PRED, SUCC, ABS, CARD, MAX, MIN, SIZE, UPPER, LOWER, LENGTH): New tokens for keywords. * ch-exp.y (chill_value_built_in_routine_call, mode_argument, upper_lower_argument, length_argument, array_mode_name, string_mode_name, variant_structure_mode_name): New non-terminals and productions. * ch-exp.y (literal): Useful production for BIT_STRING_LITERAL. * ch-exp.y (match_bitstring_literal): New lexer support function to recognize bitstring literals. * ch-exp.y (tokentab6): New token table for 6 character keywords. * ch-exp.y (tokentab5): Add LOWER, UPPER. * ch-exp.y (tokentab4): Add PRED, SUCC, CARD, SIZE. * ch-exp.y (tokentab3): Add NUM, ABS, MIN, MAX. * ch-exp.y (yylex): Check tokentab6. * ch-exp.y (yylex): Call match_bitstring_literal. **** end-sanitize-chill ****
1993-01-06 17:52:10 +01:00
{
{ "array", ARRAY },
{ "length", LENGTH },
{ "lower", LOWER },
{ "upper", UPPER },
{ "andif", ANDIF },
{ "pred", PRED },
{ "succ", SUCC },
{ "card", CARD },
{ "size", SIZE },
{ "orif", ORIF },
{ "num", NUM },
{ "abs", ABS },
{ "max", MAX_TOKEN },
{ "min", MIN_TOKEN },
{ "mod", MOD },
{ "rem", REM },
{ "not", NOT },
{ "xor", LOGXOR },
{ "and", LOGAND },
{ "in", IN },
{ "or", LOGIOR },
{ "up", UP },
{ "addr", ADDR_TOKEN },
{ "null", EMPTINESS_LITERAL }
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
};
* Makefile.in (VERSION): Bump to 4.7.4. * Makefile.in (SFILES_MAINDIR): Add typeprint.c, c-typeprint.c, m2-typeprint.c, c-valprint.c cp-valprint.c m2-valprint.c. * Makefile.in (HFILES): Add valprint.h. * Makefile.in (OBS): Add typeprint.o, c-typeprint.o, m2-typeprint.o, c-valprint.o, cp-valprint.o m2-valprint.o. * typeprint.c, typeprint.h: New files for language independent type printing functions. * c-typeprint.c, m2-typeprint.c: New files for language dependent type printing functions and definitions. * valprint.h: New include file for language independent value printing definitions. * c-valprint.c, cp-valprint.c, m2-valprint.c: New files for language dependent value printing functions. * c-exp.y (production ptype): Add range_type variable and use new create_range_type function. * c-exp.y (tokentab2, tokentab3), c-lang.c (c_op_print_tab), infcmd.c (path_var_name), language.c (unk_op_print_tab), m2-lang.c (m2_op_print_tab): Change from ANSI-obsolescent "const static" to ANSI-conformant "static const". * c-exp.y (c_create_fundamental_type): Remove unused nbytes. * c-exp.y (c_language_defn, cplus_language_defn): Add c_print_type, and c_val_print. * c-lang.h (c_print_type, c_val_print): Add prototypes. * coffread.c (decode_type): Add range_type variable and call to new create_range_type function. * complaints.c (complain): Remove unused val variable. * complaints.c (_initialize_complaints): Make it void. * convex-tdep.c (value_of_trapped_internalvar): Add range_type variable and call new create_range_type function. * defs.h (enum val_prettyprint): Move enum from value.h to here so we can avoid having to include value.h just for prototypes that need the enum (thanks ANSI). * dwarfread.c (struct_type): Local anonymous_size variable is only used if !BITS_BIG_ENDIAN. * dwarfread.c (decode_subscript_data_item): Add rangetype variable and call new create_range_type function. * elfread.c (elf_symfile_read): Remove unused dbx and text_sect variables. * eval.c (evaluate_subexp): Remove unused local variable name and the statement with no side effects that initializes it. * expprint.c (print_subexp): Change local_printstr to LA_PRINT_STRING. * gdbtypes.c (create_range_type): New function that creates a range type using code fragments from object file readers as an example of what has to be initialized. * gdbtypes.c (create_array_type): Removed index_type, low_bound, and high_bound parameters, replaced with a single range_type parameter. Change function body to use passed in range_type rather than handcrafting one. * gdbtypes.h (create_range_type): Add prototype. * gdbtypes.h (create_array_type): Change prototype parameters. * infrun.c (normal_stop): Remove unused local variables tem and c. * infrun.c (hook_stop_stub): Return 0 rather than random value. * language.c (unk_lang_print_type, unk_lang_val_print): Add stub functions that call error if called. * language.c (unknown_language_defn, auto_language_defn, local_language_defn): Add initializers unk_lang_print_type and unk_lang_val_print. * language.h (struct language_defn): Reformat for larger comments, add la_print_type and la_val_print members. Add LA_PRINT_TYPE and LA_VAL_PRINT macros. Change local_printchar to LA_PRINT_CHAR and local_printstr to LA_PRINT_STRING. * m2-lang.c (m2_create_fundamental_type): Remove unused local variable nbytes. * m2-lang.c (m2_language_defn): Add initializers m2_print_type and m2_val_print. * m2-lang.h (m2_print_type, m2_val_print): Add prototypes. * main.c (execute_command): Remove unused local variable cmdlines. * main.c (echo_command), stabsread.c (read_type), printcmd.c (clear_displays), symmisc.c (block_depth), values.c (clear_value_history): Make testing of truth value of assignment result explicit. * mipsread.c (upgrade_type): Update FIXME to include future use of create_range_type. * printcmd.c (ptype_command, ptype_eval, whatis_command, whatis_exp, maintenance_print_type): Move prototypes and functions to new typeprint.c. * printcmd.c (_initialize_printcmd): Move add_com calls for ptype_command and whatis_command to new typeprint.c. * ser-bsd.c (serial_open): Remove unused variable sgttyb. * source.c (find_source_lines): Local variable c only used when LSEEK_NOT_LINEAR is defined. * stabsread.c (read_array_type): Use new create_range_type function. * stabsread.c (read_range_type): Add new index_type variable and call new create_range_type function rather than handcrafting range types. * symmisc.c (type_print_1): Change usages to LA_PRINT_TYPE. * symtab.c (typedef_print usages): Use c_typedef_print, renamed. * symtab.c (type_print_base usages): Use c_type_print_base. * symtab.c (type_print_varspec_prefix usages): Use c_type_print_varspec_prefix. * symtab.c (type_print_method_args usages): Use cp_type_print_method_args. * valprint.c: Completely ripped apart and the fragments used to create c-valprint.c, cp-valprint.c, m2-valprint.c, and valprint.h. Remaining stuff is language independent. * value.h (struct fn_field): Forward declare for prototypes. * value.h (type_print_1): Remove prototype. * value.h (enum val_prettyprint): Moved to defs.h. * value.h (typedef_print): Prototype renamed to c_typedef_print. * value.h (baseclass_offset): Add prototype. **** start-sanitize-chill **** * Makefile.in (SFILES_MAINDIR): Add ch-typeprint.c, ch-valprint.c. * Makefile.in (OBS): Add ch-typeprint.o, ch-valprint.o. * ch-typeprint.c: New file for language dependent type printing. * ch-valprint.c: New file for language dependent value printing. * ch-exp.y (parse_number): Remove prototype and stub function. * ch-exp.y (decode_integer_literal): Removed unused digits and temp variables. * ch-exp.y (convert_float): Completely ifdef out for now. * ch-exp.y (tokentab2, tokentab3, tokentab4, tokentab5), ch-lang.c (chill_op_print_tab): Change from ANSI-obsolescent "const static" to ANSI-conformant "static const". * ch-exp.y (yylex): Add unhandled storage class enumeration literals to switch statement for completeness. * ch-lang.c (chill_create_fundamental_types): Remove unused nbytes variable. Change dummy type to 2 bytes to match int. Handle FT_VOID types gratuituously added to chill DWARF by compiler. Change FT_CHAR case to generate an TYPE_CODE_CHAR type rather than a one byte TYPE_CODE_INT type. * ch-lang.c (chill_language_defn): Add chill_print_type and chill_val_print. * ch-lang.h (chill_print_type, chill_val_print): Add prototypes. **** end-sanitize-chill ****
1992-12-18 21:21:32 +01:00
static const struct token tokentab2[] =
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
{
{ ":=", GDB_ASSIGNMENT },
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
{ "//", SLASH_SLASH },
{ "->", POINTER },
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
{ "/=", NOTEQUAL },
{ "<=", LEQ },
{ ">=", GTR }
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
};
/* Read one token, getting characters through lexptr. */
/* This is where we will check to make sure that the language and the
operators used are compatible. */
static int
yylex ()
{
unsigned int i;
int token;
char *inputname;
struct symbol *sym;
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
/* Skip over any leading whitespace. */
while (isspace (*lexptr))
{
lexptr++;
}
/* Look for special single character cases which can't be the first
character of some other multicharacter token. */
switch (*lexptr)
{
case '\0':
return (0);
case ',':
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
case '=':
case ';':
case '!':
case '+':
case '*':
case '(':
case ')':
case '[':
case ']':
return (*lexptr++);
}
/* Look for characters which start a particular kind of multicharacter
token, such as a character literal, register name, convenience
variable name, string literal, etc. */
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
switch (*lexptr)
{
case '\'':
case '\"':
/* First try to match a string literal, which is any
sequence of characters enclosed in matching single or double
quotes, except that a single character inside single quotes
is a character literal, so we have to catch that case also. */
token = match_string_literal ();
if (token != 0)
{
return (token);
}
if (*lexptr == '\'')
{
token = match_character_literal ();
if (token != 0)
{
return (token);
}
}
break;
* defs.h (sevenbit_strings): Add declaration. * defs.h (printchar): Replace with gdb_printchar. * language.h (language_defn): Add new function pointers la_printchar and la_printstr, to do language dependent printing of characters and strings. * language.h (local_printchar, local_printstr): New macros to call language dependent functions pointed to by la_printchar and la_printstr respectively. * c-exp.y (emit_char, c_printchar, c_printstr): New language dependent functions for printing characters and strings. * c-exp.y (c_language_defn, cplus_language_defn): Add c_printchar and c_printstr. * command.c (do_setshow_command): Rename printchar use to gdb_printchar. * expprint.c (print_subexp): Replace C style string output with call to local_printstr. * language.c (unk_lang_printchar, unk_lang_printstr): New stubs, currently errors. * language.c (unknown_language_defn, auto_language_defn, local_language_defn): Add unk_lang_printchar and unk_lang_printstr. * m2-exp.y (emit_char, m2_printchar, m2_printstr): New language dependent functions to print characters and strings. * m2-exp.y (m2_language_defn): Add m2_printchar and m2_printstr. * utils.c (printchar): Renamed to gdb_printchar. * valprint.c (print_string): Remove prototype, function moved to c-exp.y, where it becomes c_printstr. * valprint.c (print_max): Made global for reference from the language dependent printing routines in *-exp.y. * valprint.c (repeat_count_threshold): New variable with function of old REPEAT_COUNT_THREHOLD define, but now settable by user. Change all references to old macro to references to new variable. * valprint.c (value_print, val_print): Replace calls to print_string with calls to local_printstr. * valprint.c (val_print): Replace C style character printing with call to local_printchar. * valprint.c (val_print): Add case for TYPE_CODE_CHAR. * valprint.c (_initialize_valprint): Add add_show_from_set call for setting up repeat_count_threshold as print variable. **** start-sanitize-chill **** * ch-exp.y (decode_integer_value): New function. * ch-exp.y (decode_integer_literal): Use decode_integer_value. * ch-exp.y (chill_printchar, chill_printstr): New language dependent functions for printing characters and strings. * ch-exp.y (chill_language_defn): Add chill_printchar and chill_printstr. **** end-sanitize-chill ****
1992-11-21 07:10:08 +01:00
case 'C':
case 'c':
token = match_character_literal ();
if (token != 0)
{
return (token);
}
break;
case '$':
token = match_dollar_tokens ();
if (token != 0)
{
return (token);
}
break;
}
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
/* See if it is a special token of length 2. */
for (i = 0; i < sizeof (tokentab2) / sizeof (tokentab2[0]); i++)
{
if (STREQN (lexptr, tokentab2[i].operator, 2))
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
{
lexptr += 2;
return (tokentab2[i].token);
}
}
/* Look for single character cases which which could be the first
character of some other multicharacter token, but aren't, or we
would already have found it. */
switch (*lexptr)
{
case '-':
case ':':
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
case '/':
case '<':
case '>':
return (*lexptr++);
}
/* Look for a float literal before looking for an integer literal, so
we match as much of the input stream as possible. */
token = match_float_literal ();
* defs.h (HOST_CHAR_BIT): New macro, defaults to either CHAR_BIT from a configuration file (typically including <limits.h>), or to TARGET_CHAR_BIT if CHAR_BIT is not defined. * eval.c (evaluate_subexp): Use new BYTES_TO_EXP_ELEM macro. * eval.c (evaluate_subexp): Add case for OP_BITSTRING. * expprint.c (print_subexp): Use new BYTES_TO_EXP_ELEM macro. * exppritn.c (print_subexp, dump_expression): Add case for OP_BITSTRING. * expression.h (OP_BITSTRING): New expression element type for packed bitstrings. * expression.h (EXP_ELEM_TO_BYTES, BYTES_TO_EXP_ELEM): New macros to convert between number of expression elements and bytes to store that many elements. * i960-tdep.c (leafproc_return): Use new macros to access minimal symbol name and address fields. * m88k-pinsn.c (sprint_address): Use new macros to access minimal symbol name and address fields. * nindy-tdep.c (nindy_frame_chain_valid): Use new macro to access minimal symbol address field. * parse.c (write_exp_elt, write_exp_string, prefixify_expression, parse_exp_1): Use new EXP_ELEM_TO_BYTES macro. * parse.c (write_exp_string, length_of_subexp, prefixify_expression): Use new BYTES_TO_EXP_ELEM macro. * parse.c (write_exp_bitstring): New function to write packed bitstrings into the expression element vector. * parse.c (length_of_subexp, prefixify_subexp): Add case for OP_BITSTRING. * parser-defs.h (struct stoken): Document that it is used for OP_BITSTRING as well as OP_STRING. * parser-defs.h (write_exp_bitstring): Add prototype. **** start-sanitize-chill **** * ch-exp.y (BIT_STRING_LITERAL): Change token type to sval. * ch-exp.y (NUM, PRED, SUCC, ABS, CARD, MAX, MIN, SIZE, UPPER, LOWER, LENGTH): New tokens for keywords. * ch-exp.y (chill_value_built_in_routine_call, mode_argument, upper_lower_argument, length_argument, array_mode_name, string_mode_name, variant_structure_mode_name): New non-terminals and productions. * ch-exp.y (literal): Useful production for BIT_STRING_LITERAL. * ch-exp.y (match_bitstring_literal): New lexer support function to recognize bitstring literals. * ch-exp.y (tokentab6): New token table for 6 character keywords. * ch-exp.y (tokentab5): Add LOWER, UPPER. * ch-exp.y (tokentab4): Add PRED, SUCC, CARD, SIZE. * ch-exp.y (tokentab3): Add NUM, ABS, MIN, MAX. * ch-exp.y (yylex): Check tokentab6. * ch-exp.y (yylex): Call match_bitstring_literal. **** end-sanitize-chill ****
1993-01-06 17:52:10 +01:00
if (token != 0)
{
return (token);
}
token = match_bitstring_literal ();
if (token != 0)
{
return (token);
}
token = match_integer_literal ();
if (token != 0)
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
{
return (token);
}
/* Try to match a simple name string, and if a match is found, then
further classify what sort of name it is and return an appropriate
token. Note that attempting to match a simple name string consumes
the token from lexptr, so we can't back out if we later find that
we can't classify what sort of name it is. */
inputname = match_simple_name_string ();
if (inputname != NULL)
{
char *simplename = (char*) alloca (strlen (inputname) + 1);
char *dptr = simplename, *sptr = inputname;
for (; *sptr; sptr++)
*dptr++ = isupper (*sptr) ? tolower(*sptr) : *sptr;
*dptr = '\0';
/* See if it is a reserved identifier. */
for (i = 0; i < sizeof (idtokentab) / sizeof (idtokentab[0]); i++)
{
if (STREQ (simplename, idtokentab[i].operator))
{
return (idtokentab[i].token);
}
}
/* Look for other special tokens. */
if (STREQ (simplename, "true"))
{
yylval.ulval = 1;
return (BOOLEAN_LITERAL);
}
if (STREQ (simplename, "false"))
{
yylval.ulval = 0;
return (BOOLEAN_LITERAL);
}
sym = lookup_symbol (inputname, expression_context_block,
VAR_NAMESPACE, (int *) NULL,
(struct symtab **) NULL);
if (sym == NULL && strcmp (inputname, simplename) != 0)
{
sym = lookup_symbol (simplename, expression_context_block,
VAR_NAMESPACE, (int *) NULL,
(struct symtab **) NULL);
}
if (sym != NULL)
{
yylval.ssym.stoken.ptr = NULL;
yylval.ssym.stoken.length = 0;
yylval.ssym.sym = sym;
yylval.ssym.is_a_field_of_this = 0; /* FIXME, C++'ism */
switch (SYMBOL_CLASS (sym))
{
case LOC_BLOCK:
/* Found a procedure name. */
return (GENERAL_PROCEDURE_NAME);
case LOC_STATIC:
/* Found a global or local static variable. */
return (LOCATION_NAME);
* Makefile.in (VERSION): Bump to 4.7.4. * Makefile.in (SFILES_MAINDIR): Add typeprint.c, c-typeprint.c, m2-typeprint.c, c-valprint.c cp-valprint.c m2-valprint.c. * Makefile.in (HFILES): Add valprint.h. * Makefile.in (OBS): Add typeprint.o, c-typeprint.o, m2-typeprint.o, c-valprint.o, cp-valprint.o m2-valprint.o. * typeprint.c, typeprint.h: New files for language independent type printing functions. * c-typeprint.c, m2-typeprint.c: New files for language dependent type printing functions and definitions. * valprint.h: New include file for language independent value printing definitions. * c-valprint.c, cp-valprint.c, m2-valprint.c: New files for language dependent value printing functions. * c-exp.y (production ptype): Add range_type variable and use new create_range_type function. * c-exp.y (tokentab2, tokentab3), c-lang.c (c_op_print_tab), infcmd.c (path_var_name), language.c (unk_op_print_tab), m2-lang.c (m2_op_print_tab): Change from ANSI-obsolescent "const static" to ANSI-conformant "static const". * c-exp.y (c_create_fundamental_type): Remove unused nbytes. * c-exp.y (c_language_defn, cplus_language_defn): Add c_print_type, and c_val_print. * c-lang.h (c_print_type, c_val_print): Add prototypes. * coffread.c (decode_type): Add range_type variable and call to new create_range_type function. * complaints.c (complain): Remove unused val variable. * complaints.c (_initialize_complaints): Make it void. * convex-tdep.c (value_of_trapped_internalvar): Add range_type variable and call new create_range_type function. * defs.h (enum val_prettyprint): Move enum from value.h to here so we can avoid having to include value.h just for prototypes that need the enum (thanks ANSI). * dwarfread.c (struct_type): Local anonymous_size variable is only used if !BITS_BIG_ENDIAN. * dwarfread.c (decode_subscript_data_item): Add rangetype variable and call new create_range_type function. * elfread.c (elf_symfile_read): Remove unused dbx and text_sect variables. * eval.c (evaluate_subexp): Remove unused local variable name and the statement with no side effects that initializes it. * expprint.c (print_subexp): Change local_printstr to LA_PRINT_STRING. * gdbtypes.c (create_range_type): New function that creates a range type using code fragments from object file readers as an example of what has to be initialized. * gdbtypes.c (create_array_type): Removed index_type, low_bound, and high_bound parameters, replaced with a single range_type parameter. Change function body to use passed in range_type rather than handcrafting one. * gdbtypes.h (create_range_type): Add prototype. * gdbtypes.h (create_array_type): Change prototype parameters. * infrun.c (normal_stop): Remove unused local variables tem and c. * infrun.c (hook_stop_stub): Return 0 rather than random value. * language.c (unk_lang_print_type, unk_lang_val_print): Add stub functions that call error if called. * language.c (unknown_language_defn, auto_language_defn, local_language_defn): Add initializers unk_lang_print_type and unk_lang_val_print. * language.h (struct language_defn): Reformat for larger comments, add la_print_type and la_val_print members. Add LA_PRINT_TYPE and LA_VAL_PRINT macros. Change local_printchar to LA_PRINT_CHAR and local_printstr to LA_PRINT_STRING. * m2-lang.c (m2_create_fundamental_type): Remove unused local variable nbytes. * m2-lang.c (m2_language_defn): Add initializers m2_print_type and m2_val_print. * m2-lang.h (m2_print_type, m2_val_print): Add prototypes. * main.c (execute_command): Remove unused local variable cmdlines. * main.c (echo_command), stabsread.c (read_type), printcmd.c (clear_displays), symmisc.c (block_depth), values.c (clear_value_history): Make testing of truth value of assignment result explicit. * mipsread.c (upgrade_type): Update FIXME to include future use of create_range_type. * printcmd.c (ptype_command, ptype_eval, whatis_command, whatis_exp, maintenance_print_type): Move prototypes and functions to new typeprint.c. * printcmd.c (_initialize_printcmd): Move add_com calls for ptype_command and whatis_command to new typeprint.c. * ser-bsd.c (serial_open): Remove unused variable sgttyb. * source.c (find_source_lines): Local variable c only used when LSEEK_NOT_LINEAR is defined. * stabsread.c (read_array_type): Use new create_range_type function. * stabsread.c (read_range_type): Add new index_type variable and call new create_range_type function rather than handcrafting range types. * symmisc.c (type_print_1): Change usages to LA_PRINT_TYPE. * symtab.c (typedef_print usages): Use c_typedef_print, renamed. * symtab.c (type_print_base usages): Use c_type_print_base. * symtab.c (type_print_varspec_prefix usages): Use c_type_print_varspec_prefix. * symtab.c (type_print_method_args usages): Use cp_type_print_method_args. * valprint.c: Completely ripped apart and the fragments used to create c-valprint.c, cp-valprint.c, m2-valprint.c, and valprint.h. Remaining stuff is language independent. * value.h (struct fn_field): Forward declare for prototypes. * value.h (type_print_1): Remove prototype. * value.h (enum val_prettyprint): Moved to defs.h. * value.h (typedef_print): Prototype renamed to c_typedef_print. * value.h (baseclass_offset): Add prototype. **** start-sanitize-chill **** * Makefile.in (SFILES_MAINDIR): Add ch-typeprint.c, ch-valprint.c. * Makefile.in (OBS): Add ch-typeprint.o, ch-valprint.o. * ch-typeprint.c: New file for language dependent type printing. * ch-valprint.c: New file for language dependent value printing. * ch-exp.y (parse_number): Remove prototype and stub function. * ch-exp.y (decode_integer_literal): Removed unused digits and temp variables. * ch-exp.y (convert_float): Completely ifdef out for now. * ch-exp.y (tokentab2, tokentab3, tokentab4, tokentab5), ch-lang.c (chill_op_print_tab): Change from ANSI-obsolescent "const static" to ANSI-conformant "static const". * ch-exp.y (yylex): Add unhandled storage class enumeration literals to switch statement for completeness. * ch-lang.c (chill_create_fundamental_types): Remove unused nbytes variable. Change dummy type to 2 bytes to match int. Handle FT_VOID types gratuituously added to chill DWARF by compiler. Change FT_CHAR case to generate an TYPE_CODE_CHAR type rather than a one byte TYPE_CODE_INT type. * ch-lang.c (chill_language_defn): Add chill_print_type and chill_val_print. * ch-lang.h (chill_print_type, chill_val_print): Add prototypes. **** end-sanitize-chill ****
1992-12-18 21:21:32 +01:00
case LOC_REGISTER:
case LOC_ARG:
case LOC_REF_ARG:
case LOC_REGPARM:
case LOC_REGPARM_ADDR:
* Makefile.in (VERSION): Bump to 4.7.4. * Makefile.in (SFILES_MAINDIR): Add typeprint.c, c-typeprint.c, m2-typeprint.c, c-valprint.c cp-valprint.c m2-valprint.c. * Makefile.in (HFILES): Add valprint.h. * Makefile.in (OBS): Add typeprint.o, c-typeprint.o, m2-typeprint.o, c-valprint.o, cp-valprint.o m2-valprint.o. * typeprint.c, typeprint.h: New files for language independent type printing functions. * c-typeprint.c, m2-typeprint.c: New files for language dependent type printing functions and definitions. * valprint.h: New include file for language independent value printing definitions. * c-valprint.c, cp-valprint.c, m2-valprint.c: New files for language dependent value printing functions. * c-exp.y (production ptype): Add range_type variable and use new create_range_type function. * c-exp.y (tokentab2, tokentab3), c-lang.c (c_op_print_tab), infcmd.c (path_var_name), language.c (unk_op_print_tab), m2-lang.c (m2_op_print_tab): Change from ANSI-obsolescent "const static" to ANSI-conformant "static const". * c-exp.y (c_create_fundamental_type): Remove unused nbytes. * c-exp.y (c_language_defn, cplus_language_defn): Add c_print_type, and c_val_print. * c-lang.h (c_print_type, c_val_print): Add prototypes. * coffread.c (decode_type): Add range_type variable and call to new create_range_type function. * complaints.c (complain): Remove unused val variable. * complaints.c (_initialize_complaints): Make it void. * convex-tdep.c (value_of_trapped_internalvar): Add range_type variable and call new create_range_type function. * defs.h (enum val_prettyprint): Move enum from value.h to here so we can avoid having to include value.h just for prototypes that need the enum (thanks ANSI). * dwarfread.c (struct_type): Local anonymous_size variable is only used if !BITS_BIG_ENDIAN. * dwarfread.c (decode_subscript_data_item): Add rangetype variable and call new create_range_type function. * elfread.c (elf_symfile_read): Remove unused dbx and text_sect variables. * eval.c (evaluate_subexp): Remove unused local variable name and the statement with no side effects that initializes it. * expprint.c (print_subexp): Change local_printstr to LA_PRINT_STRING. * gdbtypes.c (create_range_type): New function that creates a range type using code fragments from object file readers as an example of what has to be initialized. * gdbtypes.c (create_array_type): Removed index_type, low_bound, and high_bound parameters, replaced with a single range_type parameter. Change function body to use passed in range_type rather than handcrafting one. * gdbtypes.h (create_range_type): Add prototype. * gdbtypes.h (create_array_type): Change prototype parameters. * infrun.c (normal_stop): Remove unused local variables tem and c. * infrun.c (hook_stop_stub): Return 0 rather than random value. * language.c (unk_lang_print_type, unk_lang_val_print): Add stub functions that call error if called. * language.c (unknown_language_defn, auto_language_defn, local_language_defn): Add initializers unk_lang_print_type and unk_lang_val_print. * language.h (struct language_defn): Reformat for larger comments, add la_print_type and la_val_print members. Add LA_PRINT_TYPE and LA_VAL_PRINT macros. Change local_printchar to LA_PRINT_CHAR and local_printstr to LA_PRINT_STRING. * m2-lang.c (m2_create_fundamental_type): Remove unused local variable nbytes. * m2-lang.c (m2_language_defn): Add initializers m2_print_type and m2_val_print. * m2-lang.h (m2_print_type, m2_val_print): Add prototypes. * main.c (execute_command): Remove unused local variable cmdlines. * main.c (echo_command), stabsread.c (read_type), printcmd.c (clear_displays), symmisc.c (block_depth), values.c (clear_value_history): Make testing of truth value of assignment result explicit. * mipsread.c (upgrade_type): Update FIXME to include future use of create_range_type. * printcmd.c (ptype_command, ptype_eval, whatis_command, whatis_exp, maintenance_print_type): Move prototypes and functions to new typeprint.c. * printcmd.c (_initialize_printcmd): Move add_com calls for ptype_command and whatis_command to new typeprint.c. * ser-bsd.c (serial_open): Remove unused variable sgttyb. * source.c (find_source_lines): Local variable c only used when LSEEK_NOT_LINEAR is defined. * stabsread.c (read_array_type): Use new create_range_type function. * stabsread.c (read_range_type): Add new index_type variable and call new create_range_type function rather than handcrafting range types. * symmisc.c (type_print_1): Change usages to LA_PRINT_TYPE. * symtab.c (typedef_print usages): Use c_typedef_print, renamed. * symtab.c (type_print_base usages): Use c_type_print_base. * symtab.c (type_print_varspec_prefix usages): Use c_type_print_varspec_prefix. * symtab.c (type_print_method_args usages): Use cp_type_print_method_args. * valprint.c: Completely ripped apart and the fragments used to create c-valprint.c, cp-valprint.c, m2-valprint.c, and valprint.h. Remaining stuff is language independent. * value.h (struct fn_field): Forward declare for prototypes. * value.h (type_print_1): Remove prototype. * value.h (enum val_prettyprint): Moved to defs.h. * value.h (typedef_print): Prototype renamed to c_typedef_print. * value.h (baseclass_offset): Add prototype. **** start-sanitize-chill **** * Makefile.in (SFILES_MAINDIR): Add ch-typeprint.c, ch-valprint.c. * Makefile.in (OBS): Add ch-typeprint.o, ch-valprint.o. * ch-typeprint.c: New file for language dependent type printing. * ch-valprint.c: New file for language dependent value printing. * ch-exp.y (parse_number): Remove prototype and stub function. * ch-exp.y (decode_integer_literal): Removed unused digits and temp variables. * ch-exp.y (convert_float): Completely ifdef out for now. * ch-exp.y (tokentab2, tokentab3, tokentab4, tokentab5), ch-lang.c (chill_op_print_tab): Change from ANSI-obsolescent "const static" to ANSI-conformant "static const". * ch-exp.y (yylex): Add unhandled storage class enumeration literals to switch statement for completeness. * ch-lang.c (chill_create_fundamental_types): Remove unused nbytes variable. Change dummy type to 2 bytes to match int. Handle FT_VOID types gratuituously added to chill DWARF by compiler. Change FT_CHAR case to generate an TYPE_CODE_CHAR type rather than a one byte TYPE_CODE_INT type. * ch-lang.c (chill_language_defn): Add chill_print_type and chill_val_print. * ch-lang.h (chill_print_type, chill_val_print): Add prototypes. **** end-sanitize-chill ****
1992-12-18 21:21:32 +01:00
case LOC_LOCAL:
case LOC_LOCAL_ARG:
case LOC_BASEREG:
case LOC_BASEREG_ARG:
if (innermost_block == NULL
|| contained_in (block_found, innermost_block))
{
innermost_block = block_found;
}
return (LOCATION_NAME);
break;
case LOC_CONST:
* Makefile.in (VERSION): Bump to 4.7.4. * Makefile.in (SFILES_MAINDIR): Add typeprint.c, c-typeprint.c, m2-typeprint.c, c-valprint.c cp-valprint.c m2-valprint.c. * Makefile.in (HFILES): Add valprint.h. * Makefile.in (OBS): Add typeprint.o, c-typeprint.o, m2-typeprint.o, c-valprint.o, cp-valprint.o m2-valprint.o. * typeprint.c, typeprint.h: New files for language independent type printing functions. * c-typeprint.c, m2-typeprint.c: New files for language dependent type printing functions and definitions. * valprint.h: New include file for language independent value printing definitions. * c-valprint.c, cp-valprint.c, m2-valprint.c: New files for language dependent value printing functions. * c-exp.y (production ptype): Add range_type variable and use new create_range_type function. * c-exp.y (tokentab2, tokentab3), c-lang.c (c_op_print_tab), infcmd.c (path_var_name), language.c (unk_op_print_tab), m2-lang.c (m2_op_print_tab): Change from ANSI-obsolescent "const static" to ANSI-conformant "static const". * c-exp.y (c_create_fundamental_type): Remove unused nbytes. * c-exp.y (c_language_defn, cplus_language_defn): Add c_print_type, and c_val_print. * c-lang.h (c_print_type, c_val_print): Add prototypes. * coffread.c (decode_type): Add range_type variable and call to new create_range_type function. * complaints.c (complain): Remove unused val variable. * complaints.c (_initialize_complaints): Make it void. * convex-tdep.c (value_of_trapped_internalvar): Add range_type variable and call new create_range_type function. * defs.h (enum val_prettyprint): Move enum from value.h to here so we can avoid having to include value.h just for prototypes that need the enum (thanks ANSI). * dwarfread.c (struct_type): Local anonymous_size variable is only used if !BITS_BIG_ENDIAN. * dwarfread.c (decode_subscript_data_item): Add rangetype variable and call new create_range_type function. * elfread.c (elf_symfile_read): Remove unused dbx and text_sect variables. * eval.c (evaluate_subexp): Remove unused local variable name and the statement with no side effects that initializes it. * expprint.c (print_subexp): Change local_printstr to LA_PRINT_STRING. * gdbtypes.c (create_range_type): New function that creates a range type using code fragments from object file readers as an example of what has to be initialized. * gdbtypes.c (create_array_type): Removed index_type, low_bound, and high_bound parameters, replaced with a single range_type parameter. Change function body to use passed in range_type rather than handcrafting one. * gdbtypes.h (create_range_type): Add prototype. * gdbtypes.h (create_array_type): Change prototype parameters. * infrun.c (normal_stop): Remove unused local variables tem and c. * infrun.c (hook_stop_stub): Return 0 rather than random value. * language.c (unk_lang_print_type, unk_lang_val_print): Add stub functions that call error if called. * language.c (unknown_language_defn, auto_language_defn, local_language_defn): Add initializers unk_lang_print_type and unk_lang_val_print. * language.h (struct language_defn): Reformat for larger comments, add la_print_type and la_val_print members. Add LA_PRINT_TYPE and LA_VAL_PRINT macros. Change local_printchar to LA_PRINT_CHAR and local_printstr to LA_PRINT_STRING. * m2-lang.c (m2_create_fundamental_type): Remove unused local variable nbytes. * m2-lang.c (m2_language_defn): Add initializers m2_print_type and m2_val_print. * m2-lang.h (m2_print_type, m2_val_print): Add prototypes. * main.c (execute_command): Remove unused local variable cmdlines. * main.c (echo_command), stabsread.c (read_type), printcmd.c (clear_displays), symmisc.c (block_depth), values.c (clear_value_history): Make testing of truth value of assignment result explicit. * mipsread.c (upgrade_type): Update FIXME to include future use of create_range_type. * printcmd.c (ptype_command, ptype_eval, whatis_command, whatis_exp, maintenance_print_type): Move prototypes and functions to new typeprint.c. * printcmd.c (_initialize_printcmd): Move add_com calls for ptype_command and whatis_command to new typeprint.c. * ser-bsd.c (serial_open): Remove unused variable sgttyb. * source.c (find_source_lines): Local variable c only used when LSEEK_NOT_LINEAR is defined. * stabsread.c (read_array_type): Use new create_range_type function. * stabsread.c (read_range_type): Add new index_type variable and call new create_range_type function rather than handcrafting range types. * symmisc.c (type_print_1): Change usages to LA_PRINT_TYPE. * symtab.c (typedef_print usages): Use c_typedef_print, renamed. * symtab.c (type_print_base usages): Use c_type_print_base. * symtab.c (type_print_varspec_prefix usages): Use c_type_print_varspec_prefix. * symtab.c (type_print_method_args usages): Use cp_type_print_method_args. * valprint.c: Completely ripped apart and the fragments used to create c-valprint.c, cp-valprint.c, m2-valprint.c, and valprint.h. Remaining stuff is language independent. * value.h (struct fn_field): Forward declare for prototypes. * value.h (type_print_1): Remove prototype. * value.h (enum val_prettyprint): Moved to defs.h. * value.h (typedef_print): Prototype renamed to c_typedef_print. * value.h (baseclass_offset): Add prototype. **** start-sanitize-chill **** * Makefile.in (SFILES_MAINDIR): Add ch-typeprint.c, ch-valprint.c. * Makefile.in (OBS): Add ch-typeprint.o, ch-valprint.o. * ch-typeprint.c: New file for language dependent type printing. * ch-valprint.c: New file for language dependent value printing. * ch-exp.y (parse_number): Remove prototype and stub function. * ch-exp.y (decode_integer_literal): Removed unused digits and temp variables. * ch-exp.y (convert_float): Completely ifdef out for now. * ch-exp.y (tokentab2, tokentab3, tokentab4, tokentab5), ch-lang.c (chill_op_print_tab): Change from ANSI-obsolescent "const static" to ANSI-conformant "static const". * ch-exp.y (yylex): Add unhandled storage class enumeration literals to switch statement for completeness. * ch-lang.c (chill_create_fundamental_types): Remove unused nbytes variable. Change dummy type to 2 bytes to match int. Handle FT_VOID types gratuituously added to chill DWARF by compiler. Change FT_CHAR case to generate an TYPE_CODE_CHAR type rather than a one byte TYPE_CODE_INT type. * ch-lang.c (chill_language_defn): Add chill_print_type and chill_val_print. * ch-lang.h (chill_print_type, chill_val_print): Add prototypes. **** end-sanitize-chill ****
1992-12-18 21:21:32 +01:00
case LOC_LABEL:
return (LOCATION_NAME);
break;
case LOC_TYPEDEF:
yylval.tsym.type = SYMBOL_TYPE (sym);
return TYPENAME;
case LOC_UNDEF:
* Makefile.in (VERSION): Bump to 4.7.4. * Makefile.in (SFILES_MAINDIR): Add typeprint.c, c-typeprint.c, m2-typeprint.c, c-valprint.c cp-valprint.c m2-valprint.c. * Makefile.in (HFILES): Add valprint.h. * Makefile.in (OBS): Add typeprint.o, c-typeprint.o, m2-typeprint.o, c-valprint.o, cp-valprint.o m2-valprint.o. * typeprint.c, typeprint.h: New files for language independent type printing functions. * c-typeprint.c, m2-typeprint.c: New files for language dependent type printing functions and definitions. * valprint.h: New include file for language independent value printing definitions. * c-valprint.c, cp-valprint.c, m2-valprint.c: New files for language dependent value printing functions. * c-exp.y (production ptype): Add range_type variable and use new create_range_type function. * c-exp.y (tokentab2, tokentab3), c-lang.c (c_op_print_tab), infcmd.c (path_var_name), language.c (unk_op_print_tab), m2-lang.c (m2_op_print_tab): Change from ANSI-obsolescent "const static" to ANSI-conformant "static const". * c-exp.y (c_create_fundamental_type): Remove unused nbytes. * c-exp.y (c_language_defn, cplus_language_defn): Add c_print_type, and c_val_print. * c-lang.h (c_print_type, c_val_print): Add prototypes. * coffread.c (decode_type): Add range_type variable and call to new create_range_type function. * complaints.c (complain): Remove unused val variable. * complaints.c (_initialize_complaints): Make it void. * convex-tdep.c (value_of_trapped_internalvar): Add range_type variable and call new create_range_type function. * defs.h (enum val_prettyprint): Move enum from value.h to here so we can avoid having to include value.h just for prototypes that need the enum (thanks ANSI). * dwarfread.c (struct_type): Local anonymous_size variable is only used if !BITS_BIG_ENDIAN. * dwarfread.c (decode_subscript_data_item): Add rangetype variable and call new create_range_type function. * elfread.c (elf_symfile_read): Remove unused dbx and text_sect variables. * eval.c (evaluate_subexp): Remove unused local variable name and the statement with no side effects that initializes it. * expprint.c (print_subexp): Change local_printstr to LA_PRINT_STRING. * gdbtypes.c (create_range_type): New function that creates a range type using code fragments from object file readers as an example of what has to be initialized. * gdbtypes.c (create_array_type): Removed index_type, low_bound, and high_bound parameters, replaced with a single range_type parameter. Change function body to use passed in range_type rather than handcrafting one. * gdbtypes.h (create_range_type): Add prototype. * gdbtypes.h (create_array_type): Change prototype parameters. * infrun.c (normal_stop): Remove unused local variables tem and c. * infrun.c (hook_stop_stub): Return 0 rather than random value. * language.c (unk_lang_print_type, unk_lang_val_print): Add stub functions that call error if called. * language.c (unknown_language_defn, auto_language_defn, local_language_defn): Add initializers unk_lang_print_type and unk_lang_val_print. * language.h (struct language_defn): Reformat for larger comments, add la_print_type and la_val_print members. Add LA_PRINT_TYPE and LA_VAL_PRINT macros. Change local_printchar to LA_PRINT_CHAR and local_printstr to LA_PRINT_STRING. * m2-lang.c (m2_create_fundamental_type): Remove unused local variable nbytes. * m2-lang.c (m2_language_defn): Add initializers m2_print_type and m2_val_print. * m2-lang.h (m2_print_type, m2_val_print): Add prototypes. * main.c (execute_command): Remove unused local variable cmdlines. * main.c (echo_command), stabsread.c (read_type), printcmd.c (clear_displays), symmisc.c (block_depth), values.c (clear_value_history): Make testing of truth value of assignment result explicit. * mipsread.c (upgrade_type): Update FIXME to include future use of create_range_type. * printcmd.c (ptype_command, ptype_eval, whatis_command, whatis_exp, maintenance_print_type): Move prototypes and functions to new typeprint.c. * printcmd.c (_initialize_printcmd): Move add_com calls for ptype_command and whatis_command to new typeprint.c. * ser-bsd.c (serial_open): Remove unused variable sgttyb. * source.c (find_source_lines): Local variable c only used when LSEEK_NOT_LINEAR is defined. * stabsread.c (read_array_type): Use new create_range_type function. * stabsread.c (read_range_type): Add new index_type variable and call new create_range_type function rather than handcrafting range types. * symmisc.c (type_print_1): Change usages to LA_PRINT_TYPE. * symtab.c (typedef_print usages): Use c_typedef_print, renamed. * symtab.c (type_print_base usages): Use c_type_print_base. * symtab.c (type_print_varspec_prefix usages): Use c_type_print_varspec_prefix. * symtab.c (type_print_method_args usages): Use cp_type_print_method_args. * valprint.c: Completely ripped apart and the fragments used to create c-valprint.c, cp-valprint.c, m2-valprint.c, and valprint.h. Remaining stuff is language independent. * value.h (struct fn_field): Forward declare for prototypes. * value.h (type_print_1): Remove prototype. * value.h (enum val_prettyprint): Moved to defs.h. * value.h (typedef_print): Prototype renamed to c_typedef_print. * value.h (baseclass_offset): Add prototype. **** start-sanitize-chill **** * Makefile.in (SFILES_MAINDIR): Add ch-typeprint.c, ch-valprint.c. * Makefile.in (OBS): Add ch-typeprint.o, ch-valprint.o. * ch-typeprint.c: New file for language dependent type printing. * ch-valprint.c: New file for language dependent value printing. * ch-exp.y (parse_number): Remove prototype and stub function. * ch-exp.y (decode_integer_literal): Removed unused digits and temp variables. * ch-exp.y (convert_float): Completely ifdef out for now. * ch-exp.y (tokentab2, tokentab3, tokentab4, tokentab5), ch-lang.c (chill_op_print_tab): Change from ANSI-obsolescent "const static" to ANSI-conformant "static const". * ch-exp.y (yylex): Add unhandled storage class enumeration literals to switch statement for completeness. * ch-lang.c (chill_create_fundamental_types): Remove unused nbytes variable. Change dummy type to 2 bytes to match int. Handle FT_VOID types gratuituously added to chill DWARF by compiler. Change FT_CHAR case to generate an TYPE_CODE_CHAR type rather than a one byte TYPE_CODE_INT type. * ch-lang.c (chill_language_defn): Add chill_print_type and chill_val_print. * ch-lang.h (chill_print_type, chill_val_print): Add prototypes. **** end-sanitize-chill ****
1992-12-18 21:21:32 +01:00
case LOC_CONST_BYTES:
case LOC_OPTIMIZED_OUT:
error ("Symbol \"%s\" names no location.", inputname);
* Makefile.in (VERSION): Bump to 4.7.4. * Makefile.in (SFILES_MAINDIR): Add typeprint.c, c-typeprint.c, m2-typeprint.c, c-valprint.c cp-valprint.c m2-valprint.c. * Makefile.in (HFILES): Add valprint.h. * Makefile.in (OBS): Add typeprint.o, c-typeprint.o, m2-typeprint.o, c-valprint.o, cp-valprint.o m2-valprint.o. * typeprint.c, typeprint.h: New files for language independent type printing functions. * c-typeprint.c, m2-typeprint.c: New files for language dependent type printing functions and definitions. * valprint.h: New include file for language independent value printing definitions. * c-valprint.c, cp-valprint.c, m2-valprint.c: New files for language dependent value printing functions. * c-exp.y (production ptype): Add range_type variable and use new create_range_type function. * c-exp.y (tokentab2, tokentab3), c-lang.c (c_op_print_tab), infcmd.c (path_var_name), language.c (unk_op_print_tab), m2-lang.c (m2_op_print_tab): Change from ANSI-obsolescent "const static" to ANSI-conformant "static const". * c-exp.y (c_create_fundamental_type): Remove unused nbytes. * c-exp.y (c_language_defn, cplus_language_defn): Add c_print_type, and c_val_print. * c-lang.h (c_print_type, c_val_print): Add prototypes. * coffread.c (decode_type): Add range_type variable and call to new create_range_type function. * complaints.c (complain): Remove unused val variable. * complaints.c (_initialize_complaints): Make it void. * convex-tdep.c (value_of_trapped_internalvar): Add range_type variable and call new create_range_type function. * defs.h (enum val_prettyprint): Move enum from value.h to here so we can avoid having to include value.h just for prototypes that need the enum (thanks ANSI). * dwarfread.c (struct_type): Local anonymous_size variable is only used if !BITS_BIG_ENDIAN. * dwarfread.c (decode_subscript_data_item): Add rangetype variable and call new create_range_type function. * elfread.c (elf_symfile_read): Remove unused dbx and text_sect variables. * eval.c (evaluate_subexp): Remove unused local variable name and the statement with no side effects that initializes it. * expprint.c (print_subexp): Change local_printstr to LA_PRINT_STRING. * gdbtypes.c (create_range_type): New function that creates a range type using code fragments from object file readers as an example of what has to be initialized. * gdbtypes.c (create_array_type): Removed index_type, low_bound, and high_bound parameters, replaced with a single range_type parameter. Change function body to use passed in range_type rather than handcrafting one. * gdbtypes.h (create_range_type): Add prototype. * gdbtypes.h (create_array_type): Change prototype parameters. * infrun.c (normal_stop): Remove unused local variables tem and c. * infrun.c (hook_stop_stub): Return 0 rather than random value. * language.c (unk_lang_print_type, unk_lang_val_print): Add stub functions that call error if called. * language.c (unknown_language_defn, auto_language_defn, local_language_defn): Add initializers unk_lang_print_type and unk_lang_val_print. * language.h (struct language_defn): Reformat for larger comments, add la_print_type and la_val_print members. Add LA_PRINT_TYPE and LA_VAL_PRINT macros. Change local_printchar to LA_PRINT_CHAR and local_printstr to LA_PRINT_STRING. * m2-lang.c (m2_create_fundamental_type): Remove unused local variable nbytes. * m2-lang.c (m2_language_defn): Add initializers m2_print_type and m2_val_print. * m2-lang.h (m2_print_type, m2_val_print): Add prototypes. * main.c (execute_command): Remove unused local variable cmdlines. * main.c (echo_command), stabsread.c (read_type), printcmd.c (clear_displays), symmisc.c (block_depth), values.c (clear_value_history): Make testing of truth value of assignment result explicit. * mipsread.c (upgrade_type): Update FIXME to include future use of create_range_type. * printcmd.c (ptype_command, ptype_eval, whatis_command, whatis_exp, maintenance_print_type): Move prototypes and functions to new typeprint.c. * printcmd.c (_initialize_printcmd): Move add_com calls for ptype_command and whatis_command to new typeprint.c. * ser-bsd.c (serial_open): Remove unused variable sgttyb. * source.c (find_source_lines): Local variable c only used when LSEEK_NOT_LINEAR is defined. * stabsread.c (read_array_type): Use new create_range_type function. * stabsread.c (read_range_type): Add new index_type variable and call new create_range_type function rather than handcrafting range types. * symmisc.c (type_print_1): Change usages to LA_PRINT_TYPE. * symtab.c (typedef_print usages): Use c_typedef_print, renamed. * symtab.c (type_print_base usages): Use c_type_print_base. * symtab.c (type_print_varspec_prefix usages): Use c_type_print_varspec_prefix. * symtab.c (type_print_method_args usages): Use cp_type_print_method_args. * valprint.c: Completely ripped apart and the fragments used to create c-valprint.c, cp-valprint.c, m2-valprint.c, and valprint.h. Remaining stuff is language independent. * value.h (struct fn_field): Forward declare for prototypes. * value.h (type_print_1): Remove prototype. * value.h (enum val_prettyprint): Moved to defs.h. * value.h (typedef_print): Prototype renamed to c_typedef_print. * value.h (baseclass_offset): Add prototype. **** start-sanitize-chill **** * Makefile.in (SFILES_MAINDIR): Add ch-typeprint.c, ch-valprint.c. * Makefile.in (OBS): Add ch-typeprint.o, ch-valprint.o. * ch-typeprint.c: New file for language dependent type printing. * ch-valprint.c: New file for language dependent value printing. * ch-exp.y (parse_number): Remove prototype and stub function. * ch-exp.y (decode_integer_literal): Removed unused digits and temp variables. * ch-exp.y (convert_float): Completely ifdef out for now. * ch-exp.y (tokentab2, tokentab3, tokentab4, tokentab5), ch-lang.c (chill_op_print_tab): Change from ANSI-obsolescent "const static" to ANSI-conformant "static const". * ch-exp.y (yylex): Add unhandled storage class enumeration literals to switch statement for completeness. * ch-lang.c (chill_create_fundamental_types): Remove unused nbytes variable. Change dummy type to 2 bytes to match int. Handle FT_VOID types gratuituously added to chill DWARF by compiler. Change FT_CHAR case to generate an TYPE_CODE_CHAR type rather than a one byte TYPE_CODE_INT type. * ch-lang.c (chill_language_defn): Add chill_print_type and chill_val_print. * ch-lang.h (chill_print_type, chill_val_print): Add prototypes. **** end-sanitize-chill ****
1992-12-18 21:21:32 +01:00
break;
}
}
else if (!have_full_symbols () && !have_partial_symbols ())
{
error ("No symbol table is loaded. Use the \"file\" command.");
}
else
{
error ("No symbol \"%s\" in current context.", inputname);
}
}
/* Catch single character tokens which are not part of some
longer token. */
switch (*lexptr)
{
case '.': /* Not float for example. */
lexptr++;
while (isspace (*lexptr)) lexptr++;
inputname = match_simple_name_string ();
if (!inputname)
return '.';
return FIELD_NAME;
}
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
return (ILLEGAL_TOKEN);
}
static void
write_lower_upper_value (opcode, type)
enum exp_opcode opcode; /* Either UNOP_LOWER or UNOP_UPPER */
struct type *type;
{
extern LONGEST type_lower_upper ();
struct type *result_type;
LONGEST val = type_lower_upper (opcode, type, &result_type);
write_exp_elt_opcode (OP_LONG);
write_exp_elt_type (result_type);
write_exp_elt_longcst (val);
write_exp_elt_opcode (OP_LONG);
}
void
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
yyerror (msg)
char *msg;
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
{
error ("A %s in expression, near `%s'.", (msg ? msg : "error"), lexptr);
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y. * Makefile.in (YYFILES): Add ch-exp.tab.c. * Makefile.in (YYOBJ): Add ch-exp.tab.o. * Makefile.in (saber_gdb): Add unload of ch-exp.y and load of ch-exp.tab.c. * Makefile.in (distclean): Add target ch-exp.tab.c. * Makefile.in (realclean): Add rm of ch-exp.tab.c. * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on Makefile since it contains sed patterns used in generation. Add sed pattern to also delete #include of any malloc.h. * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. * ch-exp.y: New expression parser, for GNU-Chill. * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, parser-defs.h, valarith.c, valops.c, value.h: Remap macros and function names to conform to K&R terminology with respect to logical and bitwise operators: UNOP_ZEROP => UNOP_LOGICAL_NOT UNOP_LOGNOT => UNOP_COMPLEMENT BINOP_LOGAND => BINOP_BITWISE_AND BINOP_LOGXOR => BINOP_BITWISE_XOR BINOP_LOGIOR => BINOP_BITWISE_IOR BINOP_AND => BINOP_LOGICAL_AND BINOP_OR => BINOP_LOGICAL_OR PREC_OR => PREC_LOGICAL_OR PREC_AND => PREC_LOGICAL_AND PREC_LOGIOR => PREC_BITWISE_IOR PREC_LOGXOR => PREC_BITWISE_XOR PREC_LOGAND => PREC_BITWISE_AND value_zerop() => value_logical_not() value_lognot() => value_complement() * c-exp.y (c_op_print_tab): Add explicit empty terminator. * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. * defs.h (enum language): Add language_chill. * dwarfread.c (set_cu_language): Add LANG_CHILL case and make LANG_MODULA2 a recognized language. * eval.c (evaluate_subexp): Add OP_BOOL case. * expprint.c (print_subexp): Add OP_BOOL case. * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for Chill as well as Modula-2. * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, builtin_type_chill_ulong, builtin_type_chill_real): Add. * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary and is nonexistant in some SVR4 based systems. * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. * language.c (set_language_command): Add chill. * language.c (binop_result_type, integral_type, character_type, boolean_type, structured_type, value_true, binop_type_check): Add language_chill cases. * language.h (_LANG_chill): Define. * m2-exp.y (number_sign, modblock): Make static, #ifdef out unused modblock. * m2-exp.y (ANDAND): Rename to LOGICAL_AND. * source.c (source_info): Fix minor nits, print "1 line" rather than "1 lines", and "language is <lang>". * symfile.c (deduce_language_from_filename): Recognize the filename extensions ".chill", ".c186", and ".c286" for Chill. * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well as TYPE_CODE_INT and TYPE_CODE_FLOAT. * valprint.c (val_print): Print TYPE_CODE_BOOL type values as "TRUE" or "FALSE". * valprint.c (typedef_print): Add case for language_chill. * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-15 18:28:02 +01:00
}