Class Script

java.lang.Object
meteordevelopment.starscript.Script

public class Script extends Object
Compiled representation of starscript code that can be run inside Starscript.
  • Field Details

    • code

      public byte[] code
    • constants

      public final List<Value> constants
  • Constructor Details

    • Script

      public Script()
  • Method Details

    • write

      public void write(Instruction insn)
      Writes instruction to this script.
    • write

      public void write(Instruction insn, int b)
      Writes instruction with an additional byte to this script.
    • write

      public void write(Instruction insn, Value constant)
      Writes instruction with an additional constant value to this script.
    • writeConstant

      public void writeConstant(Value constant)
      Writes constant value to this script.
    • writeJump

      public int writeJump(Instruction insn)
      Begins a jump instruction.
    • patchJump

      public void patchJump(int offset)
      Ends a jump instruction.
    • decompile

      public void decompile()
      Decompiles this script and writes it to System.out.