* gdb.texinfo (Continuing and Stepping): When talking about "step"
[deliverable/binutils-gdb.git] / gdb / expression.h
index 0ef5c4d9dd9f8cd3dfd4f7623ffb0ab302e06ae7..8c34642a35ad67af7215ab2181092be0c28bd556 100644 (file)
@@ -20,6 +20,10 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #if !defined (EXPRESSION_H)
 #define EXPRESSION_H 1
 
+#ifdef __STDC__
+struct block;  /* Forward declaration for prototypes */
+#endif
+
 /* Definitions for saved C expressions.  */
 
 /* An expression is represented as a vector of union exp_element's.
@@ -48,13 +52,14 @@ enum exp_opcode
   BINOP_MUL,           /* * */
   BINOP_DIV,           /* / */
   BINOP_REM,           /* % */
+  BINOP_MOD,           /* mod (Knuth 1.2.4) */
   BINOP_LSH,           /* << */
   BINOP_RSH,           /* >> */
-  BINOP_AND,           /* && */
-  BINOP_OR,            /* || */
-  BINOP_LOGAND,                /* & */
-  BINOP_LOGIOR,                /* | */
-  BINOP_LOGXOR,                /* ^ */
+  BINOP_LOGICAL_AND,   /* && */
+  BINOP_LOGICAL_OR,    /* || */
+  BINOP_BITWISE_AND,   /* & */
+  BINOP_BITWISE_IOR,   /* | */
+  BINOP_BITWISE_XOR,   /* ^ */
   BINOP_EQUAL,         /* == */
   BINOP_NOTEQUAL,      /* != */
   BINOP_LESS,          /* < */
@@ -65,7 +70,6 @@ enum exp_opcode
   BINOP_ASSIGN,                /* = */
   BINOP_COMMA,         /* , */
   BINOP_SUBSCRIPT,     /* x[y] */
-  BINOP_MULTI_SUBSCRIPT, /* Modula-2 x[a,b,...] */
   BINOP_EXP,           /* Exponentiation */
 
 /* C++.  */
@@ -101,6 +105,14 @@ enum exp_opcode
 /* Operates on three values computed by following subexpressions.  */
   TERNOP_COND,         /* ?: */
 
+/* Multidimensional subscript operator, such as Modula-2 x[a,b,...].
+   The dimensionality is encoded in the operator, like the number of
+   function arguments in OP_FUNCALL, I.E. <OP><dimension><OP>.
+   The value of the first following subexpression is subscripted
+   by each of the next following subexpressions, one per dimension. */
+
+   MULTI_SUBSCRIPT,
+
 /* The OP_... series take immediate following arguments.
    After the arguments come another OP_... (the same one)
    so that the grouping can be recognized from the end.  */
@@ -153,8 +165,8 @@ enum exp_opcode
 /* UNOP_... operate on one value from a following subexpression
    and replace it with a result.  They take no immediate arguments.  */
   UNOP_NEG,            /* Unary - */
-  UNOP_ZEROP,          /* Unary ! */
-  UNOP_LOGNOT,         /* Unary ~ */
+  UNOP_LOGICAL_NOT,    /* Unary ! */
+  UNOP_COMPLEMENT,     /* Unary ~ */
   UNOP_IND,            /* Unary * */
   UNOP_ADDR,           /* Unary & */
   UNOP_PREINCREMENT,   /* ++ before an expression */
@@ -186,11 +198,6 @@ enum exp_opcode
    They differ only in the error message given in case the value is
    not suitable or the structure component specified is not found.
 
-   After the sub-expression and before the string is a (struct type*).
-   This is normally NULL, but is used for the TYPE in a C++ qualified
-   reference like EXP.TYPE::NAME.  (EXP.TYPE1::TYPE2::NAME does
-   not work, unfortunately.)
-
    The length of the string follows in the next exp_element,
    (after the string), followed by another STRUCTOP_... code.  */
   STRUCTOP_STRUCT,
@@ -251,4 +258,17 @@ print_expression PARAMS ((struct expression *, FILE *));
 extern char *
 op_string PARAMS ((enum exp_opcode));
 
+/* To enable dumping of all parsed expressions in a human readable
+   form, define DEBUG_EXPRESSIONS.  This is a compile time constant
+   at the moment, since it's not clear that this feature is important
+   enough to include by default. */
+
+#ifdef DEBUG_EXPRESSIONS
+extern void
+dump_expression PARAMS ((struct expression *, FILE *, char *));
+#define DUMP_EXPRESSION(exp,file,note) dump_expression ((exp), (file), (note))
+#else
+#define DUMP_EXPRESSION(exp,file,note) /* Null expansion */
+#endif /* DEBUG_EXPRESSIONS */
+
 #endif /* !defined (EXPRESSION_H) */
This page took 0.0245610000000001 seconds and 4 git commands to generate.