Пример #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;
 }