Inheritance: System.Compiler.Statement
示例#1
0
        private EventStatement VisitEventStatement(EventStatement Event)
        {
            WriteStart("event(");
            this.VisitExpression(Event.ChannelNumber);
            Write(", ");
            this.VisitExpression(Event.MessageType);
            Write(", ");
            this.VisitExpression(Event.Direction);
            WriteFinish(");");

            return Event;
        }
示例#2
0
 private EventStatement VisitEventStatement(EventStatement Event)
 {
     Event.channelNumber = this.VisitExpression(Event.channelNumber);
     Event.messageType = this.VisitExpression(Event.messageType);
     Event.direction = this.VisitExpression(Event.direction);
     return Event;
 }
示例#3
0
        private Statement VisitEventStatement(EventStatement Event)
        {
            Statement eventStmt = Templates.GetStatementTemplate("Event");

            Replacer.Replace(eventStmt, "_chanExpr", this.VisitExpression(Event.channelNumber));
            Replacer.Replace(eventStmt, "_msgExpr", this.VisitExpression(Event.messageType));
            Replacer.Replace(eventStmt, "_dirExpr", this.VisitExpression(Event.direction));
            Replacer.Replace(eventStmt, "_context", splicer.SourceContextConstructor(Event.SourceContext));
            Replacer.Replace(eventStmt, "_contextAttr", splicer.ContextAttributeConstructor(this.attributes));

            return eventStmt;
        }
示例#4
0
 private EventStatement VisitEventStatement(EventStatement Event)
 {
     if (Event == null) return null;
     EventStatement result = (EventStatement)Event.Clone();
     result.channelNumber = this.VisitExpression(Event.channelNumber);
     result.messageType = this.VisitExpression(Event.messageType);
     result.direction = this.VisitExpression(Event.direction);
     return result;
 }
示例#5
0
        private EventStatement VisitEventStatement(EventStatement Event)
        {
            BasicBlock block = AddBlock(new BasicBlock(Event, CurrentContinuation));
            CurrentContinuation = block;

            return Event;
        }
示例#6
0
        private EventStatement VisitEventStatement(EventStatement Event)
        {
            if (Event == null) return null;
            Event.direction = this.VisitExpression(Event.direction);

            if (Event.direction != null && Event.direction.Type != SystemTypes.Boolean)
            {
                this.HandleError(Event.direction, Error.BooleanExpressionRequired);
                return null;
            }

            Event.channelNumber = this.VisitExpression(Event.channelNumber);

            if (Event.channelNumber != null)
            {
                if (Event.channelNumber.Type == SystemTypes.UInt8)
                {
                    Event.channelNumber = new BinaryExpression(Event.channelNumber, new MemberBinding(null, SystemTypes.Int32),
                        NodeType.Castclass, Event.channelNumber.SourceContext);
                    Event.channelNumber.Type = SystemTypes.Int32;
                }
                else if (Event.channelNumber.Type != SystemTypes.Int32)
                {
                    this.HandleError(Event.channelNumber, Error.IntegerExpressionRequired);
                    return null;
                }
            }

            Event.messageType = this.VisitExpression(Event.messageType);

            if (Event.messageType != null)
            {
                if (Event.messageType.Type == SystemTypes.UInt8)
                {
                    Event.messageType = new BinaryExpression(Event.messageType, new MemberBinding(null, SystemTypes.Int32),
                        NodeType.Castclass, Event.messageType.SourceContext);
                    Event.messageType.Type = SystemTypes.Int32;
                }
                else if (Event.messageType.Type != SystemTypes.Int32)
                {
                    this.HandleError(Event.messageType, Error.IntegerExpressionRequired);
                    return null;
                }
            }
            return Event;
        }