Ejemplo n.º 1
0
 public Registers(int registers, int length, Declaration[] declList, ULFunction f)
 {
     this.registers = registers;
     this.length = length;
     //JAVA TO VB & C# CONVERTER TODO TASK: Java rectangular arrays cannot be reliably converted:
     decls = new Declaration[registers,length + 1];
     for(int i = 0; i < declList.Length; i++)
     {
       Declaration decl = declList[i];
       int register = 0;
       while(decls[register,decl.begin] != null)
       {
     register++;
       }
       decl.register = register;
       for(int line = decl.begin; line <= decl.end; line++)
       {
     decls[register,line] = decl;
       }
     }
     //JAVA TO VB & C# CONVERTER TODO TASK: Java rectangular arrays cannot be reliably converted:
     values = new Expression[registers,length + 1];
     for(int register = 0; register < registers; register++)
     {
       values[register,0] = Expression.NIL;
     }
     //JAVA TO VB & C# CONVERTER TODO TASK: Java rectangular arrays cannot be reliably converted:
     updated = new int[registers,length + 1];
     startedLines = new bool[length + 1];
       for(int i = 0; i < startedLines.Length; i++)
       {
       startedLines[i] = false;
       }
     this.f = f;
 }
Ejemplo n.º 2
0
 private void newDeclaration(Declaration decl, int register, int begin, int end)
 {
     for(int line = begin; line <= end; line++)
     {
       decls[register,line] = decl;
     }
 }
Ejemplo n.º 3
0
 public virtual void setExplicitLoopVariable(int register, int begin, int end)
 {
     Declaration decl = getDeclaration(register, begin);
     if(decl == null)
     {
       decl = new Declaration("_FORV_" + register + "_", begin, end);
       decl.register = register;
       newDeclaration(decl, register, begin, end);
     }
     decl.forLoopExplicit = true;
 }
Ejemplo n.º 4
0
 public virtual void setInternalLoopVariable(int register, int begin, int end)
 {
     Declaration decl = getDeclaration(register, begin);
     if(decl == null)
     {
       decl = new Declaration("_FOR_", begin, end);
       decl.register = register;
       newDeclaration(decl, register, begin, end);
     }
     decl.forLoop = true;
 }
Ejemplo n.º 5
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();
 }