diff --git a/tree.h b/tree.h index 78523d7..9158011 100644 --- a/tree.h +++ b/tree.h @@ -24,16 +24,25 @@ enum expr_type { */ struct expr_node { enum expr_type type; + + /* hodnoty dle typu uzlu */ union expr_vals { + /* operandy u binární operace */ struct expr_binop_vals { struct expr_node *left; struct expr_node *right; } binop; + + /* argumenty funkce */ struct expr_fn_vals { size_t fn_idx; struct expr_node *args[MAX_MATH_FUNCTION_ARGS]; } fn; + + /* unární operand */ struct expr_node *unop; + + /* hodnota konstanty */ double num; } vals; };