public StackFrame(LVM vm) { this.vm = vm; uid = vm.NewUID(); context = new Dictionary <string, LuaBinder>(); stack = new Stack <LuaObject>(); }
public Module(ModuleContext context) { this.context = context; vm = context.vm; uid = vm.NewUID(); name = context.name; codesList = context.list; level = context.level; }
public StackFrame(Module module, StackFrame parent) { this.parent = parent; this.module = module; vm = parent.vm; uid = vm.NewUID(); codesList = module.codesList; context = new Dictionary <string, LuaBinder>(); stack = new Stack <LuaObject>(); level = parent.level + 1; executor = parent.executor; iterator = Execute(); }
public LuaLibrary(LVM vm) { this.vm = vm; stackFrame = vm.stackFrame; Add(traceFunc = new LuaNative(vm, "trace", Trace)); Add(printFunc = new LuaNative(vm, "print", Print)); Add(lenFunc = new LuaNative(vm, "len", Length)); Add(pairsFunc = new LuaNative(vm, "pairs", Pairs)); Add(nextFunc = new LuaNative(vm, "next", Next)); Add(ipairsFunc = new LuaNative(vm, "ipairs", IPairs)); Add(iterFunc = new LuaNative(vm, vm.NewUID(), Iterator)); Add(setmetaFunc = new LuaNative(vm, "setmetatable", SetMetatable)); Add(getmetaFunc = new LuaNative(vm, "getmetatable", GetMetatable)); Add("table", table = vm.GetTable()); table.Bind(vm.GetString("insert"), new LuaNative(vm, "insert", Insert)); }
public LuaTuple(LVM vm, IEnumerable <LuaObject> list) : base(vm, Type.Tuple) { uid = vm.NewUID(); AddRange(list); }
public LuaTable(LVM vm) : base(vm, Type.Table) { uid = vm.NewUID(); list = new LuaList(vm, this); dict = new LuaDict(vm, this); }
public LuaNative(LVM vm, string name, Action <StackFrame, LuaObject[]> func) : base(vm, Type.Native) { this.name = name; this.func = func; uid = vm.NewUID(); }
public LuaUserdata(LVM vm, object value) : base(vm, Type.Userdata) { this.value = value; uid = vm.NewUID(); }
public string NewUID() { return(vm.NewUID()); }