Package org.candle.decompiler.intermediate.code

Examples of org.candle.decompiler.intermediate.code.BlockRange


  public String getVertexName(AbstractIntermediate vertex) {
    String line = StringUtils.replace(vertex.getInstruction().getPosition()+" : "+vertex.toString(), "\"", "'");
   
    if(vertex instanceof BlockSerializable) {
      BlockSerializable block = (BlockSerializable)vertex;
      BlockRange range = block.getBlockRange();
      line += range.toString();
    }
   
    line = StringUtils.replace(line, "\n", "  ->  ");
    line = StringUtils.replace(line, ";", " | ");
   
View Full Code Here


public class ElseIntermediate extends AbstractIntermediate implements BlockSerializable {
  private BlockRange blockRange;
 
  public ElseIntermediate(InstructionHandle instruction) {
    super(instruction);
    this.blockRange = new BlockRange();
    this.blockRange.setStart(instruction);
  }
View Full Code Here

  private BlockRange blockRange;
 
  public IfIntermediate(InstructionHandle instruction, ConditionalExpression expression) {
    super(instruction, expression);
   
    this.blockRange = new BlockRange();
  }
View Full Code Here

  private BooleanBranchIntermediate conditionalIntermediate;
 
  public WhileIntermediate(InstructionHandle bi, BooleanBranchIntermediate ci) {
    super(bi, ci.getExpression());
    this.conditionalIntermediate = ci;
    this.blockRange = new BlockRange();
  }
View Full Code Here

  private Expression expression;
 
  public ContinuousWhileIntermediate(InstructionHandle instruction) {
    super(instruction);
    this.expression = new BooleanLiteral(instruction, true);
    this.blockRange = new BlockRange();
  }
View Full Code Here

    //create try statements...
    for(CodeExceptionGen ceg : method.getExceptionHandlers()) {
      InstructionHandle min = ceg.getStartPC();
      InstructionHandle max = ceg.getEndPC();
     
      BlockRange tryRange = new BlockRange();
      tryRange.setStart(min);
      tryRange.setEnd(max);
     
     
      AbstractIntermediate handle = igc.findNextNode(ceg.getHandlerPC());
      LOG.debug("RANGE: "+ceg);
      LOG.debug("Range: "+tryRange+" , Target: "+handle.getInstruction().getPosition()+" , Handle: "+handle.getInstruction());
     
     
      if(ceg.getCatchType() == null) {
        if(!tryRangeFinally.containsKey(ceg.getHandlerPC())) {
          tryRangeFinally.put(ceg.getHandlerPC(), new LinkedList<CodeExceptionGen>());
        }
        tryRangeFinally.get(ceg.getHandlerPC()).add(ceg);
        continue;
      }
     
      tryBlock.add(tryRange);

      if(!tryRangeGen.containsKey(tryRange)) {
        tryRangeGen.put(tryRange, new LinkedList<CodeExceptionGen>());
      }       
      tryRangeGen.get(tryRange).add(ceg);
    }
   
   
    for(BlockRange tryRange : tryBlock) {
      //create try block... create each catch block... link the two together for graph sake.
      //look up block...
      InstructionHandle start = tryRange.getStart();
      TryIntermediate tryIntermediate = new TryIntermediate(start);
      tryIntermediate.getBlockRange().setStart(tryRange.getStart());
      tryIntermediate.getBlockRange().setEnd(tryRange.getEnd());
     
     
      igc.getGraph().addVertex(tryIntermediate);
     
      //add line between try and node.
View Full Code Here

TOP

Related Classes of org.candle.decompiler.intermediate.code.BlockRange

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.