Added default preferences for outline options
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / ast / Statement.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 net.sourceforge.phpdt.internal.compiler.impl.*;
14 import net.sourceforge.phpdt.internal.compiler.codegen.*;
15 import net.sourceforge.phpdt.internal.compiler.flow.*;
16 import net.sourceforge.phpdt.internal.compiler.lookup.*;
17 import net.sourceforge.phpdt.internal.compiler.problem.*;
18 import net.sourceforge.phpdt.internal.compiler.util.Util;
19
20 public abstract class Statement extends AstNode {
21         
22         /**
23          * Statement constructor comment.
24          */
25         public Statement() {
26                 super();
27         }
28         
29         public FlowInfo analyseCode(
30                 BlockScope currentScope,
31                 FlowContext flowContext,
32                 FlowInfo flowInfo) {
33                 return flowInfo;
34         }
35         
36         public void generateCode(BlockScope currentScope, CodeStream codeStream) {
37                 throw new ShouldNotImplement(Util.bind("ast.missingStatement")); //$NON-NLS-1$
38         }
39         
40         public boolean isEmptyBlock() {
41                 return false;
42         }
43         
44         public boolean isValidJavaStatement() {
45                 //the use of this method should be avoid in most cases
46                 //and is here mostly for documentation purpose.....
47                 //while the parser is responsable for creating
48                 //welled formed expression statement, which results
49                 //in the fact that java-non-semantic-expression-used-as-statement
50                 //should not be parsable...thus not being built.
51                 //It sounds like the java grammar as help the compiler job in removing
52                 //-by construction- some statement that would have no effect....
53                 //(for example all expression that may do side-effects are valid statement
54                 // -this is an appromative idea.....-)
55
56                 return true;
57         }
58         
59         public void resolve(BlockScope scope) {
60         }
61         
62         public Constant resolveCase(
63                 BlockScope scope,
64                 TypeBinding testType,
65                 SwitchStatement switchStatement) {
66                 // statement within a switch that are not case are treated as normal statement.... 
67
68                 resolve(scope);
69                 return null;
70         }
71         
72         public void resetStateForCodeGeneration() {
73         }
74         
75         /**
76          * INTERNAL USE ONLY.
77          * Do nothing by default. This is used to redirect inter-statements jumps.
78          */
79         public void branchChainTo(Label label) {
80         }
81 }