/// <summary>
 /// 
 /// </summary>
 /// <returns></returns>
 protected override DotLispInterpreterBase MakeInterp(object self)
 {
     var v = new DotLispInterpreter();
     v._dotLispInterpreter = new Interpreter(_dotLispInterpreter);
     v.EnsureInit();
     v.Intern("*SELF*", self);
     return v;
 } // method: newInterpreter
Example #2
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override DotLispInterpreterBase MakeInterp(object self)
        {
            var v = new DotLispInterpreter();

            v._dotLispInterpreter = new Interpreter(_dotLispInterpreter);
            v.EnsureInit();
            v.Intern("*SELF*", self);
            return(v);
        } // method: newInterpreter
 private static void LoadPredfinedInterpretors(object self)
 {
     if (false)
     {
         //if (self is ClientManager) self = ((ClientManager)self).LastBotClient ?? self;
         BotScriptInterpreter newBotScriptInterpreter = new BotScriptInterpreter(self);
         newBotScriptInterpreter = (BotScriptInterpreter)newBotScriptInterpreter.newInterpreter(self);
         AddInterpreter(newBotScriptInterpreter);
         DotLispInterpreter dotLispInterpreter = new DotLispInterpreter(self);
         dotLispInterpreter = (DotLispInterpreter)dotLispInterpreter.newInterpreter(self);
         AddInterpreter(dotLispInterpreter);
     }
 }
 private static ScriptInterpreter UsedCSharpScriptDefinedType(object self, string type)
 {
     if (type != null)
     {
         type = type.ToLower();
         if (type.StartsWith("dotlisp"))
         {
             var dl = new DotLispInterpreter();
             dl.Self = self;
             return(dl);
         }
     }
     return(null);
 }
        /// <summary>
        ///
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        public static ScriptInterpreter LoadScriptInterpreter0(string type, object self, ScriptInterpreter parent)
        {
            var Interpreters = ScriptManager.Interpreters;

            lock (Interpreters)
            {
                var ret = UsedCSharpScriptDefinedType(self, type);
                if (ret != null)
                {
                    return(ret);
                }
                ScriptInterpreter typed = null;
                foreach (ScriptInterpreter set in Interpreters)
                {
                    if (set.LoadsFileType(type))
                    {
                        typed = set;
                        if (self != null)
                        {
                            if (typed.IsSelf(self))
                            {
                                return(set);
                            }
                        }
                    }
                }
                if (typed != null)
                {
                    return(typed.newInterpreter(self));
                }
                ScanPredfinedAssemblies();
                InstanceNewInterpTypes(self);
                return(FindOrCreate(type, self, parent));

                //default
                var dl = new DotLispInterpreter();
                dl.Self = self;
                return(dl);
            } // method: LoadScriptInterpreter
        }