1 11 package org.eclipse.jdt.internal.compiler.ast; 12 13 import org.eclipse.jdt.internal.compiler.codegen.*; 14 import org.eclipse.jdt.internal.compiler.flow.*; 15 import org.eclipse.jdt.internal.compiler.lookup.*; 16 17 public abstract class Reference extends Expression { 18 21 public Reference() { 22 super(); 23 } 24 public abstract FlowInfo analyseAssignment(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo, Assignment assignment, boolean isCompound); 25 26 public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) { 27 return flowInfo; 28 } 29 public FieldBinding fieldBinding() { 30 return null ; 33 } 34 public void fieldStore(CodeStream codeStream, FieldBinding fieldBinding, MethodBinding syntheticWriteAccessor, boolean valueRequired) { 35 int pc = codeStream.position; 36 if (fieldBinding.isStatic()) { 37 if (valueRequired) { 38 if ((fieldBinding.type == TypeBinding.LONG) || (fieldBinding.type == TypeBinding.DOUBLE)) { 39 codeStream.dup2(); 40 } else { 41 codeStream.dup(); 42 } 43 } 44 if (syntheticWriteAccessor == null) { 45 codeStream.putstatic(fieldBinding); 46 } else { 47 codeStream.invokestatic(syntheticWriteAccessor); 48 } 49 } else { if (valueRequired) { 51 if ((fieldBinding.type == TypeBinding.LONG) || (fieldBinding.type == TypeBinding.DOUBLE)) { 52 codeStream.dup2_x1(); 53 } else { 54 codeStream.dup_x1(); 55 } 56 } 57 if (syntheticWriteAccessor == null) { 58 codeStream.putfield(fieldBinding); 59 } else { 60 codeStream.invokestatic(syntheticWriteAccessor); 61 } 62 } 63 codeStream.recordPositionsFrom(pc, this.sourceStart); 64 } 65 public abstract void generateAssignment(BlockScope currentScope, CodeStream codeStream, Assignment assignment, boolean valueRequired); 66 67 public abstract void generateCompoundAssignment(BlockScope currentScope, CodeStream codeStream, Expression expression, int operator, int assignmentImplicitConversion, boolean valueRequired); 68 69 public abstract void generatePostIncrement(BlockScope currentScope, CodeStream codeStream, CompoundAssignment postIncrement, boolean valueRequired); 70 } 71 | Popular Tags |