本文整理匯總了Java中org.luaj.vm2.LuaValue.LEN屬性的典型用法代碼示例。如果您正苦於以下問題:Java LuaValue.LEN屬性的具體用法?Java LuaValue.LEN怎麽用?Java LuaValue.LEN使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.luaj.vm2.LuaValue
的用法示例。
在下文中一共展示了LuaValue.LEN屬性的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getfuncname
static NameWhat getfuncname(DebugLib.CallFrame frame) {
if (!frame.f.isclosure())
return new NameWhat(frame.f.classnamestub(), "Java");
Prototype p = frame.f.checkclosure().p;
int pc = frame.pc;
int i = p.code[pc]; /* calling instruction */
LuaString tm;
switch (Lua.GET_OPCODE(i)) {
case Lua.OP_CALL:
case Lua.OP_TAILCALL: /* get function name */
return getobjname(p, pc, Lua.GETARG_A(i));
case Lua.OP_TFORCALL: /* for iterator */
return new NameWhat("(for iterator)", "(for iterator");
/* all other instructions can call only through metamethods */
case Lua.OP_SELF:
case Lua.OP_GETTABUP:
case Lua.OP_GETTABLE: tm = LuaValue.INDEX; break;
case Lua.OP_SETTABUP:
case Lua.OP_SETTABLE: tm = LuaValue.NEWINDEX; break;
case Lua.OP_EQ: tm = LuaValue.EQ; break;
case Lua.OP_ADD: tm = LuaValue.ADD; break;
case Lua.OP_SUB: tm = LuaValue.SUB; break;
case Lua.OP_MUL: tm = LuaValue.MUL; break;
case Lua.OP_DIV: tm = LuaValue.DIV; break;
case Lua.OP_MOD: tm = LuaValue.MOD; break;
case Lua.OP_POW: tm = LuaValue.POW; break;
case Lua.OP_UNM: tm = LuaValue.UNM; break;
case Lua.OP_LEN: tm = LuaValue.LEN; break;
case Lua.OP_LT: tm = LuaValue.LT; break;
case Lua.OP_LE: tm = LuaValue.LE; break;
case Lua.OP_CONCAT: tm = LuaValue.CONCAT; break;
default:
return null; /* else no useful name can be found */
}
return new NameWhat( tm.tojstring(), "metamethod" );
}
示例2: getfuncname
static NameWhat getfuncname(DebugLib.CallFrame frame) {
if (!frame.f.isclosure())
return new NameWhat(frame.f.classnamestub(), "Java");
Prototype p = frame.f.checkclosure().p;
int pc = frame.pc;
int i = p.code[pc]; /* calling instruction */
LuaString tm;
switch (Lua.GET_OPCODE(i)) {
case Lua.OP_CALL:
case Lua.OP_TAILCALL: /* get function name */
return getobjname(p, pc, Lua.GETARG_A(i));
case Lua.OP_TFORCALL: /* for iterator */
return new NameWhat("(for iterator)", "(for iterator");
/* all other instructions can call only through metamethods */
case Lua.OP_SELF:
case Lua.OP_GETTABUP:
case Lua.OP_GETTABLE:
tm = LuaValue.INDEX;
break;
case Lua.OP_SETTABUP:
case Lua.OP_SETTABLE:
tm = LuaValue.NEWINDEX;
break;
case Lua.OP_EQ:
tm = LuaValue.EQ;
break;
case Lua.OP_ADD:
tm = LuaValue.ADD;
break;
case Lua.OP_SUB:
tm = LuaValue.SUB;
break;
case Lua.OP_MUL:
tm = LuaValue.MUL;
break;
case Lua.OP_DIV:
tm = LuaValue.DIV;
break;
case Lua.OP_MOD:
tm = LuaValue.MOD;
break;
case Lua.OP_POW:
tm = LuaValue.POW;
break;
case Lua.OP_UNM:
tm = LuaValue.UNM;
break;
case Lua.OP_LEN:
tm = LuaValue.LEN;
break;
case Lua.OP_LT:
tm = LuaValue.LT;
break;
case Lua.OP_LE:
tm = LuaValue.LE;
break;
case Lua.OP_CONCAT:
tm = LuaValue.CONCAT;
break;
default:
return null; /* else no useful name can be found */
}
return new NameWhat(tm.tojstring(), "metamethod");
}