First try for AST structure. A lot of things to change
[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   /**
19    * Return the expression as String.
20    * @return the expression
21    */
22   public String toStringExpression() {
23     final StringBuffer buff = new StringBuffer();
24     buff.append(key.toStringExpression());
25     if (value != null) {
26       buff.append(" => ");
27       buff.append(value.toStringExpression());
28     }
29     return buff.toString();
30   }
31 }