*** empty log message ***
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / ast / VariableDeclaration.java
index 4ba1ba5..17a6e39 100644 (file)
@@ -1,7 +1,5 @@
 package net.sourceforge.phpdt.internal.compiler.ast;
 
-import net.sourceforge.phpdt.internal.compiler.ast.Expression;
-import net.sourceforge.phpdt.internal.compiler.ast.AbstractVariableDeclaration;
 import net.sourceforge.phpdt.internal.compiler.parser.Outlineable;
 import net.sourceforge.phpdt.internal.ui.PHPUiImages;
 import org.eclipse.jface.resource.ImageDescriptor;
@@ -33,6 +31,19 @@ public class VariableDeclaration extends AbstractVariableDeclaration implements
     this.parent = parent;
   }
 
+  /**
+   * Create a variable.
+   * @param name the name of the variable
+   * @param sourceStart the start point
+   */
+  public VariableDeclaration(Object parent,
+                             char[] name,
+                             int sourceStart,
+                             int sourceEnd) {
+    super(name, sourceStart, sourceEnd);
+    this.parent = parent;
+  }
+
   public void setReference(boolean reference) {
     this.reference = reference;
   }
@@ -49,6 +60,17 @@ public class VariableDeclaration extends AbstractVariableDeclaration implements
     super(name, sourceStart, initialization.sourceEnd);
     this.initialization = initialization;
   }
+
+  /**
+   * Create a variable.
+   * @param name the name of the variable
+   * @param sourceStart the start point
+   */
+  public VariableDeclaration(char[] name,
+                             int sourceStart) {
+    super(name, sourceStart, sourceStart + name.length);
+  }
+
   /**
    * Return the variable into String.
    * @return a String
@@ -56,9 +78,9 @@ public class VariableDeclaration extends AbstractVariableDeclaration implements
   public String toStringExpression() {
     final StringBuffer buff;
     if (reference) {
-      buff = new StringBuffer('&');
+      buff = new StringBuffer("&$"); //$NON-NLS-1$
     } else {
-      buff = new StringBuffer();
+      buff = new StringBuffer("$");//$NON-NLS-1$
     }
     buff.append(name);
     if (initialization != null) {