01: /*
02: * $Id: ExplicitBlockStatement.java,v 1.2 2002/09/16 08:05:06 jkl Exp $
03: *
04: * Copyright (c) 2002 Njet Communications Ltd. All Rights Reserved.
05: *
06: * Use is subject to license terms, as defined in
07: * Anvil Sofware License, Version 1.1. See LICENSE
08: * file, or http://njet.org/license-1.1.txt
09: */
10: package anvil.script.statements;
11:
12: import anvil.Location;
13: import anvil.ErrorListener;
14:
15: /**
16: * class ExplicitBlockStatement
17: *
18: * @author: Jani Lehtimäki
19: */
20: public class ExplicitBlockStatement extends BlockStatement implements
21: Labeled {
22:
23: private String _label = null;
24:
25: public ExplicitBlockStatement(Statement parent, Location location) {
26: super (parent, location);
27: }
28:
29: public ExplicitBlockStatement(Statement parent, Location location,
30: String label) {
31: super (parent, location);
32: _label = label;
33: }
34:
35: public int typeOf() {
36: return Statement.ST_BLOCK;
37: }
38:
39: public String getLabel() {
40: return _label;
41: }
42:
43: public Jumps eliminate(ErrorListener context) {
44: Jumps jumps = super.eliminate(context);
45: jumps.setBlocked(jumps.isBlocked() && !jumps.hasBreak());
46: return jumps.shift();
47: }
48:
49: }
|