X-Git-Url: http://secure.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/Define.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/Define.java index ad05eb7..9669c82 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/Define.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/Define.java @@ -1,10 +1,14 @@ package net.sourceforge.phpdt.internal.compiler.ast; -import org.eclipse.jface.text.Position; -import org.eclipse.jface.resource.ImageDescriptor; +import java.util.List; + +import net.sourceforge.phpdt.internal.compiler.ast.declarations.VariableUsage; import net.sourceforge.phpdt.internal.compiler.parser.Outlineable; import net.sourceforge.phpdt.internal.ui.PHPUiImages; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.jface.text.Position; + /** * a Define. * define(expression,expression) @@ -17,11 +21,11 @@ public class Define extends Statement implements Outlineable { private Object parent; private Position position; - public Define(Object parent, - Expression defineName, - Expression defineValue, - int sourceStart, - int sourceEnd) { + public Define(final Object parent, + final Expression defineName, + final Expression defineValue, + final int sourceStart, + final int sourceEnd) { super(sourceStart, sourceEnd); this.parent = parent; this.defineName = defineName; @@ -29,10 +33,11 @@ public class Define extends Statement implements Outlineable { position = new Position(sourceStart, sourceEnd); } - public String toString(int tab) { + public String toString(final int tab) { final StringBuffer buff = new StringBuffer(tabString(tab)); buff.append("define("); buff.append(defineName.toStringExpression()); + buff.append(", "); buff.append(defineValue.toStringExpression()); buff.append(")"); return buff.toString(); @@ -56,4 +61,23 @@ public class Define extends Statement implements Outlineable { public Position getPosition() { return position; } + + /** + * Get the variables from outside (parameters, globals ...) + */ + public void getOutsideVariable(final List list) { + list.add(new VariableUsage(defineName.toStringExpression(),sourceStart));//todo: someday : evaluate the defineName + } + + /** + * get the modified variables. + */ + public void getModifiedVariable(final List list) { + } + + /** + * Get the variables used. + */ + public void getUsedVariable(final List list) { + } }