Пример #1
0
 public virtual void Visit(LoopStmt loopStmt, object[] args)
 {
     foreach (Statement s in loopStmt.Content)
     {
         s.Accept(this);
     }
 }
 public virtual void Visit(LoopStmt loopStmt, object[] args)
 {
     foreach (Statement s in loopStmt.Content)
     {
         s.Accept(this);
     }
 }
 public override void Visit(LoopStmt loopStmt, object[] args)
 {
     loopStack.Push(loopStmt);
     base.Visit(loopStmt, args);
     loopStack.Pop();
 }
        public void Visit(LoopStmt loopStmt, object[] args)
        {
            RightValue rightValue = exprProcessor.Eval(loopStmt.Condition);
            if (rightValue.ToBoolean())
            {
                kernel.RuntimeData.InstructionStack.Push(loopStmt);
                kernel.RuntimeData.ScopeStack.Open(new LocalScope());
                kernel.RuntimeData.InstructionStack.Push(InstructionStack.CLOSE_LOCAL_SCOPE_FLAG);
                kernel.RuntimeData.InstructionStack.Push(loopStmt.Content);
            }
            else
            {
                //Nothing to do
            }

            kernel.Next();
        }