protected override string VisitSet(Set S) { return @"\{" + String.Join(", ", S.Members.Select(i => Visit(i))) + @"\}"; }
private PatternVariable(string Name, Set Ring, Func<Expression, bool> Condition) : base(Name, Ring) { condition = Condition; }
protected Variable(string Name, Set Ring) : base(Name) { ring = Ring; }
/// <summary> /// Create a new variable. /// </summary> /// <param name="Name"></param> /// <returns></returns> public static Variable New(string Name, Set Ring) { return new Variable(Name, Ring); }
/// <summary> /// Create a new variable with a condition callback for matching. /// </summary> /// <param name="Name"></param> /// <param Name="Ring"></param> /// <param name="Condition">A function that should return true if the variable is allowed to match the given Expression.</param> /// <returns></returns> public static PatternVariable New(string Name, Set Ring, Func<Expression, bool> Condition) { return new PatternVariable(Name, Ring, Condition); }