From 2dc4375556432cf66a184c4541cd42053d4871af Mon Sep 17 00:00:00 2001 From: kpouer Date: Thu, 28 Aug 2003 21:37:15 +0000 Subject: [PATCH] String can contains variables --- .../phpdt/internal/compiler/ast/StringLiteral.java | 28 ++++++++++++++++++++ 1 files changed, 28 insertions(+), 0 deletions(-) diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/StringLiteral.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/StringLiteral.java index b8f3672..7ef16a1 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/StringLiteral.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/StringLiteral.java @@ -12,9 +12,13 @@ package net.sourceforge.phpdt.internal.compiler.ast; import test.Token; +import java.util.List; + public class StringLiteral extends Literal { String source; + AbstractVariable[] variablesInside; + public StringLiteral(final Token token) { super(token.sourceStart,token.sourceEnd); source = token.image; @@ -39,6 +43,22 @@ public class StringLiteral extends Literal { * @param e sourceend * @deprecated */ + public StringLiteral(final String token, + final int s, + final int e, + final AbstractVariable[] variablesInside) { + super(s, e); + source = token; + this.variablesInside = variablesInside; + } + + /** + * Create a new StringLiteral + * @param token the token + * @param s sourcestart + * @param e sourceend + * @deprecated + */ public StringLiteral(final char[] token, final int s, final int e) { this(new String(token),s, e); } @@ -67,4 +87,12 @@ public class StringLiteral extends Literal { public int sourceStart() { return sourceStart; } + + public void getUsedVariable(final List list) { + if (variablesInside != null) { + for (int i = 0; i < variablesInside.length; i++) { + variablesInside[i].getUsedVariable(list); + } + } + } } -- 1.7.1