typedef struct ast_switch_s ast_switch;
typedef struct ast_label_s ast_label;
typedef struct ast_goto_s ast_goto;
+typedef struct ast_argpipe_s ast_argpipe;
enum {
TYPE_ast_node, /* 0 */
TYPE_ast_breakcont, /* 17 */
TYPE_ast_switch, /* 18 */
TYPE_ast_label, /* 19 */
- TYPE_ast_goto /* 20 */
+ TYPE_ast_goto, /* 20 */
+ TYPE_ast_argpipe /* 21 */
};
#define ast_istype(x, t) ( ((ast_node*)x)->nodetype == (TYPE_##t) )
#define AST_FLAG_INCLUDE_DEF (1<<5)
#define AST_FLAG_IS_VARARG (1<<6)
#define AST_FLAG_ALIAS (1<<7)
+/* An array declared as []
+ * so that the size is taken from the initializer */
+#define AST_FLAG_ARRAY_INIT (1<<8)
#define AST_FLAG_TYPE_MASK (AST_FLAG_VARIADIC | AST_FLAG_NORETURN)
/* Value
const char *argcounter;
- /*
- int vtype;
- ast_value *next;
- */
-
int cvq; /* const/var qualifier */
bool isfield; /* this declares a field */
bool isimm; /* an immediate, not just const */
};
ast_array_index* ast_array_index_new(lex_ctx ctx, ast_expression *array, ast_expression *index);
+/* Vararg pipe node:
+ *
+ * copy all varargs starting from a specific index
+ */
+struct ast_argpipe_s
+{
+ ast_expression expression;
+ ast_expression *index;
+};
+ast_argpipe* ast_argpipe_new(lex_ctx ctx, ast_expression *index);
+
/* Store
*
* Stores left<-right and returns left.
};
ast_call* ast_call_new(lex_ctx ctx,
ast_expression *funcexpr);
-bool ast_call_check_types(ast_call*);
+bool ast_call_check_types(ast_call*, ast_expression *this_func_va_type);
/* Blocks
*