Examples of MethodBlock


Examples of org.candle.decompiler.ast.MethodBlock

    IntermediateGraphTransformer igt = new IntermediateGraphTransformer(igc);
    IntermediateGraphContext interGraphContext = igt.getIntermediateGraphContext();
    processIntermediate(interGraphContext);
   
    MethodBlock method = extractMethodSignature(methodGenerator);
    BlockVisitor iv = new BlockVisitor(interGraphContext, method);
    iv.process();
   
    classBlock.addChild(method);
    method.setParent(classBlock);
  }
View Full Code Here

Examples of org.candle.decompiler.ast.MethodBlock

    LOG.debug("End Instruction Graph ======");
  }

  protected MethodBlock extractMethodSignature(MethodGen methodGen) {
   
    MethodBlock mb = null;
    boolean isConstructor = false;
   
   
        ConstantPoolGen cpg = methodGen.getConstantPool();
        LocalVariableTable lvt = methodGen.getLocalVariableTable(cpg);
       
    String access = Utility.accessToString(methodGen.getAccessFlags());
    String signature = Type.getMethodSignature(methodGen.getType(), methodGen.getArgumentTypes());
       
        String name = methodGen.getName();
        if(StringUtils.equals(name, Constants.CONSTRUCTOR_NAME)) {
          name = StringUtils.substringAfterLast(methodGen.getClassName(), ".");
          isConstructor = true;
        }
       
        if(StringUtils.equals(methodGen.getName(), Constants.STATIC_INITIALIZER_NAME)) {
          signature = "static ";
        }
        else {
          signature = org.apache.bcel.classfile.Utility.methodSignatureToString(signature, name, access, true, lvt);
        }
       
        StringBuilder builder = new StringBuilder(signature);
        if (methodGen.getExceptions().length > 0) {
            for (String excep : methodGen.getExceptions()) {
                builder.append(" throws ").append(excep);
            }
        }
       
        if(isConstructor){
          mb = new ConstructorBlock(builder.toString(), methodGen.getInstructionList().getEnd().getPosition());
        }
        else {
            mb = new MethodBlock(builder.toString(), methodGen.getInstructionList().getEnd().getPosition());
        }
       
        return mb;
  }
View Full Code Here

Examples of org.jreversepro.ast.block.MethodBlock

  public BlockInferrer(DecompilationContext _context) {

    decompiler = _context;

    mainBlock = new MethodBlock(decompiler.method.getBytes().length);

    currentBlock = mainBlock;

    gotoStack = new Stack<Instruction>();
  }
View Full Code Here

Examples of org.jruby.runtime.MethodBlock

    public IRubyObject parameters(ThreadContext context) {
        Ruby runtime = context.getRuntime();
        BlockBody body = this.getBlock().getBody();

        if (body instanceof MethodBlock) {
            MethodBlock methodBlock = (MethodBlock)body;
            return methodBlock.getMethod().parameters(context);
        }

        return RuntimeHelpers.parameterListToParameters(runtime, body.getParameterList(), isLambda());
    }
View Full Code Here

Examples of org.jruby.runtime.MethodBlock

     */
    @JRubyMethod
    public IRubyObject to_proc(ThreadContext context, Block unusedBlock) {
        Ruby runtime = context.getRuntime();
        DynamicScope currentScope = context.getCurrentScope();
        MethodBlock mb = new MethodBlock(this, currentScope.getStaticScope()) {
            @Override
            public IRubyObject callback(IRubyObject value, IRubyObject method, IRubyObject self, Block block) {
                return bmcall(value, method, self, block);
            }
        };
View Full Code Here

Examples of org.jruby.runtime.MethodBlock

     */
    @JRubyMethod
    public IRubyObject to_proc(ThreadContext context, Block unusedBlock) {
        Ruby runtime = context.runtime;
        DynamicScope currentScope = context.getCurrentScope();
        MethodBlock mb = new MethodBlock(this, currentScope.getStaticScope()) {
            @Override
            public IRubyObject callback(IRubyObject value, IRubyObject method, IRubyObject self, Block block) {
                return bmcall(value, method, self, block);
            }
        };
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.