Search in sources :

Example 1 with LocalVariableGen

use of org.apache.bcel.generic.LocalVariableGen in project candle-decompiler by bradsdavis.

the class VariableResolver method getLocalVariable.

public IntermediateVariable getLocalVariable(int index, int pc) {
    IntermediateVariable iv = null;
    LocalVariableGen lv = getLocalVariableTable(index, pc);
    if (lv != null) {
        iv = new IntermediateVariable(lv.getName(), lv.getType());
    } else {
        for (VariableIndex vi : localGeneratedVariables.keySet()) {
            if (vi.withinBounds(index, pc)) {
                return localGeneratedVariables.get(vi);
            }
        }
    }
    return iv;
}
Also used : LocalVariableGen(org.apache.bcel.generic.LocalVariableGen)

Example 2 with LocalVariableGen

use of org.apache.bcel.generic.LocalVariableGen in project jop by jop-devel.

the class DescendingClassTraverser method visitMethodCode.

public void visitMethodCode(MethodInfo methodInfo) {
    if (methodInfo.hasCode()) {
        bcelVisitor.setCode(true);
        MethodCode code = methodInfo.getCode();
        visitor.visitMethodCode(code);
        for (CodeExceptionGen ex : code.getExceptionHandlers()) {
            visitor.visitCodeException(methodInfo, ex);
        }
        for (LineNumberGen lng : code.getLineNumbers()) {
            visitor.visitLineNumber(methodInfo, lng);
        }
        for (LocalVariableGen lvg : code.getLocalVariables()) {
            visitor.visitLocalVariable(methodInfo, lvg);
        }
        visitAttributes(code.getAttributes());
        bcelVisitor.setCode(false);
    }
}
Also used : LineNumberGen(org.apache.bcel.generic.LineNumberGen) LocalVariableGen(org.apache.bcel.generic.LocalVariableGen) MethodCode(com.jopdesign.common.MethodCode) CodeExceptionGen(org.apache.bcel.generic.CodeExceptionGen)

Aggregations

LocalVariableGen (org.apache.bcel.generic.LocalVariableGen)2 MethodCode (com.jopdesign.common.MethodCode)1 CodeExceptionGen (org.apache.bcel.generic.CodeExceptionGen)1 LineNumberGen (org.apache.bcel.generic.LineNumberGen)1