Exemple #1
0
 public ForBlock(LFunction function, int begin, int end, int register, Registers r)
     : base(function, begin, end)
 {
     this.register = register;
     this.r = r;
     statements = new List<Statement>(end - begin + 1);
 }
 public ClosureExpression(LFunction function, Declaration[] declList, int upvalueLine)
     : base(PRECEDENCE_ATOMIC)
 {
     this.function = function;
     this.upvalueLine = upvalueLine;
     this.declList = declList;
 }
Exemple #3
0
	  public ULFunction(LFunction function)
	  {
		constants = new Constant[function.constants.Length];
		for(int i = 0; i < constants.Length; i++)
		{
		  constants[i] = new Constant(function.constants[i]);
		}
	  }
 public IfThenEndBlock(LFunction function, Branch branch, unluac.util.Stack<Branch> stack, Registers r)
     : base(function, branch.begin == branch.end ? branch.begin - 1 : branch.begin, branch.begin == branch.end ? branch.begin - 1 : branch.end)
 {
     this.branch = branch;
     this.stack = stack;
     this.r = r;
     statements = new List<Statement>(branch.end - branch.begin + 1);
 }
Exemple #5
0
 public RepeatBlock(LFunction function, Branch branch, Registers r)
     : base(function, branch.end, branch.begin)
 {
     //System.out.println("-- creating repeat block " + branch.end + " .. " + branch.begin);
     this.branch = branch;
     this.r = r;
     statements = new List<Statement>(branch.begin - branch.end + 1);
 }
Exemple #6
0
 public ULFunction(LFunction function)
 {
     constants = new Constant[function.constants.Length];
     for (int i = 0; i < constants.Length; i++)
     {
         constants[i] = new Constant(function.constants[i]);
     }
 }
Exemple #7
0
 public WhileBlock(LFunction function, Branch branch, int loopback, Registers r)
     : base(function, branch.begin, branch.end)
 {
     this.branch = branch;
     this.loopback = loopback;
     this.r = r;
     statements = new List<Statement>(branch.end - branch.begin + 1);
 }
 public IfThenElseBlock(LFunction function, Branch branch, int loopback, bool emptyElse, Registers r)
     : base(function, branch.begin, branch.end)
 {
     this.branch = branch;
     this.loopback = loopback;
     this.emptyElse = emptyElse;
     this.r = r;
     statements = new List<Statement>(branch.end - branch.begin + 1);
 }
Exemple #9
0
 public SetBlock(LFunction function, Branch branch, int target, int line, int begin, int end, bool empty, Registers r)
     : base(function, begin, end)
 {
     this.empty = empty;
     if(begin == end)
     this.begin -= 1;
     this.target = target;
     this.branch = branch;
     this.r = r;
     //System.out.println("-- set block " + begin + " .. " + end);
 }
Exemple #10
0
 public ElseEndBlock(LFunction function, int begin, int end)
     : base(function, begin, end)
 {
     statements = new List<Statement>(end - begin + 1);
 }
Exemple #11
0
 public ClosureExpression(LFunction function, Declaration[] declList, int upvalueLine) : base(PRECEDENCE_ATOMIC)
 {
     this.function    = function;
     this.upvalueLine = upvalueLine;
     this.declList    = declList;
 }
 public IfThenEndBlock(LFunction function, Branch branch, Registers r)
     : this(function, branch, null, r)
 {
 }
Exemple #13
0
 public Decompiler(LFunction function)
 {
     this.f = new ULFunction(function);
     this.function = function;
     registers = function.maximumStackSize;
     length = function.code.Length;
     code = new Code(function);
     if(function.locals.Length >= function.numParams)
     {
       declList = new Declaration[function.locals.Length];
       for(int i = 0; i < declList.Length; i++)
       {
     declList[i] = new Declaration(function.locals[i]);
       }
       }
     else
     {
       //TODO: debug info missing;
       declList = new Declaration[function.numParams];
       for(int i = 0; i < declList.Length; i++)
       {
     declList[i] = new Declaration("_ARG_" + i + "_", 0, length - 1);
       }
     }
     upvalues = new Upvalues(function.upvalues);
     functions = function.functions;
     @params = function.numParams;
     vararg = function.vararg;
     tforTarget = function.header.version.getTForTarget();
 }
Exemple #14
0
 public Code(LFunction function)
 {
     this.code = function.code;
     map = function.header.version.getOpcodeMap();
 }
Exemple #15
0
 public CompareBlock(LFunction function, int begin, int end, int target, Branch branch)
     : base(function, begin, end)
 {
     this.target = target;
     this.branch = branch;
 }