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 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;
20 public abstract class Statement extends AstNode {
23 * Statement constructor comment.
29 public FlowInfo analyseCode(
30 BlockScope currentScope,
31 FlowContext flowContext,
36 public void generateCode(BlockScope currentScope, CodeStream codeStream) {
37 throw new ShouldNotImplement(Util.bind("ast.missingStatement")); //$NON-NLS-1$
40 public boolean isEmptyBlock() {
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.....-)
59 public void resolve(BlockScope scope) {
62 public Constant resolveCase(
65 SwitchStatement switchStatement) {
66 // statement within a switch that are not case are treated as normal statement....
72 public void resetStateForCodeGeneration() {
77 * Do nothing by default. This is used to redirect inter-statements jumps.
79 public void branchChainTo(Label label) {