X-Git-Url: http://secure.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/Variable.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/Variable.java new file mode 100644 index 0000000..a6d027a --- /dev/null +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/Variable.java @@ -0,0 +1,59 @@ +package net.sourceforge.phpdt.internal.compiler.ast; + +import net.sourceforge.phpdt.internal.compiler.ast.declarations.VariableUsage; + +import java.util.List; +import java.util.ArrayList; + +/** + * @author Matthieu Casanova + */ +public class Variable extends Expression { + + /** The name of the variable. */ + public char[] name; + + + public Variable(final char[] name, final int sourceStart, final int sourceEnd) { + super(sourceStart, sourceEnd); + this.name = name; + } + + /** + * Return the expression as String. + * @return the expression + */ + public String toStringExpression() { + return "$"+new String(name); + } + + public String getName() { + return new String(name); + } + + /** + * Get the variables from outside (parameters, globals ...) + * @return the variables from outside + */ + public List getOutsideVariable() { + return new ArrayList(1); + } + + /** + * get the modified variables. + * @return the variables modified + */ + public List getModifiedVariable() { + final ArrayList list = new ArrayList(1); + list.add(new VariableUsage(getName(),sourceStart)); + return list; + } + + /** + * Get the variables used. + * @return the variables used + */ + public List getUsedVariable() { + return new ArrayList(1); + } +}