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

            return send;
        }
Ejemplo n.º 2
0
        private SendStatement VisitSend(SendStatement send)
        {
            send.channel = this.VisitExpression(send.channel);
            send.data = this.VisitExpression(send.data);

            return send;
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 5
0
        private SendStatement VisitSend(SendStatement send)
        {
            if (send == null) return null;

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

            return send;
        }
Ejemplo n.º 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;
        }