KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > polyglot > ext > jl > ast > SwitchBlock_c


1 package polyglot.ext.jl.ast;
2
3 import java.util.List JavaDoc;
4
5 import polyglot.ast.SwitchBlock;
6 import polyglot.types.Context;
7 import polyglot.util.Position;
8
9 /**
10  * A <code>SwitchBlock</code> is a list of statements within a switch.
11  */

12 public class SwitchBlock_c extends AbstractBlock_c implements SwitchBlock
13 {
14     public SwitchBlock_c(Position pos, List JavaDoc statements) {
15     super(pos, statements);
16     }
17     
18     /**
19      * A <code>SwitchBlock</code> differs from a normal block in that
20      * declarations made in the context of the switch block are in the scope
21      * following the switch block. For example
22      * <pre>
23      * switch (i) {
24      * case 0:
25      * int i = 4;
26      * case 1:
27      * // i is in scope, but may not have been initialized.
28      * ...
29      * }
30      * </pre>
31      */

32     public Context enterScope(Context c) {
33         return c;
34     }
35 }
36
Popular Tags