1 /*******************************************************************************
2 * Copyright (c) 2000, 2001, 2002 International Business Machines Corp. and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v0.5
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v05.html
9 * IBM Corporation - initial API and implementation
10 ******************************************************************************/
11 package net.sourceforge.phpdt.internal.compiler.ast;
13 import java.util.List;
17 public final class StringLiteral extends Literal {
18 private String source;
20 private AbstractVariable[] variablesInside;
22 public StringLiteral(final Token token) {
23 super(token.sourceStart,token.sourceEnd);
28 * Create a new StringLiteral
29 * @param token the token
30 * @param s sourcestart
34 public StringLiteral(final String token, final int s, final int e) {
40 * Create a new StringLiteral
41 * @param token the token
42 * @param s sourcestart
46 public StringLiteral(final String token,
49 final AbstractVariable[] variablesInside) {
52 this.variablesInside = variablesInside;
56 * Create a new StringLiteral
57 * @param token the token
58 * @param s sourcestart
62 public StringLiteral(final char[] token, final int s, final int e) {
63 this(new String(token),s, e);
66 public StringLiteral(final int s, final int e) {
70 * Return the expression as String.
71 * @return the expression
73 public String toStringExpression() {
78 * @deprecated - use field instead
80 public int sourceEnd() {
85 * @deprecated - use field instead
87 public int sourceStart() {
91 public void getUsedVariable(final List list) {
92 if (variablesInside != null) {
93 for (int i = 0; i < variablesInside.length; i++) {
94 variablesInside[i].getUsedVariable(list);