public void Accept(IVisitor visitor) { visitor.BeforeMathFunction(this.Type); bool first = true; foreach (var parameter in parameters) { if (first) { first = false; } else { visitor.DuringMathFunction(); } parameter.Accept(visitor); } visitor.AfterMathFunction(); }