Inheritance: kOS.ExecutionContext
Example #1
0
        public override void Evaluate()
        {
            String fileName = RegexMatch.Groups[1].Value;
            File   file     = SelectedVolume.GetByName(fileName);

            if (file != null)
            {
                ContextRunProgram runContext = new ContextRunProgram(this);
                Push(runContext);

                if (file.Count > 0)
                {
                    runContext.Run(file);
                    State = ExecutionState.WAIT;
                }
                else
                {
                    State = ExecutionState.DONE;
                }
            }
            else
            {
                throw new kOSException("File not found '" + fileName + "'.");
            }
        }
Example #2
0
 public kOSException(String message, ExecutionContext context)
     : this(message)
 {
     this.LineNumber = context.Line;
     this.Context = context;
     this.Program = context.FindClosestParentOfType<ContextRunProgram>();
 }
Example #3
0
        public override void Evaluate()
        {
            String fileName   = RegexMatch.Groups[1].Value;
            File   file       = SelectedVolume.GetByName(fileName);
            var    parameters = new List <Expression>();

            if (RegexMatch.Groups.Count > 1)
            {
                String paramString = RegexMatch.Groups[3].Value;
                foreach (String param in Utils.ProcessParams(paramString))
                {
                    Expression subEx = new Expression(param, this);
                    parameters.Add(subEx);
                }
            }

            if (file != null)
            {
                ContextRunProgram runContext = new ContextRunProgram(this, parameters, fileName);
                Push(runContext);

                if (file.Count > 0)
                {
                    runContext.Run(file);
                    State = ExecutionState.WAIT;
                }
                else
                {
                    State = ExecutionState.DONE;
                }
            }
            else
            {
                throw new kOSException("File not found '" + fileName + "'.", this);
            }
        }
Example #4
0
        public override void Evaluate()
        {
            String fileName = RegexMatch.Groups[1].Value;
            File file = SelectedVolume.GetByName(fileName);

            if (file != null)
            {
                ContextRunProgram runContext = new ContextRunProgram(this);
                Push(runContext);

                if (file.Count > 0)
                {
                    runContext.Run(file);
                    State = ExecutionState.WAIT;
                }
                else
                {
                    State = ExecutionState.DONE;
                }
            }
            else
            {
                throw new kOSException("File not found '" + fileName + "'.");
            }
        }
        public override void Evaluate()
        {
            String fileName = RegexMatch.Groups[1].Value;
            File file = SelectedVolume.GetByName(fileName);
            var parameters = new List<Expression>();

            if (RegexMatch.Groups.Count > 1)
            {
                String paramString = RegexMatch.Groups[3].Value;
                foreach (String param in Utils.ProcessParams(paramString))
                {
                    Expression subEx = new Expression(param, this);
                    parameters.Add(subEx);
                }
            }

            if (file != null)
            {
                ContextRunProgram runContext = new ContextRunProgram(this, parameters);
                Push(runContext);

                if (file.Count > 0)
                {
                    runContext.Run(file);
                    State = ExecutionState.WAIT;
                }
                else
                {
                    State = ExecutionState.DONE;
                }
            }
            else
            {
                throw new kOSException("File not found '" + fileName + "'.");
            }
        }
Example #6
0
 public kOSException(String message, ExecutionContext context) : this (message)
 {
     this.LineNumber = context.Line;
     this.Context = context;
     this.Program = context.FindClosestParentOfType<ContextRunProgram>();
 }