first scanner /parser copied from the jdt java version
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / impl / BooleanConstant.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.impl;
12
13 public class BooleanConstant extends Constant {
14         boolean value;
15
16         
17 public BooleanConstant(boolean value) {
18         this.value = value;
19 }
20 public boolean booleanValue() {
21         return (boolean) value;
22 }
23 public String stringValue() {
24         //spec 15.17.11
25         
26         String s = new Boolean(value).toString() ;
27         if (s == null)
28                 return "null"; //$NON-NLS-1$
29         else
30                 return s;
31 }
32 public String toString(){
33
34         return "(boolean)" + value ; } //$NON-NLS-1$
35 public int typeID() {
36         return T_boolean;
37 }
38 }