@Override public void visit(GetExpression getFieldExpression) { sb.append(getFieldExpression.getFieldName()); }
public VEB get(String name) { return newValueExpressionBuilder(expressionHandler, new GetExpression(name)); }
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) {
@Override public void visit(final GetExpression getExpression) { methodByteCodeContext.incIndent("get", getExpression.getFieldName()); VarAccessType varAccessType = methodContext.getVarAccessType(getExpression.getFieldName()); varAccessType.accept(new VarAccessTypeVisitor() { public void visit(FieldAccessType fieldAccessType) {
public void visit(GetExpression getFieldExpression) { methodByteCodeContext.incIndent("if get", getFieldExpression.getFieldName()); ASMMethodGenerator.this.visit(getFieldExpression); // if (false) else then generateThenElse(IFEQ, ifStatement.getElseStatements(), ifStatement.getThenStatements()); methodByteCodeContext.decIndent(); }
@Override public void visit(LocalVariableAccessType localVariableAccessType) { // TODO: check boxing methodByteCodeContext.load( localVariableAccessType.getType(), methodByteCodeContext.getLocalVariableByteCodeIndex(localVariableAccessType.getVarIndex()), "get local variable", getExpression.getFieldName()); lastExpressionType = localVariableAccessType.getType(); } });
public void visit(ParameterAccessType parameterAccessType) { // TODO: type support // System.out.println(getExpression.getFieldName()+" "+param.getIndex()); Parameter param = parameterAccessType.getParam(); // TODO: check boxing methodByteCodeContext.load(param.getType(), methodByteCodeContext.getParamByteCodeIndex(param.getIndex()), "get param", getExpression.getFieldName()); lastExpressionType = param.getType(); } @Override