public CapturingGroupBrick Clone(IFlexpressionAlgebra algebra, string groupName, bool freeze = false) { var expressionType = string.Equals(groupName, _expressionType.Name) ? _expressionType : ExpressionTypeDescriptor.Create(groupName, _expressionType.ValueTypeId, _expressionType.DefinesExpressionClass); return(new CapturingGroupBrick(expressionType, algebra.GetHighestPrioritizedAlgebra(this), Content, freeze)); }
protected CompositeFlexpressionBrick(IFlexpressionAlgebra algebra, FlexpressionBrick b1, FlexpressionBrick b2, FlexpressionBrick b3, Func <CompositeFlexpressionBrick, bool> canFlattenPredicate) : base(algebra.GetHighestPrioritizedAlgebra(b1, b2, b3)) { var flatLength = GetSourceLength(b1, canFlattenPredicate) + GetSourceLength(b2, canFlattenPredicate) + GetSourceLength(b3, canFlattenPredicate); Bricks = new FlexpressionBrick[flatLength]; var pos = 0; AddBrick(Bricks, b1, canFlattenPredicate, ref pos); AddBrick(Bricks, b2, canFlattenPredicate, ref pos); AddBrick(Bricks, b3, canFlattenPredicate, ref pos); }
protected CompositeFlexpressionBrick(IFlexpressionAlgebra algebra, FlexpressionBrick[] bricks, Func <CompositeFlexpressionBrick, bool> canFlattenPredicate) : base(algebra.GetHighestPrioritizedAlgebra(bricks)) { var flatLength = bricks.Sum(b => GetSourceLength(b, canFlattenPredicate)); Bricks = new FlexpressionBrick[flatLength]; var pos = 0; var len = bricks.Length; for (var idx = 0; idx < len; ++idx) { AddBrick(Bricks, bricks[idx], canFlattenPredicate, ref pos); } }
public CapturingGroupBrick Clone(IFlexpressionAlgebra algebra, bool freeze = false) { return(new CapturingGroupBrick(_expressionType, algebra.GetHighestPrioritizedAlgebra(this), Content, freeze)); }
public static IFlexpressionAlgebra GetHighestPrioritizedAlgebra(this IFlexpressionAlgebra defaultAlgebra, FlexpressionBrick arg1, FlexpressionBrick arg2, FlexpressionBrick arg3) { var alg = defaultAlgebra.GetHighestPrioritizedAlgebra(arg1).GetHighestPrioritizedAlgebra(arg2).GetHighestPrioritizedAlgebra(arg3); return(alg); }
public RulePlaceholderBrick(IFlexpressionAlgebra algebra, string ruleName, FlexpressionBrick defaultRule) : base(algebra.GetHighestPrioritizedAlgebra(defaultRule)) { RuleName = ruleName; _rule = defaultRule != null ? new FreezableValue <Tuple <FlexpressionBrick, bool> >(Tuple.Create(defaultRule, false)) : new FreezableValue <Tuple <FlexpressionBrick, bool> >(); }