Class Print

java.lang.Object
com.prineside.luaj.Lua
com.prineside.luaj.Print

public class Print extends Lua
Debug helper class to pretty-print lua bytecodes.
See Also:
  • Field Details

    • ps

      public static PrintStream ps
    • OPNAMES

      public static final String[] OPNAMES
      String names for each lua opcode value.
  • Constructor Details

    • Print

      public Print()
  • Method Details

    • printCode

      public static void printCode(Prototype f)
      Print the code in a prototype
      Parameters:
      f - the Prototype
    • printOpCode

      public static int printOpCode(Prototype f, int pc)
      Print an opcode in a prototype
      Parameters:
      f - the Prototype
      pc - the program counter to look up and print
      Returns:
      pc same as above or changed
    • printOpCode

      public static int printOpCode(PrintStream ps, Prototype f, int pc)
      Print an opcode in a prototype
      Parameters:
      ps - the PrintStream to print to
      f - the Prototype
      pc - the program counter to look up and print
      Returns:
      pc same as above or changed
    • print

      public static void print(Prototype prototype)
      Pretty-prints contents of a Prototype.
      Parameters:
      prototype - Prototype to print.
    • printFunction

      public static void printFunction(Prototype prototype, boolean full)
      Pretty-prints contents of a Prototype in short or long form.
      Parameters:
      prototype - Prototype to print.
      full - true to print all fields, false to print short form.
    • printState

      public static void printState(LuaClosure cl, int pc, LuaValue[] stack, int top, Varargs varargs)
      Print the state of a LuaClosure that is being executed
      Parameters:
      cl - the LuaClosure
      pc - the program counter
      stack - the stack of LuaValue
      top - the top of the stack
      varargs - any Varargs value that may apply
    • printStack

      public static void printStack(LuaValue[] stack, int top, Varargs varargs)