public virtual void Visit(SetDisplayExpr setDisplayExpression) { foreach (var element in setDisplayExpression.Elements) { Visit(element); } }
public string GenerateString(SetDisplayExpr expression) { var bob = new StringBuilder(); bob.Append("{"); foreach (Expression element in expression.Elements) { bob.Append(GenerateString(element)); bob.Append(", "); } if (expression.Elements.Count > 0) { bob.Remove(bob.Length - 2, 2); } bob.Append("}"); return(bob.ToString()); }
public string GenerateConditionString(SetDisplayExpr expression, IDictionary <string, string> rename) { var bob = new StringBuilder(); bob.Append("{"); foreach (Expression element in expression.Elements) { bob.Append(GenerateConditionString(element, rename)); bob.Append(", "); } if (expression.Elements.Count > 0) { bob.Remove(bob.Length - 2, 2); } bob.Append("}"); return(bob.ToString()); }
private static bool ShallowEq(SetDisplayExpr expr1, SetDisplayExpr expr2) { return(expr1.Finite == expr2.Finite); }
void ISetDisplayExpr(IToken/*!*/ setToken, bool finite, out Expression e) { Contract.Ensures(Contract.ValueAtReturn(out e) != null); List<Expression> elements = new List<Expression/*!*/>();; e = dummyExpr; Expect(46); if (StartOf(7)) { Expressions(elements); } e = new SetDisplayExpr(setToken, finite, elements); Expect(47); }
void DisplayExpr(out Expression e) { Contract.Ensures(Contract.ValueAtReturn(out e) != null); IToken x; List<Expression> elements; e = dummyExpr; if (la.kind == 46) { Get(); x = t; elements = new List<Expression/*!*/>(); if (StartOf(7)) { Expressions(elements); } e = new SetDisplayExpr(x, true, elements); Expect(47); } else if (la.kind == 48) { Get(); x = t; elements = new List<Expression/*!*/>(); if (StartOf(7)) { Expressions(elements); } e = new SeqDisplayExpr(x, elements); Expect(49); } else SynErr(232); }