Warning: session_start(): open(/var/lib/php/sessions/sess_mejsd8nekf8p4ghmq9re117mo4, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
abstract sclass CtxExpr {
// assumes that ctxContext() is set
abstract bool get();
abstract S str();
}
abstract sclass CtxGeneral extends CtxExpr {
bool get() { ret eqic(str(), "true"); }
}
abstract sclass CtxBool extends CtxExpr {
S str() { ret get() ? "true" : "false"; }
}
CtxGeneral > CtxConst {
S value;
*() {}
*(S *value) {}
// assume it's a regexp when queried with get()
// and a string constant when queried with str()
S str() { ret value; }
bool get() { ret ctxEvalPattern(value); }
}
CtxGeneral > CtxVar {
S var;
*() {}
*(S *var) {}
S str() { ret ctxGetVar(var); }
}
CtxBool > CtxNeg {
CtxExpr e;
*() {}
*(CtxExpr *e) {}
bool get() { ret !e.get(); }
}
CtxBool > CtxAnd {
CtxExpr a, b;
*() {}
*(CtxExpr *a, CtxExpr *b) {}
bool get() { ret a.get() && b.get(); }
}
CtxBool > CtxOr {
CtxExpr a, b;
*() {}
*(CtxExpr *a, CtxExpr *b) {}
bool get() { ret a.get() || b.get(); }
}
CtxBool > CtxRegexp {
S pattern;
*() {}
*(S *pattern) {}
bool get() { ret ctxEvalPattern(pattern); }
}
CtxBool > CtxComp {
CtxExpr a, b;
*() {}
*(CtxExpr *a, CtxExpr *b) {}
bool get() { ret eq(a.str(), b.str()); }
}
CtxBool > CtxUneq {
CtxExpr a, b;
*() {}
*(CtxExpr *a, CtxExpr *b) {}
bool get() { ret neq(a.str(), b.str()); }
}
CtxBool > CtxMatch {
CtxExpr var;
S pattern;
*() {}
*(CtxExpr *var, S *pattern) {}
bool get() { ret ctxEvalPattern(pattern, var.str()); }
}
CtxGeneral > CtxFCall {
S fname;
new L args;
*() {}
*(S *fname, CtxExpr arg) { args.add(arg); }
S str() {
ret ctxCallFunction(arg, map(func(CtxExpr e) { e.str() }, args));
}
}