+ast_ternary* ast_ternary_new(lex_ctx_t ctx, ast_expression *cond, ast_expression *ontrue, ast_expression *onfalse);
+
+/* A general loop node
+ *
+ * For convenience it contains 4 parts:
+ * -) (ini) = initializing expression
+ * -) (pre) = pre-loop condition
+ * -) (pst) = post-loop condition
+ * -) (inc) = "increment" expression
+ * The following is a psudo-representation of this loop
+ * note that '=>' bears the logical meaning of "implies".
+ * (a => b) equals (!a || b)
+
+{ini};
+while (has_pre => {pre})
+{
+ {body};
+
+continue: // a 'continue' will jump here
+ if (has_pst => {pst})
+ break;
+
+ {inc};
+}
+ */
+struct ast_loop_s
+{
+ ast_expression expression;
+ ast_expression *initexpr;
+ ast_expression *precond;
+ ast_expression *postcond;
+ ast_expression *increment;
+ ast_expression *body;
+ /* For now we allow a seperate flag on whether or not the condition
+ * is supposed to be true or false.
+ * That way, the parser can generate a 'while not(!x)' for `while(x)`
+ * if desired, which is useful for the new -f{true,false}-empty-strings
+ * flag.
+ */
+ bool pre_not;
+ bool post_not;
+};
+ast_loop* ast_loop_new(lex_ctx_t ctx,
+ ast_expression *initexpr,
+ ast_expression *precond, bool pre_not,
+ ast_expression *postcond, bool post_not,
+ ast_expression *increment,
+ ast_expression *body);
+
+/* Break/Continue
+ */
+struct ast_breakcont_s
+{
+ ast_expression expression;
+ bool is_continue;
+ unsigned int levels;
+};
+ast_breakcont* ast_breakcont_new(lex_ctx_t ctx, bool iscont, unsigned int levels);
+
+/* Switch Statements
+ *
+ * A few notes about this: with the original QCVM, no real optimization
+ * is possible. The SWITCH instruction set isn't really helping a lot, since
+ * it only collapes the EQ and IF instructions into one.
+ * Note: Declaring local variables inside caseblocks is normal.
+ * Since we don't have to deal with a stack there's no unnatural behaviour to
+ * be expected from it.
+ * TODO: Ticket #20
+ */
+typedef struct {
+ ast_expression *value; /* #20 will replace this */
+ ast_expression *code;
+} ast_switch_case;
+struct ast_switch_s
+{
+ ast_expression expression;
+
+ ast_expression *operand;
+ ast_switch_case *cases;
+};
+
+ast_switch* ast_switch_new(lex_ctx_t ctx, ast_expression *op);
+
+/* Label nodes
+ *
+ * Introduce a label which can be used together with 'goto'
+ */
+struct ast_label_s
+{
+ ast_expression expression;
+ const char *name;
+ ir_block *irblock;
+ ast_goto **gotos;
+
+ /* means it has not yet been defined */
+ bool undefined;
+};
+
+ast_label* ast_label_new(lex_ctx_t ctx, const char *name, bool undefined);
+
+/* GOTO nodes
+ *
+ * Go to a label, the label node is filled in at a later point!
+ */
+struct ast_goto_s
+{
+ ast_expression expression;
+ const char *name;
+ ast_label *target;
+ ir_block *irblock_from;
+};