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
61 public StringLiteral(final char[] token, final int s, final int e) {
62 this(new String(token),s, e);
65 public StringLiteral(final int s, final int e) {
69 * Return the expression as String.
70 * @return the expression
72 public String toStringExpression() {
77 * @deprecated - use field instead
79 public int sourceEnd() {
84 * @deprecated - use field instead
86 public int sourceStart() {
90 public void getUsedVariable(final List list) {
91 if (variablesInside != null) {
92 for (int i = 0; i < variablesInside.length; i++) {
93 variablesInside[i].getUsedVariable(list);