*** empty log message ***
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / ast / ArrayVariableDeclaration.java
1 package net.sourceforge.phpdt.internal.compiler.ast;
2
3 /**
4  * This variable declaration do not extend AbstractVariableDeclaration because
5  * it could take Expression as key.
6  * @author Matthieu Casanova
7  */
8 public class ArrayVariableDeclaration extends Expression {
9
10   public Expression key,value;
11
12   public ArrayVariableDeclaration(Expression key,Expression value) {
13     super(key.sourceStart, value.sourceEnd);
14     this.key = key;
15     this.value = value;
16   }
17
18   public ArrayVariableDeclaration(Expression key,int sourceEnd) {
19     super(key.sourceStart, sourceEnd);
20     this.key = key;
21   }
22   /**
23    * Return the expression as String.
24    * @return the expression
25    */
26   public String toStringExpression() {
27     final StringBuffer buff = new StringBuffer();
28     buff.append(key.toStringExpression());
29     if (value != null) {
30       buff.append(" => ");
31       buff.append(value.toStringExpression());
32     }
33     return buff.toString();
34   }
35 }