示例#1
0
                public ExecuteItemLock(BasicReplBackend evaluator)
                {
                    Monitor.Enter(evaluator._executeItemLocker);
#if DEBUG
                    Debug.Assert(evaluator._executeItemLockedThread == null);
                    evaluator._executeItemLockedThread = Thread.CurrentThread;
#endif
                    _evaluator = evaluator;
                }
示例#2
0
        private void RunRepl(JSession jSession)
        {
            BasicReplBackend backendType  = null;
            string           backendError = null;

            if (null != this._cmdLine.Backend && !this._cmdLine.Backend.Equals("standard", StringComparison.OrdinalIgnoreCase))
            {
                try
                {
                    backendType = (BasicReplBackend)Activator.CreateInstance(Type.GetType(this._cmdLine.Backend), this, jSession);
                }
                catch (UnsupportedReplException ex)
                {
                    backendError = ex.Reason;
                }
                catch (Exception ex)
                {
                    backendError = ex.Message;
                }
            }
            if (null == backendType)
            {
                backendType = new BasicReplBackend(this, jSession);
            }
            using (backendType)
            {
                backendType.Connect();
                if (this._cmdLine.EnableAttach)
                {
                    backendType.InitDebugger();
                }

                if (null != backendError)
                {
                    System.Console.Error.WriteLine("Error using selected REPL back-end:");
                    System.Console.Error.WriteLine(backendError);
                    System.Console.Error.WriteLine("Using standard backend instead.");
                }
                backendType.ExecutionLoop();
            }
        }
示例#3
0
 public ExecuteItemLock(BasicReplBackend evaluator)
 {
     Monitor.Enter(evaluator._executeItemLocker);
     #if DEBUG
     Debug.Assert(evaluator._executeItemLockedThread == null);
     evaluator._executeItemLockedThread = Thread.CurrentThread;
     #endif
     _evaluator = evaluator;
 }
示例#4
0
        private void RunRepl(JSession jSession)
        {
            BasicReplBackend backendType = null;
            string backendError = null;
            if (null != this._cmdLine.Backend && !this._cmdLine.Backend.Equals("standard", StringComparison.OrdinalIgnoreCase))
            {
                try
                {
                    backendType = (BasicReplBackend)Activator.CreateInstance(Type.GetType(this._cmdLine.Backend), this, jSession);
                }
                catch (UnsupportedReplException ex)
                {
                    backendError = ex.Reason;
                }
                catch (Exception ex)
                {
                    backendError = ex.Message;
                }
            }
            if (null == backendType)
            {
                backendType = new BasicReplBackend(this, jSession);
            }
            using (backendType)
            {
                backendType.Connect();
                if (this._cmdLine.EnableAttach)
                {
                    backendType.InitDebugger();
                }

                if (null != backendError)
                {
                    System.Console.Error.WriteLine("Error using selected REPL back-end:");
                    System.Console.Error.WriteLine(backendError);
                    System.Console.Error.WriteLine("Using standard backend instead.");
                }
                backendType.ExecutionLoop();
            }
        }