示例#1
0
	  public override Statement process(Registers r, Block block)
	  {
		if(table.isTableLiteral())
		{
		  table.addEntry(new TableLiteral.Entry(index, @value, !isTable, timestamp));
		  return null;
		}
		else
		{
		  return new Assignment(new TableTarget(table, index), @value);
		}
	  }
示例#2
0
 public override Statement process(Registers r, Block block)
 {
     if (table.isTableLiteral())
     {
         table.addEntry(new TableLiteral.Entry(index, @value, !isTable, timestamp));
         return(null);
     }
     else
     {
         return(new Assignment(new TableTarget(table, index), @value));
     }
 }
示例#3
0
	  public override Statement process(Registers r, Block block)
	  {
	//System.out.println("-- processing register set " + register + "@" + line);
		r.setValue(register, line, @value);
//    
//    if(value.isMultiple()) {
//      System.out.println("-- process multiple @" + register);
//    }
//    
		if(r.isAssignable(register, line))
		{
	  //System.out.println("-- assignment!");
		  return new Assignment(r.getTarget(register, line), @value);
		}
		else
		{
		  return null;
		}
	  }
示例#4
0
        public override Statement process(Registers r, Block block)
        {
            //System.out.println("-- processing register set " + register + "@" + line);
            r.setValue(register, line, @value);
//
//    if(value.isMultiple()) {
//      System.out.println("-- process multiple @" + register);
//    }
//
            if (r.isAssignable(register, line))
            {
                //System.out.println("-- assignment!");
                return(new Assignment(r.getTarget(register, line), @value));
            }
            else
            {
                return(null);
            }
        }
示例#5
0
 public override Statement process(unluac.decompile.Registers r, unluac.decompile.block.Block block)
 {
     return(_statement);
 }
示例#6
0
	  public override Statement process(Registers r, Block block)
	  {
		return new Assignment(new GlobalTarget(global), @value);
	  }
示例#7
0
 public override Statement process(Registers r, Block block)
 {
     return(new Assignment(target, @value));
 }
示例#8
0
	  public override Statement process(Registers r, Block block)
	  {
		return new Return(values);
	  }
示例#9
0
 private Assignment processOperation(Operation operation, int line, int nextLine, Block block)
 {
     Assignment assign = null;
     bool wasMultiple = false;
     Statement stmt = operation.process(r, block);
     if(stmt != null)
     {
       if(stmt is Assignment)
       {
     assign = (Assignment) stmt;
     if(!assign.getFirstValue().isMultiple())
     {
       block.addStatement(stmt);
     }
     else
     {
       wasMultiple = true;
     }
     }
       else
       {
     block.addStatement(stmt);
       }
       //System.out.println("-- added statemtent @" + line);
       if(assign != null)
       {
     //System.out.println("-- checking for multiassign @" + nextLine);
     while(nextLine < block.end && isMoveIntoTarget(nextLine))
     {
       //System.out.println("-- found multiassign @" + nextLine);
       Target target = getMoveIntoTargetTarget(nextLine, line + 1);
       Expression @value = getMoveIntoTargetValue(nextLine, line + 1); //updated?
       assign.addFirst(target, @value);
       skip[nextLine] = true;
       nextLine++;
     }
     if(wasMultiple && !assign.getFirstValue().isMultiple())
     {
       block.addStatement(stmt);
     }
       }
     }
     return assign;
 }
示例#10
0
	  public override Statement process(Registers r, Block block)
	  {
		return new Assignment(target, @value);
	  }
示例#11
0
 public override Statement process(Registers r, Block block)
 {
     return(new FunctionCallStatement(call));
 }
示例#12
0
 abstract public Statement process(Registers r, Block block);
示例#13
0
 public override Statement process(Registers r, Block block)
 {
     return(new Return(values));
 }
示例#14
0
 private Block enclosingBlock(Block block)
 {
     //Assumes the outer block is first
     Block outer = blocks[0];
     Block enclosing = outer;
     for(int i = 1; i < blocks.Count; i++)
     {
       Block next = blocks[i];
       if(next == block)
       continue;
       if(next.contains(block) && enclosing.contains(next))
       {
     enclosing = next;
       }
     }
     return enclosing;
 }
示例#15
0
 public virtual void decompile()
 {
     r = new Registers(registers, length, declList, f);
     findReverseTargets();
     handleBranches(true);
     outer = handleBranches(false);
     processSequence(1, length);
 }
示例#16
0
	  abstract public Statement process(Registers r, Block block);
示例#17
0
 public override Statement process(Registers r, Block block)
 {
     return(new Assignment(new GlobalTarget(global), @value));
 }