-typedef struct ast_value_s ast_value;
-typedef struct ast_function_s ast_function;
-typedef struct ast_block_s ast_block;
-typedef struct ast_binary_s ast_binary;
-typedef struct ast_store_s ast_store;
-typedef struct ast_entfield_s ast_entfield;
-typedef struct ast_ifthen_s ast_ifthen;
-typedef struct ast_ternary_s ast_ternary;
-typedef struct ast_loop_s ast_loop;
-typedef struct ast_call_s ast_call;
-typedef struct ast_unary_s ast_unary;
-typedef struct ast_return_s ast_return;
+typedef struct ast_value_s ast_value;
+typedef struct ast_function_s ast_function;
+typedef struct ast_block_s ast_block;
+typedef struct ast_binary_s ast_binary;
+typedef struct ast_store_s ast_store;
+typedef struct ast_binstore_s ast_binstore;
+typedef struct ast_entfield_s ast_entfield;
+typedef struct ast_ifthen_s ast_ifthen;
+typedef struct ast_ternary_s ast_ternary;
+typedef struct ast_loop_s ast_loop;
+typedef struct ast_call_s ast_call;
+typedef struct ast_unary_s ast_unary;
+typedef struct ast_return_s ast_return;
+typedef struct ast_member_s ast_member;
+typedef struct ast_array_index_s ast_array_index;
+typedef struct ast_breakcont_s ast_breakcont;
+typedef struct ast_switch_s ast_switch;
+typedef struct ast_label_s ast_label;
+typedef struct ast_goto_s ast_goto;
+
+enum {
+ TYPE_ast_node, /* 0 */
+ TYPE_ast_expression, /* 1 */
+ TYPE_ast_value, /* 2 */
+ TYPE_ast_function, /* 3 */
+ TYPE_ast_block, /* 4 */
+ TYPE_ast_binary, /* 5 */
+ TYPE_ast_store, /* 6 */
+ TYPE_ast_binstore, /* 7 */
+ TYPE_ast_entfield, /* 8 */
+ TYPE_ast_ifthen, /* 9 */
+ TYPE_ast_ternary, /* 10 */
+ TYPE_ast_loop, /* 11 */
+ TYPE_ast_call, /* 12 */
+ TYPE_ast_unary, /* 13 */
+ TYPE_ast_return, /* 14 */
+ TYPE_ast_member, /* 15 */
+ TYPE_ast_array_index, /* 16 */
+ TYPE_ast_breakcont, /* 17 */
+ TYPE_ast_switch, /* 18 */
+ TYPE_ast_label, /* 19 */
+ TYPE_ast_goto /* 20 */
+};
+
+#define ast_istype(x, t) ( ((ast_node_common*)x)->nodetype == (TYPE_##t) )
+#define ast_ctx(node) (((ast_node_common*)(node))->context)
+#define ast_side_effects(node) (((ast_node_common*)(node))->side_effects)