Patches from user robekras to show the variables view
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / internal / compiler / ast / FieldReference.java
index 6a384f5..e0b1c96 100644 (file)
@@ -10,7 +10,7 @@
  *******************************************************************************/
 package net.sourceforge.phpeclipse.internal.compiler.ast;
 
-import net.sourceforge.phpdt.internal.compiler.IAbstractSyntaxTreeVisitor;
+import net.sourceforge.phpdt.internal.compiler.ASTVisitor;
 import net.sourceforge.phpdt.internal.compiler.flow.FlowContext;
 import net.sourceforge.phpdt.internal.compiler.flow.FlowInfo;
 import net.sourceforge.phpdt.internal.compiler.impl.Constant;
@@ -38,8 +38,10 @@ public class FieldReference extends Reference implements InvocationSite {
                token = source;
                nameSourcePosition = pos;
                //by default the position are the one of the field (not true for super access)
-               sourceStart = (int) (pos >>> 32);
-               sourceEnd = (int) (pos & 0x00000000FFFFFFFFL);
+//             sourceStart = (int) (pos >>> 32);
+//             sourceEnd = (int) (pos & 0x00000000FFFFFFFFL);
+               sourceStart = (int) pos;
+               sourceEnd = sourceStart + source.length;
                bits |= BindingIds.FIELD;
 
        }
@@ -150,8 +152,8 @@ public class FieldReference extends Reference implements InvocationSite {
        /**
         * Field reference code generation
         *
-        * @param currentScope org.eclipse.jdt.internal.compiler.lookup.BlockScope
-        * @param codeStream org.eclipse.jdt.internal.compiler.codegen.CodeStream
+        * @param currentScope net.sourceforge.phpdt.internal.compiler.lookup.BlockScope
+        * @param codeStream net.sourceforge.phpdt.internal.compiler.codegen.CodeStream
         * @param valueRequired boolean
         */
 //     public void generateCode(
@@ -535,14 +537,17 @@ public class FieldReference extends Reference implements InvocationSite {
        public void setFieldIndex(int index) {
                // ignored
        }
+       public StringBuffer printExpression(int indent, StringBuffer output) {
 
+               return receiver.printExpression(0, output).append('.').append(token);
+       }
        public String toStringExpression() {
 
                return receiver.toString() + "." //$NON-NLS-1$
                + new String(token);
        }
 
-       public void traverse(IAbstractSyntaxTreeVisitor visitor, BlockScope scope) {
+       public void traverse(ASTVisitor visitor, BlockScope scope) {
 
                if (visitor.visit(this, scope)) {
                        receiver.traverse(visitor, scope);