상속: kOS.ExecutionContext
예제 #1
0
        public override void Evaluate()
        {
            targetVariable = ParentContext.FindOrCreateVariable(RegexMatch.Groups[1].Value);
            targetCommand = Command.Get(RegexMatch.Groups[2].Value, ParentContext);

            if (!objToBool(targetVariable.Value, out originalValue))
            {
                throw new Exception("Value type error");
            }

            ParentContext.Lock(this);

            State = ExecutionState.DONE;
        }
예제 #2
0
        public override void Evaluate()
        {
            targetExpression = new Expression(RegexMatch.Groups[1].Value, ParentContext);
            targetCommand = Command.Get(RegexMatch.Groups[2].Value, ParentContext);

            if (!objToBool(targetExpression.GetValue(), out originalValue))
            {
                throw new kOSException("Value type error");
            }

            ParentContext.Lock(this);

            State = ExecutionState.DONE;
        }
예제 #3
0
 public virtual void Unlock(Command command)
 {
     CommandLocks.Remove(command);
     if (ParentContext != null) ParentContext.Unlock(command);
 }
예제 #4
0
 public virtual void Lock(Command command)
 {
     CommandLocks.Add(command);
 }
예제 #5
0
        public override void Evaluate()
        {
            waitExpression = new Expression(RegexMatch.Groups[1].Value, ParentContext);

            var numLinesChild = Utils.NewLineCount(Input.Substring(0, RegexMatch.Groups[2].Index));
            targetCommand = Get(RegexMatch.Groups[2].Value, this, Line + numLinesChild);

            //commandString = RegexMatch.Groups[2].Value;

            State = ExecutionState.WAIT;
        }
예제 #6
0
        public override void Evaluate()
        {
            expression = new Expression(RegexMatch.Groups[1].Value, ParentContext);

            int numLinesChild = Utils.NewLineCount(Input.Substring(0, RegexMatch.Groups[2].Index));
            targetCommand = Get(RegexMatch.Groups[2].Value, this, Line + numLinesChild);

            if (expression.IsTrue())
            {
                targetCommand.Evaluate();
                Push(targetCommand);
                State = ExecutionState.WAIT;
            }
            else
            {
                State = ExecutionState.DONE;
            }
        }
예제 #7
0
        public override void Evaluate()
        {
            var listName = RegexMatch.Groups[2].Value;
            iteratorString = RegexMatch.Groups[1].Value;

            var expression = new Expression(listName, ParentContext).GetValue();
            var list = expression as ListValue;
            iterator = list.GetSuffix("ITERATOR") as Enumerator;

            int numLinesChild = Utils.NewLineCount(Input.Substring(0, RegexMatch.Groups[2].Index));
            targetCommand = Get(RegexMatch.Groups[3].Value, this, Line + numLinesChild);

            State = ExecutionState.WAIT;
        }
예제 #8
0
        public override void Evaluate()
        {
            expression = new Expression(RegexMatch.Groups[1].Value, ParentContext);
            targetCommand = Command.Get(RegexMatch.Groups[2].Value, ParentContext);

            ParentContext.Lock(this);

            State = ExecutionState.DONE;
        }
예제 #9
0
파일: Command.cs 프로젝트: Nivekk/KOS
 public override void Unlock(Command command)
 {
     if (ParentContext != null) ParentContext.Unlock(command);
 }
예제 #10
0
        public override void Evaluate()
        {
            expression = new Expression(RegexMatch.Groups[1].Value, ParentContext);
            targetCommand = Command.Get(RegexMatch.Groups[2].Value, this);

            if (expression.IsTrue())
            {
                targetCommand.Evaluate();
                Push(targetCommand);
                State = ExecutionState.WAIT;
            }
            else
            {
                State = ExecutionState.DONE;
            }
        }