Inheritance: JoinPattern
Example #1
0
        private ReceivePattern VisitReceivePattern(ReceivePattern rp)
        {
            Write("receive(");
            this.Visit(rp.channel);
            Write(", ");
            this.Visit(rp.data);
            Write(")");

            return rp;
        }
Example #2
0
        private ReceivePattern VisitReceivePattern(ReceivePattern rp)
        {
            rp.channel = this.VisitExpression(rp.channel);
            rp.data = this.VisitExpression(rp.data);

            return rp;
        }
Example #3
0
 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;
 }
Example #4
0
        // 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;
        }
Example #5
0
        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;
        }