public void PushClassScope(Structs.StructModule mod) { var c_scope = new SynScope(); PushScope(c_scope); foreach (var vv in mod.Vars) { RegVar(vv); } }
public dynamic RunMeth(Structs.StructModule mod, string name, params dynamic[] pars) { //Console.WriteLine("Running method:" + name); var m_scope = new SynScope(); PushScope(m_scope); foreach (var vv in mod.Vars) { RegVar(vv); } var meth = mod.FindMethod(name); int pc = 0; if (meth.Pars != null && meth.Pars.Pars != null) { foreach (var p in meth.Pars.Pars) { RegVar(p); p.Value = pars[pc]; } } //var func = meth; //RunFunc(new SynFunc(meth), pars); var func = new SynFunc(meth); var val = func.Link.Exec(); var nv = new Vivid.Structs.Var(); nv.Value = val; PopScope(); return(nv); return(null); }
public void DebugMod(Structs.StructModule m) { foreach (var v in m.Vars) { Console.WriteLine("Mod:" + m.ModuleName + " Var:" + v.Name + " Value:" + v.Value); if (v.Value is Structs.StructModule) { if (v.Value == m) { Console.WriteLine("Endless cycle."); return; } DebugMod(v.Value);; } } }