01: /*
02: * Copyright 2003 The Apache Software Foundation
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package net.sf.cglib.core;
17:
18: import org.objectweb.asm.Label;
19:
20: public class Block {
21: private CodeEmitter e;
22: private Label start;
23: private Label end;
24:
25: public Block(CodeEmitter e) {
26: this .e = e;
27: start = e.mark();
28: }
29:
30: public CodeEmitter getCodeEmitter() {
31: return e;
32: }
33:
34: public void end() {
35: if (end != null) {
36: throw new IllegalStateException("end of label already set");
37: }
38: end = e.mark();
39: }
40:
41: public Label getStart() {
42: return start;
43: }
44:
45: public Label getEnd() {
46: return end;
47: }
48: }
|