Inheritance: System.Compiler.Statement
示例#1
0
        private SendStatement VisitSend(SendStatement send)
        {
            WriteStart("send(");
            this.VisitExpression(send.channel);
            Write(", ");
            this.VisitExpression(send.data);
            WriteFinish(");");

            return send;
        }
示例#2
0
        private SendStatement VisitSend(SendStatement send)
        {
            send.channel = this.VisitExpression(send.channel);
            send.data = this.VisitExpression(send.data);

            return send;
        }
示例#3
0
        private Statement VisitSend(SendStatement send)
        {
            Statement sendStmt = Templates.GetStatementTemplate("Send");
            Replacer.Replace(sendStmt, "_chanExpr", this.VisitExpression(send.channel));
            Replacer.Replace(sendStmt, "_msgExpr", this.VisitExpression(send.data));
            Replacer.Replace(sendStmt, "_chanType", send.channel.Type.Name);
            Replacer.Replace(sendStmt, "_context", splicer.SourceContextConstructor(send.SourceContext));
            Replacer.Replace(sendStmt, "_contextAttr", splicer.ContextAttributeConstructor(this.attributes));

            return sendStmt;
        }
示例#4
0
        private SendStatement VisitSend(SendStatement send)
        {
            if (send == null) return null;
            SendStatement result = (SendStatement)send.Clone();
            result.channel = this.VisitExpression(send.channel);
            result.data = this.VisitExpression(send.data);

            return result;
        }
示例#5
0
        private SendStatement VisitSend(SendStatement send)
        {
            if (send == null) return null;

            BasicBlock block = AddBlock(new BasicBlock(send, CurrentContinuation));
            CurrentContinuation = block;

            return send;
        }
示例#6
0
        private SendStatement VisitSend(SendStatement send)
        {
            if (send == null) return null;

            send.channel = this.VisitExpression(send.channel);
            send.data = this.VisitExpression(send.data);

            if (send.channel == null || send.data == null)
                return null;

            Chan chanType = send.channel.Type as Chan;

            if (chanType == null)
            {
                // The channel argument must refer to a channel type
                this.HandleError(send.channel, Error.ExpectedChannelType);
                return null;
            }

            if (chanType.ChannelType != send.data.Type)
            {
                // the data argument must match the message type of the channel
                this.HandleError(send.data, Error.InvalidMessageType);
                return null;
            }

            return send;
        }