X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=ast.h;h=5b556e1be52912e44a554c1b4e99a4d059b3097b;hb=41a76ab91dc6f872b03cd64f51aba86578f330c0;hp=7cc7a6c89b13975549307d2a269c3fde4bb4ec85;hpb=9cc4fe1ed246e3c37af7cbd7245b0b413372f3b9;p=xonotic%2Fgmqcc.git diff --git a/ast.h b/ast.h index 7cc7a6c..5b556e1 100644 --- a/ast.h +++ b/ast.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012, 2013, 2014 + * Copyright (C) 2012, 2013, 2014, 2015 * Wolfgang Bumiller * Dale Weiler * @@ -54,6 +54,7 @@ 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; +typedef struct ast_state_s ast_state; enum { AST_FLAG_VARIADIC = 1 << 0, @@ -111,7 +112,8 @@ enum { TYPE_ast_switch, /* 18 */ TYPE_ast_label, /* 19 */ TYPE_ast_goto, /* 20 */ - TYPE_ast_argpipe /* 21 */ + TYPE_ast_argpipe, /* 21 */ + TYPE_ast_state /* 22 */ }; #define ast_istype(x, t) ( ((ast_node*)x)->nodetype == (TYPE_##t) ) @@ -214,6 +216,7 @@ struct ast_value_s bool isfield; /* this declares a field */ bool isimm; /* an immediate, not just const */ bool hasvalue; + bool inexact; /* inexact coming from folded expression */ basic_value_t constval; /* for TYPE_ARRAY we have an optional vector * of constants when an initializer list @@ -579,6 +582,19 @@ struct ast_goto_s ast_goto* ast_goto_new(lex_ctx_t ctx, const char *name); void ast_goto_set_label(ast_goto*, ast_label*); +/* STATE node + * + * For frame/think state updates: void foo() [framenum, nextthink] {} + */ +struct ast_state_s +{ + ast_expression expression; + ast_expression *framenum; + ast_expression *nextthink; +}; +ast_state* ast_state_new(lex_ctx_t ctx, ast_expression *frame, ast_expression *think); +void ast_state_delete(ast_state*); + /* CALL node * * Contains an ast_expression as target, rather than an ast_function/value.