01: // This file is part of KeY - Integrated Deductive Software Design
02: // Copyright (C) 2001-2007 Universitaet Karlsruhe, Germany
03: // Universitaet Koblenz-Landau, Germany
04: // Chalmers University of Technology, Sweden
05: //
06: // The KeY system is protected by the GNU General Public License.
07: // See LICENSE.TXT for details.
08: //
09: //
10:
11: // This file is taken from the RECODER library, which is protected by the LGPL,
12: // and modified.
13:
14: package de.uka.ilkd.key.java.recoderext;
15:
16: import recoder.java.StatementBlock;
17: import recoder.list.StatementMutableList;
18:
19: /**
20: Statement block.
21: @author AL
22: @author <TT>AutoDoc</TT>
23: */
24:
25: public class ContextStatementBlock extends StatementBlock implements
26: KeYRecoderExtension {
27:
28: private ExecutionContext ec;
29:
30: /**
31: Statement block.
32: */
33: public ContextStatementBlock() {
34: }
35:
36: /**
37: Statement block.
38: */
39: public ContextStatementBlock(TypeSVWrapper tr,
40: ExpressionSVWrapper runtime) {
41: this (tr != null ? new ExecutionContext(tr, runtime) : null);
42: }
43:
44: /**
45: Statement block.
46: */
47: public ContextStatementBlock(ExecutionContext ec) {
48: this .ec = ec;
49: }
50:
51: /**
52: Statement block.
53: @param block a statement mutable list.
54: */
55: public ContextStatementBlock(TypeSVWrapper tr,
56: ExpressionSVWrapper runtime, StatementMutableList block) {
57: super (block);
58: if (tr != null) {
59: this .ec = new ExecutionContext(tr, runtime);
60: } else {
61: this .ec = null;
62: }
63: }
64:
65: /**
66: Statement block.
67: @param proto a statement block.
68: */
69:
70: protected ContextStatementBlock(ContextStatementBlock proto) {
71: super (proto);
72: this .ec = proto.getExecutionContext();
73: }
74:
75: public TypeSVWrapper getClassContext() {
76: return (TypeSVWrapper) ec.getTypeReference();
77: }
78:
79: public ExpressionSVWrapper getRuntimeInstance() {
80: return (ExpressionSVWrapper) ec.getRuntimeInstance();
81: }
82:
83: public ExecutionContext getExecutionContext() {
84: return ec;
85: }
86:
87: }
|