*** empty log message ***
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / ast / StringLiteral.java
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
7  *
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  ******************************************************************************/
11 package net.sourceforge.phpdt.internal.compiler.ast;
12
13 import test.Token;
14
15 public class StringLiteral extends Literal {
16   String source;
17
18   public StringLiteral(Token token) {
19     super(token.sourceStart,token.sourceEnd);
20     source = token.image;
21   }
22
23   /**
24    * Create a new StringLiteral
25    * @param token the token
26    * @param s sourcestart
27    * @param e sourceend
28    * @deprecated
29    */
30   public StringLiteral(final String token, final int s, final int e) {
31     super(s, e);
32     source = token;
33   }
34
35   /**
36    * Create a new StringLiteral
37    * @param token the token
38    * @param s sourcestart
39    * @param e sourceend
40    * @deprecated
41    */
42   public StringLiteral(final char[] token, final int s, final int e) {
43     this(new String(token),s, e);
44   }
45
46   public StringLiteral(final int s, final int e) {
47     super(s, e);
48   }
49   /**
50    * Return the expression as String.
51    * @return the expression
52    */
53   public String toStringExpression() {
54     return source;
55   }
56
57   /**
58    * @deprecated - use field instead
59    */
60   public int sourceEnd() {
61     return sourceEnd;
62   }
63
64   /**
65    * @deprecated - use field instead
66    */
67   public int sourceStart() {
68     return sourceStart;
69   }
70 }