abstract sclass CtxExpr { abstract bool get(S s); } CtxExpr > CtxNeg { CtxExpr e; *() {} *(CtxExpr *e) {} bool get(S s) { ret !e.get(s); } } CtxExpr > CtxAnd { CtxExpr a, b; *() {} *(CtxExpr *a, CtxExpr *b) {} bool get(S s) { ret a.get(s) && b.get(s); } } CtxExpr > CtxOr { CtxExpr a, b; *() {} *(CtxExpr *a, CtxExpr *b) {} bool get(S s) { ret a.get(s) || b.get(s); } } CtxExpr > CtxRegexp { S pattern; *() {} *(S *pattern) {} bool get(S s) { ret evalPattern(pattern, s); } }