private ReceivePattern VisitReceivePattern(ReceivePattern rp) { Write("receive("); this.Visit(rp.channel); Write(", "); this.Visit(rp.data); Write(")"); return rp; }
private ReceivePattern VisitReceivePattern(ReceivePattern rp) { rp.channel = this.VisitExpression(rp.channel); rp.data = this.VisitExpression(rp.data); return rp; }
private ReceivePattern VisitReceivePattern(ReceivePattern rp) { if (rp == null) return null; ReceivePattern result = (ReceivePattern)rp.Clone(); result.channel = this.VisitExpression(rp.channel); result.data = this.VisitExpression(rp.data); return result; }
// These visitor methods are called only from GetRunnablePredicate private Expression VisitReceivePattern(ReceivePattern rp) { Expression receivePred = Templates.GetExpressionTemplate("ReceivePatternPredicate"); Replacer.Replace(receivePred, "_chanType", rp.channel.Type.Name); Replacer.Replace(receivePred, "_chanExpr", this.VisitExpression(rp.channel)); return receivePred; }
private ReceivePattern VisitReceivePattern(ReceivePattern rp) { if (rp == null) return null; rp.channel = this.VisitExpression(rp.channel); rp.data = this.VisitExpression(rp.data); if (rp.channel == null || rp.data == null) return null; Chan chanType = rp.channel.Type as Chan; if (chanType == null) { // The channel argument must refer to a channel type this.HandleError(rp.channel, Error.ExpectedChannelType); return null; } if (chanType.ChannelType != rp.data.Type) { // the data argument must match the message type of the channel this.HandleError(rp.data, Error.InvalidMessageType); return null; } return rp; }