private void printFields(Iterable<Field> fields) { for (Field f : fields) { println( getKeywords(f.getFlags()) + " " + f.getType().getName() + " " + f.getName() + ";" ); } }
public void visit(FieldAccessType fieldAccessType) { Field field = fieldAccessType.getField(); if (field.isStatic()) { Type expressionType = evalExp(); methodByteCodeContext.handleConversion(expressionType, field.getType()); methodByteCodeContext.addInstruction(new FieldInsnNode(PUTSTATIC, methodContext.getClassIdentifier(), field.getName(), field.getSignature()), "set static", setStatement.getTo()); } else { methodByteCodeContext.loadThis("set", setStatement.getTo()); Type expressionType = evalExp(); methodByteCodeContext.handleConversion(expressionType, field.getType()); methodByteCodeContext.addInstruction(new FieldInsnNode(PUTFIELD, methodContext.getClassIdentifier(), field.getName(), field.getSignature()), "set", setStatement.getTo()); } } public void visit(LocalVariableAccessType localVariableAccessType) {
public void visit(FieldAccessType fieldAccessType) { Field field = fieldAccessType.getField(); if (field.isStatic()) { methodByteCodeContext.addInstruction( new FieldInsnNode(GETSTATIC, methodContext.getType().getClassIdentifier(), getExpression.getFieldName(), field.getSignature()), "get static field", getExpression.getFieldName()); } else { methodByteCodeContext.loadThis("get field", getExpression.getFieldName(), "on this"); methodByteCodeContext.addInstruction( new FieldInsnNode(GETFIELD, methodContext.getType().getClassIdentifier(), getExpression.getFieldName(), field.getSignature()), "get field", getExpression.getFieldName()); } lastExpressionType = field.getType(); } public void visit(ParameterAccessType parameterAccessType) {