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: package de.uka.ilkd.key.java.recoderext;
12:
13: import recoder.java.Identifier;
14: import recoder.java.ProgramElement;
15: import recoder.java.SourceVisitor;
16: import recoder.java.statement.Catch;
17: import de.uka.ilkd.key.logic.op.SchemaVariable;
18:
19: public class CatchSVWrapper extends Catch implements
20: KeYRecoderExtension, SVWrapper {
21:
22: protected SchemaVariable sv;
23:
24: public CatchSVWrapper(SchemaVariable sv) {
25: this .sv = sv;
26: }
27:
28: /**
29: * sets the schema variable of sort statement
30: * @param sv the SchemaVariable
31: */
32: public void setSV(SchemaVariable sv) {
33: this .sv = sv;
34: }
35:
36: /**
37: * returns a String name of this meta construct.
38: */
39: public SchemaVariable getSV() {
40: return sv;
41: }
42:
43: public void accept(SourceVisitor v) {
44: v.visitIdentifier(new Identifier(sv.name().toString()));
45: }
46:
47: public Object deepClone() {
48: return new StatementSVWrapper(sv);
49: }
50:
51: public int getChildCount() {
52: return 0;
53: }
54:
55: public ProgramElement getChildAt(int i) {
56: throw new ArrayIndexOutOfBoundsException();
57: }
58:
59: public int getChildPositionCode(recoder.java.ProgramElement pe) {
60: throw new ArrayIndexOutOfBoundsException();
61: }
62:
63: public boolean replaceChild(recoder.java.ProgramElement p1,
64: recoder.java.ProgramElement p2) {
65: return false;
66: }
67:
68: public int getStatementCount() {
69: return 0;
70: }
71:
72: public recoder.java.Statement getStatementAt(int s) {
73: throw new ArrayIndexOutOfBoundsException();
74: }
75:
76: }
|