print.cpp File Reference

#include <ctype.h>
#include <stdio.h>
#include "ldebug.h"
#include "lobject.h"
#include "lopcodes.h"
#include "lundump.h"

Go to the source code of this file.

Defines

#define luac_c
#define LUA_CORE
#define PrintFunction   luaU_print
#define Sizeof(x)   ((int)sizeof(x))
#define VOID(p)   ((const void*)(p))
#define SS(x)   (x==1)?"":"s"
#define S(x)   x,SS(x)

Functions

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 PrintConstants (const Proto *f)
static void PrintLocals (const Proto *f)
static void PrintUpvalues (const Proto *f)
void PrintFunction (const Proto *f, int full)


Define Documentation

#define LUA_CORE

Definition at line 11 of file print.cpp.

#define luac_c

Definition at line 10 of file print.cpp.

#define PrintFunction   luaU_print

Definition at line 18 of file print.cpp.

Referenced by PrintFunction().

#define S ( x   )     x,SS(x)

Definition at line 159 of file print.cpp.

Referenced by luaU_undump(), and PrintHeader().

#define Sizeof ( x   )     ((int)sizeof(x))

Definition at line 20 of file print.cpp.

Referenced by PrintHeader().

#define SS ( x   )     (x==1)?"":"s"

Definition at line 158 of file print.cpp.

Referenced by PrintHeader().

#define VOID ( p   )     ((const void*)(p))

Definition at line 21 of file print.cpp.

Referenced by PrintCode(), PrintConstants(), PrintHeader(), PrintLocals(), and PrintUpvalues().


Function Documentation

static void PrintCode ( const Proto f  )  [static]

Definition at line 74 of file print.cpp.

References Proto::code, GET_OPCODE, GETARG_A, GETARG_B, GETARG_Bx, GETARG_C, GETARG_sBx, getBMode, getCMode, getline, getOpMode, getstr, iABC, iABx, iAsBx, INDEXK, ISK, Proto::k, luaP_opnames, OP_ADD, OP_CLOSURE, OP_DIV, OP_EQ, OP_FORLOOP, OP_FORPREP, OP_GETGLOBAL, OP_GETTABLE, OP_GETUPVAL, OP_JMP, OP_LE, OP_LOADK, OP_LT, OP_MUL, OP_POW, OP_SELF, OP_SETGLOBAL, OP_SETLIST, OP_SETTABLE, OP_SETUPVAL, OP_SUB, OpArgK, OpArgN, Proto::p, PrintConstant(), Proto::sizecode, Proto::sizeupvalues, svalue, Proto::upvalues, and VOID.

Referenced by PrintFunction().

static void PrintConstant ( const Proto f,
int  i 
) [static]

Definition at line 51 of file print.cpp.

References bvalue, Proto::k, LUA_TBOOLEAN, LUA_TNIL, LUA_TNUMBER, LUA_TSTRING, nvalue, PrintString(), rawtsvalue, and ttype.

Referenced by PrintCode(), and PrintConstants().

static void PrintConstants ( const Proto f  )  [static]

Definition at line 181 of file print.cpp.

References PrintConstant(), Proto::sizek, and VOID.

Referenced by PrintFunction().

void PrintFunction ( const Proto f,
int  full 
)

Definition at line 215 of file print.cpp.

References Proto::p, PrintCode(), PrintConstants(), PrintFunction, PrintHeader(), PrintLocals(), PrintUpvalues(), and Proto::sizep.

static void PrintHeader ( const Proto f  )  [static]

Definition at line 161 of file print.cpp.

References getstr, Proto::is_vararg, Proto::lastlinedefined, Proto::linedefined, LUA_SIGNATURE, Proto::maxstacksize, Proto::numparams, Proto::nups, S, Proto::sizecode, Proto::sizek, Proto::sizelocvars, Sizeof, Proto::sizep, Proto::source, SS, and VOID.

Referenced by PrintFunction().

static void PrintLocals ( const Proto f  )  [static]

Definition at line 193 of file print.cpp.

References LocVar::endpc, getstr, Proto::locvars, Proto::sizelocvars, LocVar::startpc, LocVar::varname, and VOID.

Referenced by PrintFunction().

static void PrintString ( const TString ts  )  [static]

Definition at line 23 of file print.cpp.

References getstr, TString::len, and TString::tsv.

Referenced by PrintConstant().

static void PrintUpvalues ( const Proto f  )  [static]

Definition at line 204 of file print.cpp.

References getstr, NULL, Proto::sizeupvalues, Proto::upvalues, and VOID.

Referenced by PrintFunction().


Generated on Mon Feb 16 15:14:59 2009 for Scorched3D by  doxygen 1.5.3