fix some navigation action labels
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / ast / TrueLiteral.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 2003 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials 
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v10.html
7  * 
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  *******************************************************************************/
11 package net.sourceforge.phpdt.internal.compiler.ast;
12
13 import net.sourceforge.phpdt.internal.compiler.IAbstractSyntaxTreeVisitor;
14 import net.sourceforge.phpdt.internal.compiler.impl.Constant;
15 import net.sourceforge.phpdt.internal.compiler.lookup.BlockScope;
16 import net.sourceforge.phpdt.internal.compiler.lookup.TypeBinding;
17
18
19 public class TrueLiteral extends MagicLiteral {
20         static final char[] source = {'t' , 'r' , 'u' , 'e'};
21 public TrueLiteral(int s , int e) {
22         super(s,e);
23 }
24 public void computeConstant() {
25
26         constant = Constant.fromValue(true);}
27 /**
28  * Code generation for the true literal
29  *
30  * @param currentScope net.sourceforge.phpdt.internal.compiler.lookup.BlockScope
31  * @param codeStream net.sourceforge.phpdt.internal.compiler.codegen.CodeStream
32  * @param valueRequired boolean
33  */ 
34 //public void generateCode(BlockScope currentScope, CodeStream codeStream, boolean valueRequired) {
35 //      int pc = codeStream.position;
36 //      if (valueRequired)
37 //              codeStream.iconst_1();
38 //      codeStream.recordPositionsFrom(pc, this.sourceStart);
39 //}
40 //public void generateOptimizedBoolean(BlockScope currentScope, CodeStream codeStream, Label trueLabel, Label falseLabel, boolean valueRequired) {
41 //
42 //      // trueLabel being not nil means that we will not fall through into the TRUE case
43 //
44 //      int pc = codeStream.position;
45 //      // constant == true
46 //      if (valueRequired) {
47 //              if (falseLabel == null) {
48 //                      // implicit falling through the FALSE case
49 //                      if (trueLabel != null) {
50 //                              codeStream.goto_(trueLabel);
51 //                      }
52 //              }
53 //      }
54 //      codeStream.recordPositionsFrom(pc, this.sourceStart);
55 //}
56 public TypeBinding literalType(BlockScope scope) {
57         return BooleanBinding;
58 }
59 /**
60  * 
61  */
62 public char[] source() {
63         return source;
64 }
65 public void traverse(IAbstractSyntaxTreeVisitor visitor, BlockScope scope) {
66         visitor.visit(this, scope);
67         visitor.endVisit(this, scope);
68 }
69 }