abstract sclass CtxExpr { // assumes that ctxContext() is set abstract bool get(); } CtxExpr > CtxNeg { CtxExpr e; *() {} *(CtxExpr *e) {} bool get() { ret !e.get(); } } CtxExpr > CtxAnd { CtxExpr a, b; *() {} *(CtxExpr *a, CtxExpr *b) {} bool get() { ret a.get() && b.get(); } } CtxExpr > CtxOr { CtxExpr a, b; *() {} *(CtxExpr *a, CtxExpr *b) {} bool get() { ret a.get() || b.get(); } } CtxExpr > CtxRegexp { S pattern; *() {} *(S *pattern) {} bool get() { ret ctxEvalPattern(pattern); } }