コード例 #1
0
ファイル: Registers.cs プロジェクト: parhelia512/unluacNet
 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;
 }
コード例 #2
0
ファイル: Registers.cs プロジェクト: parhelia512/unluacNet
 private void newDeclaration(Declaration decl, int register, int begin, int end)
 {
     for(int line = begin; line <= end; line++)
     {
       decls[register,line] = decl;
     }
 }
コード例 #3
0
ファイル: Registers.cs プロジェクト: parhelia512/unluacNet
 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;
 }
コード例 #4
0
ファイル: Registers.cs プロジェクト: parhelia512/unluacNet
 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;
 }
コード例 #5
0
ファイル: Decompiler.cs プロジェクト: parhelia512/unluacNet
 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();
 }