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.statement;
12:
13: import de.uka.ilkd.key.java.Expression;
14: import de.uka.ilkd.key.java.PrettyPrinter;
15: import de.uka.ilkd.key.java.visitor.Visitor;
16: import de.uka.ilkd.key.util.ExtList;
17:
18: /**
19: * Throw.
20: */
21:
22: public class Throw extends ExpressionJumpStatement {
23:
24: /**
25: * Throw.
26: */
27:
28: public Throw() {
29: }
30:
31: /**
32: * Throw.
33: * @param expr an expression.
34: */
35:
36: public Throw(Expression expr) {
37: super (expr);
38: if (expr == null) {
39: throw new IllegalArgumentException(
40: "Throw requires one argument");
41: }
42: }
43:
44: /**
45: * Throw.
46: * @param children an ExtList with all children
47: */
48:
49: public Throw(ExtList children) {
50: super (children);
51: }
52:
53: /** calls the corresponding method of a visitor in order to
54: * perform some action/transformation on this element
55: * @param v the Visitor
56: */
57: public void visit(Visitor v) {
58: v.performActionOnThrow(this );
59: }
60:
61: public void prettyPrint(PrettyPrinter p) throws java.io.IOException {
62: p.printThrow(this);
63: }
64: }
|