Lines Matching defs:expr

36 cxbeg(Cx_t* cx, register Cxexpr_t* expr, const char* method)
44 if (expr->begun)
46 expr->begun = 1;
47 if (expr->query->head)
51 expr->queried = expr->selected = 0;
52 if (expr->pass && cxbeg(cx, expr->pass, method))
54 if (expr->fail && cxbeg(cx, expr->fail, method))
56 if (expr->group)
58 if (cxbeg(cx, expr->group, method))
61 else if (method && expr->query->method && !strmatch(expr->query->method, method))
64 (*cx->disc->errorf)(cx, cx->disc, 2, "%s: %s: method %s expected", expr->query->name, method, expr->query->method);
67 else if (expr->query->beg)
73 sfsprintf(error_info.id = id, sizeof(id), "%-.*s::%s", s - oid, oid, expr->argv[0]);
76 cx->state->header = (Cxheader_t*)expr->query;
77 cx->expr = expr;
78 r = (*expr->query->beg)(cx, expr, expr->argv, cx->disc);
83 if (expr->query->head)
86 } while (expr = expr->next);
96 cxend(Cx_t* cx, register Cxexpr_t* expr)
98 if (!expr->begun)
100 expr->begun = 0;
103 if (expr->group)
105 if (cxend(cx, expr->group))
108 else if (expr->query->end)
110 cx->expr = expr;
111 if ((*expr->query->end)(cx, expr, NiL, cx->disc))
114 if (expr->pass && cxend(cx, expr->pass))
116 if (expr->fail && cxend(cx, expr->fail))
118 } while (expr = expr->next);
127 execute(Cx_t* cx, Cxexpr_t* expr, register Cxinstruction_t* pc, void* data, Cxoperand_t* rv, Cxdisc_t* disc)
136 sp = expr->stack + 1;
145 cxcodetrace(cx, "eval", pc, pc - pe + 1, expr->stack, sp);
155 if (expr->reclaim)
164 if (expr->reclaim && !sp->refs && (f = cxcallout(cx, CX_DEL, sp->type, cx->state->type_void, disc)))
176 * evaluate expr
180 eval(Cx_t* cx, register Cxexpr_t* expr, void* data, Cxoperand_t* rv)
188 expr->queried++;
189 cx->expr = expr;
190 if ((t = expr->group ? eval(cx, expr->group, data, rv) : expr->query->sel ? (*expr->query->sel)(cx, expr, data, cx->disc) : expr->query->prog ? execute(cx, expr, expr->query->prog, data, rv, cx->disc) : 1) < 0)
194 expr->selected++;
195 cx->expr = expr;
196 if (expr->query->act && (t = (*expr->query->act)(cx, expr, data, cx->disc)) < 0)
198 if (expr->pass && (t = eval(cx, expr->pass, data, rv)) < 0)
201 else if (expr->fail && (t = eval(cx, expr->fail, data, rv)) < 0)
205 } while (expr = expr->next);
210 * evaluate expr
214 cxeval(Cx_t* cx, register Cxexpr_t* expr, void* data, Cxoperand_t* rv)
220 if ((r = eval(cx, expr, data, rv)) < -1)