Esempio n. 1
0
        void ITraceCollector.Run(DataStack dataStack, IFormalCodeItem codeBase)
        {
            var beforeSize = dataStack.Size;
            var index = Steps.Count;
            var item = new Step(codeBase, dataStack, index, Frames.ToArray());
            Steps.Add(item);
            AssumeStepsForCode(item.CodeBase, index);

            try
            {
                codeBase.Visit(dataStack);
            }
            catch(Exception exception)
            {
                item.Exception = exception;
                dataStack.Size = beforeSize + codeBase.Size;
            }

            item.AfterStack = dataStack;
        }
Esempio n. 2
0
        internal void RunCode()
        {
            Compiler.Ensure();
            var parent = Compiler.ExecutionContext;
            var dataStack = new DataStack(parent)
            {
                TraceCollector = TraceLog
            };

            Compiler.Execute(dataStack);
        }