BINOP_END is used only as a "meaningless" value in various tables.
This patch changes these to use OP_NULL instead, and removes
BINOP_END.
gdb/ChangeLog
2021-03-08 Tom Tromey <tom@tromey.com>
* std-operator.def (BINOP_END): Remove.
* p-exp.y (tokentab3, tokentab2): Use OP_NULL, not BINOP_END.
* go-exp.y (tokentab2): Use OP_NULL, not BINOP_END.
* f-exp.y (dot_ops, f77_keywords): Use OP_NULL, not BINOP_END.
* d-exp.y (tokentab2, ident_tokens): Use OP_NULL, not BINOP_END.
* c-exp.y (tokentab3, tokentab2, ident_tokens): Use OP_NULL, not
BINOP_END.
+2021-03-08 Tom Tromey <tom@tromey.com>
+
+ * std-operator.def (BINOP_END): Remove.
+ * p-exp.y (tokentab3, tokentab2): Use OP_NULL, not BINOP_END.
+ * go-exp.y (tokentab2): Use OP_NULL, not BINOP_END.
+ * f-exp.y (dot_ops, f77_keywords): Use OP_NULL, not BINOP_END.
+ * d-exp.y (tokentab2, ident_tokens): Use OP_NULL, not BINOP_END.
+ * c-exp.y (tokentab3, tokentab2, ident_tokens): Use OP_NULL, not
+ BINOP_END.
+
2021-03-08 Tom Tromey <tom@tromey.com>
* expression.h (enum exp_opcode) <OP_UNUSED_LAST>: Remove.
{
{">>=", ASSIGN_MODIFY, BINOP_RSH, 0},
{"<<=", ASSIGN_MODIFY, BINOP_LSH, 0},
- {"->*", ARROW_STAR, BINOP_END, FLAG_CXX},
- {"...", DOTDOTDOT, BINOP_END, 0}
+ {"->*", ARROW_STAR, OP_NULL, FLAG_CXX},
+ {"...", DOTDOTDOT, OP_NULL, 0}
};
static const struct token tokentab2[] =
{"|=", ASSIGN_MODIFY, BINOP_BITWISE_IOR, 0},
{"&=", ASSIGN_MODIFY, BINOP_BITWISE_AND, 0},
{"^=", ASSIGN_MODIFY, BINOP_BITWISE_XOR, 0},
- {"++", INCREMENT, BINOP_END, 0},
- {"--", DECREMENT, BINOP_END, 0},
- {"->", ARROW, BINOP_END, 0},
- {"&&", ANDAND, BINOP_END, 0},
- {"||", OROR, BINOP_END, 0},
+ {"++", INCREMENT, OP_NULL, 0},
+ {"--", DECREMENT, OP_NULL, 0},
+ {"->", ARROW, OP_NULL, 0},
+ {"&&", ANDAND, OP_NULL, 0},
+ {"||", OROR, OP_NULL, 0},
/* "::" is *not* only C++: gdb overrides its meaning in several
different ways, e.g., 'filename'::func, function::variable. */
- {"::", COLONCOLON, BINOP_END, 0},
- {"<<", LSH, BINOP_END, 0},
- {">>", RSH, BINOP_END, 0},
- {"==", EQUAL, BINOP_END, 0},
- {"!=", NOTEQUAL, BINOP_END, 0},
- {"<=", LEQ, BINOP_END, 0},
- {">=", GEQ, BINOP_END, 0},
- {".*", DOT_STAR, BINOP_END, FLAG_CXX}
+ {"::", COLONCOLON, OP_NULL, 0},
+ {"<<", LSH, OP_NULL, 0},
+ {">>", RSH, OP_NULL, 0},
+ {"==", EQUAL, OP_NULL, 0},
+ {"!=", NOTEQUAL, OP_NULL, 0},
+ {"<=", LEQ, OP_NULL, 0},
+ {">=", GEQ, OP_NULL, 0},
+ {".*", DOT_STAR, OP_NULL, FLAG_CXX}
};
/* Identifier-like tokens. Only type-specifiers than can appear in
{"delete", DELETE, OP_NULL, FLAG_CXX},
{"operator", OPERATOR, OP_NULL, FLAG_CXX},
- {"and", ANDAND, BINOP_END, FLAG_CXX},
+ {"and", ANDAND, OP_NULL, FLAG_CXX},
{"and_eq", ASSIGN_MODIFY, BINOP_BITWISE_AND, FLAG_CXX},
{"bitand", '&', OP_NULL, FLAG_CXX},
{"bitor", '|', OP_NULL, FLAG_CXX},
{"compl", '~', OP_NULL, FLAG_CXX},
{"not", '!', OP_NULL, FLAG_CXX},
- {"not_eq", NOTEQUAL, BINOP_END, FLAG_CXX},
- {"or", OROR, BINOP_END, FLAG_CXX},
+ {"not_eq", NOTEQUAL, OP_NULL, FLAG_CXX},
+ {"or", OROR, OP_NULL, FLAG_CXX},
{"or_eq", ASSIGN_MODIFY, BINOP_BITWISE_IOR, FLAG_CXX},
{"xor", '^', OP_NULL, FLAG_CXX},
{"xor_eq", ASSIGN_MODIFY, BINOP_BITWISE_XOR, FLAG_CXX},
{"|=", ASSIGN_MODIFY, BINOP_BITWISE_IOR},
{"&=", ASSIGN_MODIFY, BINOP_BITWISE_AND},
{"^=", ASSIGN_MODIFY, BINOP_BITWISE_XOR},
- {"++", INCREMENT, BINOP_END},
- {"--", DECREMENT, BINOP_END},
- {"&&", ANDAND, BINOP_END},
- {"||", OROR, BINOP_END},
- {"^^", HATHAT, BINOP_END},
- {"<<", LSH, BINOP_END},
- {">>", RSH, BINOP_END},
- {"==", EQUAL, BINOP_END},
- {"!=", NOTEQUAL, BINOP_END},
- {"<=", LEQ, BINOP_END},
- {">=", GEQ, BINOP_END},
- {"..", DOTDOT, BINOP_END},
+ {"++", INCREMENT, OP_NULL},
+ {"--", DECREMENT, OP_NULL},
+ {"&&", ANDAND, OP_NULL},
+ {"||", OROR, OP_NULL},
+ {"^^", HATHAT, OP_NULL},
+ {"<<", LSH, OP_NULL},
+ {">>", RSH, OP_NULL},
+ {"==", EQUAL, OP_NULL},
+ {"!=", NOTEQUAL, OP_NULL},
+ {"<=", LEQ, OP_NULL},
+ {">=", GEQ, OP_NULL},
+ {"..", DOTDOT, OP_NULL},
};
/* Identifier-like tokens. */
static const struct token ident_tokens[] =
{
- {"is", IDENTITY, BINOP_END},
- {"!is", NOTIDENTITY, BINOP_END},
+ {"is", IDENTITY, OP_NULL},
+ {"!is", NOTIDENTITY, OP_NULL},
{"cast", CAST_KEYWORD, OP_NULL},
{"const", CONST_KEYWORD, OP_NULL},
static const struct token fortran_operators[] =
{
- { ".and.", BOOL_AND, BINOP_END, false },
- { ".or.", BOOL_OR, BINOP_END, false },
- { ".not.", BOOL_NOT, BINOP_END, false },
- { ".eq.", EQUAL, BINOP_END, false },
- { ".eqv.", EQUAL, BINOP_END, false },
- { ".neqv.", NOTEQUAL, BINOP_END, false },
- { ".xor.", NOTEQUAL, BINOP_END, false },
- { "==", EQUAL, BINOP_END, false },
- { ".ne.", NOTEQUAL, BINOP_END, false },
- { "/=", NOTEQUAL, BINOP_END, false },
- { ".le.", LEQ, BINOP_END, false },
- { "<=", LEQ, BINOP_END, false },
- { ".ge.", GEQ, BINOP_END, false },
- { ">=", GEQ, BINOP_END, false },
- { ".gt.", GREATERTHAN, BINOP_END, false },
- { ">", GREATERTHAN, BINOP_END, false },
- { ".lt.", LESSTHAN, BINOP_END, false },
- { "<", LESSTHAN, BINOP_END, false },
+ { ".and.", BOOL_AND, OP_NULL, false },
+ { ".or.", BOOL_OR, OP_NULL, false },
+ { ".not.", BOOL_NOT, OP_NULL, false },
+ { ".eq.", EQUAL, OP_NULL, false },
+ { ".eqv.", EQUAL, OP_NULL, false },
+ { ".neqv.", NOTEQUAL, OP_NULL, false },
+ { ".xor.", NOTEQUAL, OP_NULL, false },
+ { "==", EQUAL, OP_NULL, false },
+ { ".ne.", NOTEQUAL, OP_NULL, false },
+ { "/=", NOTEQUAL, OP_NULL, false },
+ { ".le.", LEQ, OP_NULL, false },
+ { "<=", LEQ, OP_NULL, false },
+ { ".ge.", GEQ, OP_NULL, false },
+ { ">=", GEQ, OP_NULL, false },
+ { ".gt.", GREATERTHAN, OP_NULL, false },
+ { ">", GREATERTHAN, OP_NULL, false },
+ { ".lt.", LESSTHAN, OP_NULL, false },
+ { "<", LESSTHAN, OP_NULL, false },
{ "**", STARSTAR, BINOP_EXP, false },
};
static const struct token f77_keywords[] =
{
/* Historically these have always been lowercase only in GDB. */
- { "complex_16", COMPLEX_S16_KEYWORD, BINOP_END, true },
- { "complex_32", COMPLEX_S32_KEYWORD, BINOP_END, true },
- { "character", CHARACTER, BINOP_END, true },
- { "integer_2", INT_S2_KEYWORD, BINOP_END, true },
- { "logical_1", LOGICAL_S1_KEYWORD, BINOP_END, true },
- { "logical_2", LOGICAL_S2_KEYWORD, BINOP_END, true },
- { "logical_8", LOGICAL_S8_KEYWORD, BINOP_END, true },
- { "complex_8", COMPLEX_S8_KEYWORD, BINOP_END, true },
- { "integer", INT_KEYWORD, BINOP_END, true },
- { "logical", LOGICAL_KEYWORD, BINOP_END, true },
- { "real_16", REAL_S16_KEYWORD, BINOP_END, true },
- { "complex", COMPLEX_KEYWORD, BINOP_END, true },
- { "sizeof", SIZEOF, BINOP_END, true },
- { "real_8", REAL_S8_KEYWORD, BINOP_END, true },
- { "real", REAL_KEYWORD, BINOP_END, true },
- { "single", SINGLE, BINOP_END, true },
- { "double", DOUBLE, BINOP_END, true },
- { "precision", PRECISION, BINOP_END, true },
+ { "complex_16", COMPLEX_S16_KEYWORD, OP_NULL, true },
+ { "complex_32", COMPLEX_S32_KEYWORD, OP_NULL, true },
+ { "character", CHARACTER, OP_NULL, true },
+ { "integer_2", INT_S2_KEYWORD, OP_NULL, true },
+ { "logical_1", LOGICAL_S1_KEYWORD, OP_NULL, true },
+ { "logical_2", LOGICAL_S2_KEYWORD, OP_NULL, true },
+ { "logical_8", LOGICAL_S8_KEYWORD, OP_NULL, true },
+ { "complex_8", COMPLEX_S8_KEYWORD, OP_NULL, true },
+ { "integer", INT_KEYWORD, OP_NULL, true },
+ { "logical", LOGICAL_KEYWORD, OP_NULL, true },
+ { "real_16", REAL_S16_KEYWORD, OP_NULL, true },
+ { "complex", COMPLEX_KEYWORD, OP_NULL, true },
+ { "sizeof", SIZEOF, OP_NULL, true },
+ { "real_8", REAL_S8_KEYWORD, OP_NULL, true },
+ { "real", REAL_KEYWORD, OP_NULL, true },
+ { "single", SINGLE, OP_NULL, true },
+ { "double", DOUBLE, OP_NULL, true },
+ { "precision", PRECISION, OP_NULL, true },
/* The following correspond to actual functions in Fortran and are case
insensitive. */
- { "kind", KIND, BINOP_END, false },
+ { "kind", KIND, OP_NULL, false },
{ "abs", UNOP_INTRINSIC, UNOP_ABS, false },
{ "mod", BINOP_INTRINSIC, BINOP_MOD, false },
{ "floor", UNOP_INTRINSIC, UNOP_FORTRAN_FLOOR, false },
{"|=", ASSIGN_MODIFY, BINOP_BITWISE_IOR},
{"&=", ASSIGN_MODIFY, BINOP_BITWISE_AND},
{"^=", ASSIGN_MODIFY, BINOP_BITWISE_XOR},
- {"++", INCREMENT, BINOP_END},
- {"--", DECREMENT, BINOP_END},
- /*{"->", RIGHT_ARROW, BINOP_END}, Doesn't exist in Go. */
- {"<-", LEFT_ARROW, BINOP_END},
- {"&&", ANDAND, BINOP_END},
- {"||", OROR, BINOP_END},
- {"<<", LSH, BINOP_END},
- {">>", RSH, BINOP_END},
- {"==", EQUAL, BINOP_END},
- {"!=", NOTEQUAL, BINOP_END},
- {"<=", LEQ, BINOP_END},
- {">=", GEQ, BINOP_END},
- /*{"&^", ANDNOT, BINOP_END}, TODO */
+ {"++", INCREMENT, OP_NULL},
+ {"--", DECREMENT, OP_NULL},
+ /*{"->", RIGHT_ARROW, OP_NULL}, Doesn't exist in Go. */
+ {"<-", LEFT_ARROW, OP_NULL},
+ {"&&", ANDAND, OP_NULL},
+ {"||", OROR, OP_NULL},
+ {"<<", LSH, OP_NULL},
+ {">>", RSH, OP_NULL},
+ {"==", EQUAL, OP_NULL},
+ {"!=", NOTEQUAL, OP_NULL},
+ {"<=", LEQ, OP_NULL},
+ {">=", GEQ, OP_NULL},
+ /*{"&^", ANDNOT, OP_NULL}, TODO */
};
/* Identifier-like tokens. */
static const struct token tokentab3[] =
{
- {"shr", RSH, BINOP_END},
- {"shl", LSH, BINOP_END},
- {"and", ANDAND, BINOP_END},
- {"div", DIV, BINOP_END},
- {"not", NOT, BINOP_END},
- {"mod", MOD, BINOP_END},
- {"inc", INCREMENT, BINOP_END},
- {"dec", DECREMENT, BINOP_END},
- {"xor", XOR, BINOP_END}
+ {"shr", RSH, OP_NULL},
+ {"shl", LSH, OP_NULL},
+ {"and", ANDAND, OP_NULL},
+ {"div", DIV, OP_NULL},
+ {"not", NOT, OP_NULL},
+ {"mod", MOD, OP_NULL},
+ {"inc", INCREMENT, OP_NULL},
+ {"dec", DECREMENT, OP_NULL},
+ {"xor", XOR, OP_NULL}
};
static const struct token tokentab2[] =
{
- {"or", OR, BINOP_END},
- {"<>", NOTEQUAL, BINOP_END},
- {"<=", LEQ, BINOP_END},
- {">=", GEQ, BINOP_END},
- {":=", ASSIGN, BINOP_END},
- {"::", COLONCOLON, BINOP_END} };
+ {"or", OR, OP_NULL},
+ {"<>", NOTEQUAL, OP_NULL},
+ {"<=", LEQ, OP_NULL},
+ {">=", GEQ, OP_NULL},
+ {":=", ASSIGN, OP_NULL},
+ {"::", COLONCOLON, OP_NULL} };
/* Allocate uppercased var: */
/* make an uppercased copy of tokstart. */
the second operand with itself that many times. */
OP (BINOP_CONCAT)
-/* This must be the highest BINOP_ value, for expprint.c. */
-OP (BINOP_END)
-
/* Operates on three values computed by following subexpressions. */
OP (TERNOP_COND) /* ?: */