+ for (i = 0; i < consts->count; ++i) {
+ constant *cnst = consts->list[i];
+
+ if (!strcmp(cnst->name, exp->u.numb)) {
+ free(exp->u.numb);
+ return exp->u.cnst = cnst;
+ }
+ }
+
+ return NULL;
+}
+static inline int validate_num_exp(PSI_Data *data, decl_args *dargs, decl_arg *func, num_exp *exp) {
+ if (exp->operand) {
+ switch (exp->operator) {
+ case PSI_T_PLUS:
+ exp->calculator = psi_calc_add;
+ break;
+ case PSI_T_MINUS:
+ exp->calculator = psi_calc_sub;
+ break;
+ case PSI_T_ASTERISK:
+ exp->calculator = psi_calc_mul;
+ break;
+ case PSI_T_SLASH:
+ exp->calculator = psi_calc_div;
+ break;
+ EMPTY_SWITCH_DEFAULT_CASE();
+ }
+ if (!validate_num_exp(data, dargs, func, exp->operand)) {
+ return 0;
+ }
+ }
+ switch (exp->t) {
+ case PSI_T_NAME:
+ if (!locate_decl_var_arg(exp->u.dvar, dargs, func)) {
+ data->error(PSI_WARNING, "Unknown variable '%s' in numeric expression",
+ exp->u.dvar->name);
+ return 0;
+ }
+ return 1;
+ case PSI_T_NSNAME:
+ if (!locate_num_exp_constant(exp, data->consts)) {
+ data->error(PSI_WARNING, "Unknown constant '%s' in numeric expression",
+ exp->u.numb);
+ return 0;
+ }
+ return 1;
+ case PSI_T_NUMBER:
+ return 1;
+ default:
+ return 0;
+ }
+}
+static inline int validate_set_value_handler(set_value *set) {