00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00036 #ifndef CTRUMP_EXPR_CODE_H
00037 #define CTRUMP_EXPR_CODE_H
00038
00039 #ifdef __cplusplus
00040 extern "C" {
00041 #endif
00042
00043 enum ctrump_expr_code {
00044 CTRUMP_EXPR_CONDITIONAL,
00045 CTRUMP_EXPR_MEMBER_REF,
00046 CTRUMP_EXPR_PTR_MEMBER_REF,
00047 CTRUMP_EXPR_STR_LITERAL,
00048 CTRUMP_EXPR_CALL,
00049 CTRUMP_EXPR_FLOAT_LITERAL,
00050 CTRUMP_EXPR_DOUBLE_LITERAL,
00051 CTRUMP_EXPR_LONG_DOUBLE_LITERAL,
00052 CTRUMP_EXPR_SINT_LITERAL,
00053 CTRUMP_EXPR_SLONG_LITERAL,
00054 CTRUMP_EXPR_SLLONG_LITERAL,
00055 CTRUMP_EXPR_UINT_LITERAL,
00056 CTRUMP_EXPR_ULONG_LITERAL,
00057 CTRUMP_EXPR_ULLONG_LITERAL,
00058 CTRUMP_EXPR_CAST,
00059 CTRUMP_EXPR_IMPLICIT_CAST,
00060 CTRUMP_EXPR_INITIALIZER,
00061 CTRUMP_EXPR_VARREF,
00062
00063 CTRUMP_EXPR_UNA_PTRREF,
00064 CTRUMP_EXPR_UNA_POS,
00065 CTRUMP_EXPR_UNA_NEG,
00066 CTRUMP_EXPR_UNA_PRE_INC,
00067 CTRUMP_EXPR_UNA_PRE_DEC,
00068 CTRUMP_EXPR_UNA_POST_INC,
00069 CTRUMP_EXPR_UNA_POST_DEC,
00070 CTRUMP_EXPR_UNA_ADDR,
00071 CTRUMP_EXPR_UNA_BCMPL,
00072 CTRUMP_EXPR_UNA_LNEG,
00073 CTRUMP_EXPR_UNA_SIZEOF,
00074
00075 CTRUMP_EXPR_PAREN,
00076
00077 CTRUMP_EXPR_BIN_ADD,
00078 CTRUMP_EXPR_BIN_SUB,
00079 CTRUMP_EXPR_BIN_MUL,
00080 CTRUMP_EXPR_BIN_DIV,
00081 CTRUMP_EXPR_BIN_MOD,
00082 CTRUMP_EXPR_BIN_LAND,
00083 CTRUMP_EXPR_BIN_LOR,
00084 CTRUMP_EXPR_BIN_BAND,
00085 CTRUMP_EXPR_BIN_BOR,
00086 CTRUMP_EXPR_BIN_BXOR,
00087 CTRUMP_EXPR_BIN_LSHIFT,
00088 CTRUMP_EXPR_BIN_RSHIFT,
00089 CTRUMP_EXPR_BIN_GT,
00090 CTRUMP_EXPR_BIN_GE,
00091 CTRUMP_EXPR_BIN_LT,
00092 CTRUMP_EXPR_BIN_LE,
00093 CTRUMP_EXPR_BIN_EQ,
00094 CTRUMP_EXPR_BIN_NE,
00095 CTRUMP_EXPR_BIN_ASSIGN,
00096 CTRUMP_EXPR_BIN_MUL_ASSIGN,
00097 CTRUMP_EXPR_BIN_DIV_ASSIGN,
00098 CTRUMP_EXPR_BIN_MOD_ASSIGN,
00099 CTRUMP_EXPR_BIN_ADD_ASSIGN,
00100 CTRUMP_EXPR_BIN_SUB_ASSIGN,
00101 CTRUMP_EXPR_BIN_LSHIFT_ASSIGN,
00102 CTRUMP_EXPR_BIN_RSHIFT_ASSIGN,
00103 CTRUMP_EXPR_BIN_BAND_ASSIGN,
00104 CTRUMP_EXPR_BIN_BOR_ASSIGN,
00105 CTRUMP_EXPR_BIN_BXOR_ASSIGN,
00106 CTRUMP_EXPR_BIN_COMMA,
00107
00108 CTRUMP_EXPR_ARRREF,
00109
00110 CTRUMP_EXPR_SIZEOF_TYPE,
00111 CTRUMP_EXPR_MACRO_EXPAND,
00112
00113 CTRUMP_EXPR_TEXT,
00114
00115 CTRUMP_EXPR_IVTMP,
00116
00117 CTRUMP_EXPR_EMPTY
00118 };
00119
00120
00124 #define CTRUMP_CASE_ALL_UNARY_EXPR \
00125 CTRUMP_EXPR_UNA_PTRREF: \
00126 case CTRUMP_EXPR_UNA_POS: \
00127 case CTRUMP_EXPR_UNA_NEG: \
00128 case CTRUMP_EXPR_UNA_PRE_INC: \
00129 case CTRUMP_EXPR_UNA_PRE_DEC: \
00130 case CTRUMP_EXPR_UNA_POST_INC: \
00131 case CTRUMP_EXPR_UNA_POST_DEC: \
00132 case CTRUMP_EXPR_UNA_BCMPL: \
00133 case CTRUMP_EXPR_UNA_LNEG: \
00134 case CTRUMP_EXPR_UNA_ADDR
00135
00136
00140 #define CTRUMP_CASE_BIN_ARITH_EXPR \
00141 CTRUMP_EXPR_BIN_ADD: \
00142 case CTRUMP_EXPR_BIN_SUB: \
00143 case CTRUMP_EXPR_BIN_MUL: \
00144 case CTRUMP_EXPR_BIN_DIV: \
00145 case CTRUMP_EXPR_BIN_MOD: \
00146 case CTRUMP_EXPR_BIN_BAND: \
00147 case CTRUMP_EXPR_BIN_BOR: \
00148 case CTRUMP_EXPR_BIN_BXOR: \
00149 case CTRUMP_EXPR_BIN_LSHIFT: \
00150 case CTRUMP_EXPR_BIN_RSHIFT
00151
00155 #define CTRUMP_CASE_BIN_LOG_EXPR \
00156 CTRUMP_EXPR_BIN_LAND: \
00157 case CTRUMP_EXPR_BIN_LOR
00158
00162 #define CTRUMP_CASE_BIN_EQ_EXPR \
00163 CTRUMP_EXPR_BIN_GT: \
00164 case CTRUMP_EXPR_BIN_GE: \
00165 case CTRUMP_EXPR_BIN_LT: \
00166 case CTRUMP_EXPR_BIN_LE: \
00167 case CTRUMP_EXPR_BIN_EQ: \
00168 case CTRUMP_EXPR_BIN_NE
00169
00173 #define CTRUMP_CASE_BIN_OP_ASSIGN_EXPR \
00174 CTRUMP_EXPR_BIN_MUL_ASSIGN: \
00175 case CTRUMP_EXPR_BIN_DIV_ASSIGN: \
00176 case CTRUMP_EXPR_BIN_MOD_ASSIGN: \
00177 case CTRUMP_EXPR_BIN_ADD_ASSIGN: \
00178 case CTRUMP_EXPR_BIN_SUB_ASSIGN: \
00179 case CTRUMP_EXPR_BIN_LSHIFT_ASSIGN: \
00180 case CTRUMP_EXPR_BIN_RSHIFT_ASSIGN: \
00181 case CTRUMP_EXPR_BIN_BAND_ASSIGN: \
00182 case CTRUMP_EXPR_BIN_BOR_ASSIGN: \
00183 case CTRUMP_EXPR_BIN_BXOR_ASSIGN
00184
00188 #define CTRUMP_CASE_ALL_BIN_EXPR \
00189 CTRUMP_CASE_BIN_OP_ASSIGN_EXPR: \
00190 case CTRUMP_CASE_BIN_ARITH_EXPR: \
00191 case CTRUMP_CASE_BIN_LOG_EXPR: \
00192 case CTRUMP_CASE_BIN_EQ_EXPR: \
00193 case CTRUMP_EXPR_BIN_COMMA: \
00194 case CTRUMP_EXPR_BIN_ASSIGN
00195
00196 #define IS_BIN_OP_ASSIGN(c) \
00197 (((c) == CTRUMP_EXPR_BIN_MUL_ASSIGN) || \
00198 ((c) == CTRUMP_EXPR_BIN_DIV_ASSIGN) || \
00199 ((c) == CTRUMP_EXPR_BIN_MOD_ASSIGN) || \
00200 ((c) == CTRUMP_EXPR_BIN_ADD_ASSIGN) || \
00201 ((c) == CTRUMP_EXPR_BIN_SUB_ASSIGN) || \
00202 ((c) == CTRUMP_EXPR_BIN_LSHIFT_ASSIGN) || \
00203 ((c) == CTRUMP_EXPR_BIN_RSHIFT_ASSIGN) || \
00204 ((c) == CTRUMP_EXPR_BIN_BAND_ASSIGN) || \
00205 ((c) == CTRUMP_EXPR_BIN_BXOR_ASSIGN))
00206
00210 #define CTRUMP_CASE_CONSTANT_TERM \
00211 CTRUMP_EXPR_FLOAT_LITERAL: \
00212 case CTRUMP_EXPR_DOUBLE_LITERAL: \
00213 case CTRUMP_EXPR_LONG_DOUBLE_LITERAL: \
00214 case CTRUMP_EXPR_SINT_LITERAL: \
00215 case CTRUMP_EXPR_SLONG_LITERAL: \
00216 case CTRUMP_EXPR_SLLONG_LITERAL: \
00217 case CTRUMP_EXPR_UINT_LITERAL: \
00218 case CTRUMP_EXPR_ULONG_LITERAL: \
00219 case CTRUMP_EXPR_ULLONG_LITERAL: \
00220 case CTRUMP_EXPR_SIZEOF_TYPE: \
00221 case CTRUMP_EXPR_UNA_SIZEOF: \
00222 case CTRUMP_EXPR_STR_LITERAL
00223
00227 #define CTRUMP_CASE_CONSTANT_LITERAL \
00228 CTRUMP_EXPR_FLOAT_LITERAL: \
00229 case CTRUMP_EXPR_DOUBLE_LITERAL: \
00230 case CTRUMP_EXPR_SINT_LITERAL: \
00231 case CTRUMP_EXPR_SLONG_LITERAL: \
00232 case CTRUMP_EXPR_SLLONG_LITERAL: \
00233 case CTRUMP_EXPR_UINT_LITERAL: \
00234 case CTRUMP_EXPR_ULONG_LITERAL: \
00235 case CTRUMP_EXPR_ULLONG_LITERAL: \
00236 case CTRUMP_EXPR_STR_LITERAL
00237
00241 #define CTRUMP_CASE_NUM_LITERAL \
00242 CTRUMP_EXPR_FLOAT_LITERAL: \
00243 case CTRUMP_EXPR_DOUBLE_LITERAL: \
00244 case CTRUMP_EXPR_SINT_LITERAL: \
00245 case CTRUMP_EXPR_SLONG_LITERAL: \
00246 case CTRUMP_EXPR_SLLONG_LITERAL: \
00247 case CTRUMP_EXPR_UINT_LITERAL: \
00248 case CTRUMP_EXPR_ULONG_LITERAL: \
00249 case CTRUMP_EXPR_ULLONG_LITERAL
00250
00251
00252 #ifdef __cplusplus
00253 }
00254 #endif
00255
00256 #endif