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.codegen;
13 import net.sourceforge.phpdt.internal.compiler.AbstractSyntaxTreeVisitorAdapter;
14 import net.sourceforge.phpdt.internal.compiler.ast.BranchStatement;
15 import net.sourceforge.phpdt.internal.compiler.ast.DoStatement;
16 import net.sourceforge.phpdt.internal.compiler.ast.ForStatement;
17 import net.sourceforge.phpdt.internal.compiler.ast.LabeledStatement;
18 import net.sourceforge.phpdt.internal.compiler.ast.SwitchStatement;
19 import net.sourceforge.phpdt.internal.compiler.ast.WhileStatement;
20 import net.sourceforge.phpdt.internal.compiler.lookup.BlockScope;
22 public class ResetStateForCodeGenerationVisitor
23 extends AbstractSyntaxTreeVisitorAdapter {
25 public boolean visit(SwitchStatement statement, BlockScope scope) {
26 statement.resetStateForCodeGeneration();
30 public boolean visit(ForStatement forStatement, BlockScope scope) {
31 forStatement.resetStateForCodeGeneration();
35 public boolean visit(WhileStatement whileStatement, BlockScope scope) {
36 whileStatement.resetStateForCodeGeneration();
40 public boolean visit(LabeledStatement labeledStatement, BlockScope scope) {
41 labeledStatement.resetStateForCodeGeneration();
45 public boolean visit(DoStatement doStatement, BlockScope scope) {
46 doStatement.resetStateForCodeGeneration();
50 public boolean visit(BranchStatement branchStatement, BlockScope scope) {
51 branchStatement.resetStateForCodeGeneration();