1 /*******************************************************************************
2 * Copyright (c) 2000, 2001, 2002 International Business Machines Corp. and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v0.5
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v05.html
9 * IBM Corporation - initial API and implementation
10 ******************************************************************************/
11 package net.sourceforge.phpdt.internal.compiler.ast;
13 import net.sourceforge.phpdt.internal.compiler.codegen.*;
14 import net.sourceforge.phpdt.internal.compiler.flow.*;
15 import net.sourceforge.phpdt.internal.compiler.lookup.*;
16 import net.sourceforge.phpdt.internal.compiler.problem.*;
17 import net.sourceforge.phpdt.internal.compiler.util.Util;
19 public abstract class Reference extends Expression {
21 * BaseLevelReference constructor comment.
26 public FlowInfo analyseAssignment(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo, Assignment assignment, boolean isCompound) {
27 throw new ShouldNotImplement(Util.bind("ast.variableShouldProvide")); //$NON-NLS-1$
29 public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) {
32 public FieldBinding fieldBinding() {
33 //this method should be sent one FIELD-tagged references
34 // (ref.bits & BindingIds.FIELD != 0)()
37 public void fieldStore(CodeStream codeStream, FieldBinding fieldBinding, MethodBinding syntheticWriteAccessor, boolean valueRequired) {
39 if (fieldBinding.isStatic()) {
41 if ((fieldBinding.type == LongBinding) || (fieldBinding.type == DoubleBinding)) {
47 if (syntheticWriteAccessor == null) {
48 codeStream.putstatic(fieldBinding);
50 codeStream.invokestatic(syntheticWriteAccessor);
52 } else { // Stack: [owner][new field value] ---> [new field value][owner][new field value]
54 if ((fieldBinding.type == LongBinding) || (fieldBinding.type == DoubleBinding)) {
60 if (syntheticWriteAccessor == null) {
61 codeStream.putfield(fieldBinding);
63 codeStream.invokestatic(syntheticWriteAccessor);
67 public void generateAssignment(BlockScope currentScope, CodeStream codeStream, Assignment assignment, boolean valueRequired) {
68 throw new ShouldNotImplement(Util.bind("ast.compoundPreShouldProvide")); //$NON-NLS-1$
70 public void generateCompoundAssignment(BlockScope currentScope, CodeStream codeStream, Expression expression, int operator, int assignmentImplicitConversion, boolean valueRequired) {
71 throw new ShouldNotImplement(Util.bind("ast.compoundVariableShouldProvide")); //$NON-NLS-1$
73 public void generatePostIncrement(BlockScope currentScope, CodeStream codeStream, CompoundAssignment postIncrement, boolean valueRequired) {
74 throw new ShouldNotImplement(Util.bind("ast.postIncrShouldProvide")); //$NON-NLS-1$