1 /*******************************************************************************
2 * Copyright (c) 2000, 2004 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v10.html
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package org.eclipse.jdt.internal.compiler.ast;
13 import org.eclipse.jdt.internal.compiler.codegen.*;
14 import org.eclipse.jdt.internal.compiler.flow.*;
15 import org.eclipse.jdt.internal.compiler.lookup.*;
17 public abstract class Reference extends Expression {
19 * BaseLevelReference constructor comment.
24 public abstract FlowInfo analyseAssignment(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo, Assignment assignment, boolean isCompound);
26 public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) {
29 public FieldBinding fieldBinding() {
30 //this method should be sent one FIELD-tagged references
31 // (ref.bits & BindingIds.FIELD != 0)()
34 public void fieldStore(CodeStream codeStream, FieldBinding fieldBinding, MethodBinding syntheticWriteAccessor, boolean valueRequired) {
36 if (fieldBinding.isStatic()) {
38 if ((fieldBinding.type == LongBinding) || (fieldBinding.type == DoubleBinding)) {
44 if (syntheticWriteAccessor == null) {
45 codeStream.putstatic(fieldBinding);
47 codeStream.invokestatic(syntheticWriteAccessor);
49 } else { // Stack: [owner][new field value] ---> [new field value][owner][new field value]
51 if ((fieldBinding.type == LongBinding) || (fieldBinding.type == DoubleBinding)) {
57 if (syntheticWriteAccessor == null) {
58 codeStream.putfield(fieldBinding);
60 codeStream.invokestatic(syntheticWriteAccessor);
64 public abstract void generateAssignment(BlockScope currentScope, CodeStream codeStream, Assignment assignment, boolean valueRequired);
66 public abstract void generateCompoundAssignment(BlockScope currentScope, CodeStream codeStream, Expression expression, int operator, int assignmentImplicitConversion, boolean valueRequired);
68 public abstract void generatePostIncrement(BlockScope currentScope, CodeStream codeStream, CompoundAssignment postIncrement, boolean valueRequired);