示例#1
0
        internal static LispExecutionState CreateExecutionState(LispStackFrame stackFrame, string inputName, LispObject obj, bool useTailCalls, bool allowHalting, bool createDribbleInstructions)
        {
            var executionState = CreateExecutionState(stackFrame, inputName, string.Empty, useTailCalls, allowHalting);

            executionState.InsertObjectOperations(obj, createDribbleInstructions);
            return(executionState);
        }
示例#2
0
        internal static LispExecutionState CreateExecutionState(LispStackFrame stackFrame, string inputName, string code, bool useTailCalls, bool allowHalting)
        {
            var reader         = new StringReader(code);
            var executionState = new LispExecutionState(stackFrame, inputName, reader, useTailCalls, allowHalting);

            return(executionState);
        }
示例#3
0
        private string CreateTracePrefix(LispStackFrame frame, bool isFunctionEnter)
        {
            var depth  = Math.Max(0, frame.Depth - 1);
            var indent = new string(' ', depth);

            return($"{indent}{depth}");
        }
示例#4
0
 private LispExecutionState(LispStackFrame stackFrame, string inputName, TextReader codeReader, bool useTailCalls, bool allowHalting)
 {
     _operationQueue = new List <ILispEvaluatorOperation>();
     CodeInputStream = new LispTextStream(inputName, codeReader, TextWriter.Null);
     StackFrame      = stackFrame;
     UseTailCalls    = useTailCalls;
     AllowHalting    = allowHalting;
 }
示例#5
0
 internal LispStackFrame(LispInvocableObject function, LispStackFrame parent)
     : this(function.NameSymbol, parent)
 {
     Function = function;
 }
示例#6
0
 protected LispStackFrame(LispResolvedSymbol functionSymbol, LispStackFrame parent)
 {
     FunctionSymbol = functionSymbol;
     Parent         = parent;
     Depth          = (Parent?.Depth ?? LispRootStackFrame.RootStackDepth) + 1;
 }
示例#7
0
 public LispErrorOccuredEventArgs(LispError error, LispStackFrame stackFrame)
 {
     Error      = error;
     StackFrame = stackFrame;
 }