The methods to get variables do not instantiate ArrayList each time, only one is...
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / ast / BinaryExpression.java
1 package net.sourceforge.phpdt.internal.compiler.ast;
2
3 import java.util.List;
4 import java.util.ArrayList;
5
6 /**
7  * @author Matthieu Casanova
8  */
9 public class BinaryExpression extends OperatorExpression {
10
11   /** The two expressions. */
12   public Expression left,right;
13
14   public BinaryExpression(final Expression left,
15                           final Expression right,
16                           final int operator) {
17     super(operator, left.sourceStart, right.sourceEnd);
18     this.left = left;
19     this.right = right;
20   }
21
22   public String toStringExpression() {
23     final StringBuffer buff = new StringBuffer(left.toStringExpression());
24     buff.append(operatorToString());
25     buff.append(right.toStringExpression());
26     return buff.toString();
27   }
28
29   /**
30    * Get the variables from outside (parameters, globals ...)
31    */
32   public void getOutsideVariable(final List list) {
33   }
34
35   /**
36    * get the modified variables.
37    */
38   public void getModifiedVariable(final List list) {
39     left.getModifiedVariable(list);
40     right.getModifiedVariable(list);
41   }
42
43   /**
44    * Get the variables used.
45    */
46   public void getUsedVariable(final List list) {
47     left.getUsedVariable(list);
48     right.getUsedVariable(list);
49   }
50
51 }