komentare k tree.h

This commit is contained in:
det-fys 2024-12-30 19:09:13 +01:00
parent 1fb0614af4
commit 8d587bf4d1

9
tree.h
View File

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