use of org.candle.decompiler.intermediate.expression.FieldAccess in project candle-decompiler by bradsdavis.
the class MethodIntermediateVisitor method visitPUTFIELD.
public void visitPUTFIELD(PUTFIELD instruction) {
ConstantPoolGen cpg = context.getMethodGen().getConstantPool();
String fieldName = instruction.getFieldName(cpg);
Expression right = context.getExpressions().pop();
Expression left = context.getExpressions().pop();
FieldAccess fieldRef = new FieldAccess(context.getCurrentInstruction(), left, fieldName);
Assignment assignment = new Assignment(context.getCurrentInstruction(), fieldRef, right);
StatementIntermediate complete = new StatementIntermediate(context.getCurrentInstruction(), assignment);
context.pushIntermediateToInstruction(complete);
}
use of org.candle.decompiler.intermediate.expression.FieldAccess in project candle-decompiler by bradsdavis.
the class MethodIntermediateVisitor method visitGETFIELD.
public void visitGETFIELD(GETFIELD instruction) {
LOG.debug("Getting field..");
Expression target = context.getExpressions().pop();
MethodGen mg = context.getMethodGen();
ConstantPoolGen cpg = mg.getConstantPool();
FieldAccess ref = new FieldAccess(context.getCurrentInstruction(), target, instruction.getFieldName(cpg));
context.getExpressions().push(ref);
}
Aggregations