#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "lua.h"
#include "lauxlib.h"
#include "lobject.h"
#include "lstate.h"
#include "lundump.h"
#include <ctype.h>
#include "ldebug.h"
#include "lopcodes.h"
Go to the source code of this file.
Macros | |
#define | luac_c |
#define | LUA_CORE |
#define | luaU_print PrintFunction |
#define | PROGNAME "luac" /* default program name */ |
#define | OUTPUT PROGNAME ".out" /* default output file */ |
#define | IS(s) (strcmp(argv[i],s)==0) |
#define | FUNCTION "(function()end)();" |
#define | toproto(L, i) getproto(L->top+(i)) |
#define | luac_c |
#define | LUA_CORE |
#define | VOID(p) ((const void*)(p)) |
#define | UPVALNAME(x) ((f->upvalues[x].name) ? getstr(f->upvalues[x].name) : "-") |
#define | MYK(x) (-1-(x)) |
#define | SS(x) ((x==1)?"":"s") |
#define | S(x) (int)(x),SS(x) |
Functions | |
static void | PrintFunction (const Proto *f, int full) |
static void | fatal (const char *message) |
static void | cannot (const char *what) |
static void | usage (const char *message) |
static int | doargs (int argc, char *argv[]) |
static const char * | reader (lua_State *L, void *ud, size_t *size) |
static const Proto * | combine (lua_State *L, int n) |
static int | writer (lua_State *L, const void *p, size_t size, void *u) |
static int | pmain (lua_State *L) |
int | main (int argc, char *argv[]) |
static void | PrintString (const TString *ts) |
static void | PrintConstant (const Proto *f, int i) |
static void | PrintCode (const Proto *f) |
static void | PrintHeader (const Proto *f) |
static void | PrintDebug (const Proto *f) |
Variables | |
static int | listing =0 |
static int | dumping =1 |
static int | stripping =0 |
static char | Output [] ={ OUTPUT } |
static const char * | output =Output |
static const char * | progname =PROGNAME |
#define FUNCTION "(function()end)();" |
#define luaU_print PrintFunction |
Definition at line 273 of file luac.cpp.
Referenced by PrintCode().
Definition at line 374 of file luac.cpp.
Referenced by floating_point_emulation::detail::tscale< double, S, typename boost::enable_if_c< S!=0 >::type >::down(), floating_point_emulation::detail::tscale< Sint32, S, typename boost::enable_if_c< S!=0 >::type >::down(), floating_point_emulation::detail::tfloor< Sint32, S >::floor(), luaU_undump(), floating_point_emulation::operator<<(), PrintHeader(), floating_point_emulation::detail::tscale< double, S, typename boost::enable_if_c< S!=0 >::type >::up(), floating_point_emulation::detail::tscale< Sint32, S, typename boost::enable_if_c< S!=0 >::type >::up(), vadd(), vdup_n(), vld(), vmul(), vshr(), and vst().
Definition at line 373 of file luac.cpp.
Referenced by PrintHeader().
Definition at line 272 of file luac.cpp.
Referenced by PrintCode(), and PrintDebug().
Definition at line 219 of file luac.cpp.
Referenced by PrintCode(), PrintDebug(), and PrintHeader().
|
static |
Definition at line 135 of file luac.cpp.
References fatal(), i, Upvaldesc::instack, lua_load(), LUA_OK, lua_tostring, Proto::p, PROGNAME, reader(), Proto::sizelineinfo, Proto::sizeupvalues, toproto, and Proto::upvalues.
Referenced by pmain().
|
static |
Definition at line 188 of file luac.cpp.
References doargs(), fatal(), i, lua_close(), LUA_OK, lua_pcall, lua_pushcfunction, lua_pushinteger(), lua_pushlightuserdata(), lua_tostring, luaL_newstate(), pmain(), and usage().
Definition at line 161 of file luac.cpp.
References cannot(), combine(), dumping, fatal(), i, int(), IS, listing, lua_checkstack(), lua_lock, LUA_OK, lua_tointeger, lua_tostring, lua_touserdata(), lua_unlock, luaL_loadfile, luaU_dump(), luaU_print, output, stripping, and writer().
Referenced by main().
Definition at line 275 of file luac.cpp.
References Proto::code, GET_OPCODE, GETARG_A, GETARG_Ax, GETARG_B, GETARG_Bx, GETARG_C, GETARG_sBx, getBMode, getCMode, getfuncline, getOpMode, i, iABC, iABx, iAsBx, iAx, INDEXK, ISK, luaP_opnames, MYK, OP_ADD, OP_CLOSURE, OP_DIV, OP_EQ, OP_EXTRAARG, OP_FORLOOP, OP_FORPREP, OP_GETTABLE, OP_GETTABUP, OP_GETUPVAL, OP_JMP, OP_LE, OP_LOADK, OP_LT, OP_MUL, OP_POW, OP_SELF, OP_SETLIST, OP_SETTABLE, OP_SETTABUP, OP_SETUPVAL, OP_SUB, OP_TFORLOOP, OpArgK, OpArgN, OpArgU, Proto::p, PrintConstant(), Proto::sizecode, UPVALNAME, and VOID.
Referenced by PrintFunction().
Definition at line 249 of file luac.cpp.
References bvalue, i, Proto::k, LUA_NUMBER_FMT, LUA_TBOOLEAN, LUA_TNIL, LUA_TNUMBER, LUA_TSTRING, nvalue, PrintString(), rawtsvalue, ttype, and ttypenv.
Referenced by PrintCode(), and PrintDebug().
Definition at line 396 of file luac.cpp.
References LocVar::endpc, getstr, i, Upvaldesc::idx, Upvaldesc::instack, Proto::locvars, PrintConstant(), Proto::sizek, Proto::sizelocvars, Proto::sizeupvalues, LocVar::startpc, UPVALNAME, Proto::upvalues, LocVar::varname, and VOID.
Referenced by PrintFunction().
Definition at line 423 of file luac.cpp.
References i, Proto::p, PrintCode(), PrintDebug(), PrintHeader(), and Proto::sizep.
Definition at line 376 of file luac.cpp.
References getstr, Proto::is_vararg, Proto::lastlinedefined, Proto::linedefined, LUA_SIGNATURE, Proto::maxstacksize, Proto::numparams, S, Proto::sizecode, Proto::sizek, Proto::sizelocvars, Proto::sizep, Proto::sizeupvalues, Proto::source, SS, and VOID.
Referenced by PrintFunction().
Definition at line 221 of file luac.cpp.
References getstr, i, int(), TString::len, and TString::tsv.
Referenced by PrintConstant().
|
static |
|
static |
Definition at line 31 of file luac.cpp.
Referenced by cannot(), util::create_hash(), doargs(), pmain(), and tod_manager::resolve_random().
|
static |