public override void EnterRuleNotMatch(RuleNotMatchContext context) { var patternTypeName = context.type().GetText(); var patternType = _parserContext.FindType(patternTypeName); if (patternType == null) { throw new InternalParseException($"Unknown type. Type={patternTypeName}", context); } var existsBuilder = _groupBuilder.Not(); var patternBuilder = existsBuilder.Pattern(patternType); if (context.expression_list() != null) { foreach (var expressionContext in context.expression_list().expression()) { using (_parserContext.PushScope()) { var expressionParser = new ExpressionParser(_parserContext, patternType); var expression = (LambdaExpression)expressionParser.Visit(expressionContext); patternBuilder.DslConditions(_parserContext.Scope.Declarations, expression); } } } }
public ILeftHandSideExpression Not <TFact>(params Expression <Func <TFact, bool> >[] conditions) { var notBuilder = _groupBuilder.Not(); var patternBuilder = notBuilder.Pattern(typeof(TFact)); patternBuilder.DslConditions(_groupBuilder.Declarations, conditions); return(this); }