Пример #1
0
        public override PsudoInstruction Run()
        {
            bool result = false;

            if (this.expression.ToLower().Contains("eof"))
            {
                if (this.expression.ToLower().Contains("not"))
                {
                    result = !this.Method.Program.EOF;
                }
                else
                {
                    result = this.Method.Program.EOF;
                }
            }
            else
            {
                result = Convert.ToBoolean(expTree.Evaluate(this.Method.GetVariable));
            }

            // if false need to branch
            if (result == false)
            {
                return(this.FalseInstruction);
            }

            this.CodeBlock.Run(this.Method.Program);

            return(this.EndInstruction);
        }
Пример #2
0
        public override PsudoInstruction Run()
        {
            if (this.expression.ToLower().Contains("eof"))
            {
                if (this.expression.ToLower().Contains("!"))
                {
                    while (!this.Method.Program.EOF)
                    {
                        this.CodeBlock.Run(this.Method.Program);
                    }
                }
                else
                {
                    while (this.Method.Program.EOF)
                    {
                        this.CodeBlock.Run(this.Method.Program);
                    }
                }
            }
            else
            {
                while (Convert.ToBoolean(expTree.Evaluate(this.Method.GetVariable)))
                {
                    this.Method.Program.OnAfterInstruction(this);
                    this.CodeBlock.Run(this.Method.Program);
                }
            }

            return(null);
        }
 public override PsudoInstruction Run()
 {
     try
     {
         object value = expTree.Evaluate(this.Method.GetVariable);
         CreateOrSetVariable(variable, value);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
     return(null);
 }