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.declaration;
12:
13: import de.uka.ilkd.key.java.JavaProgramElement;
14: import de.uka.ilkd.key.java.PrettyPrinter;
15: import de.uka.ilkd.key.java.TerminalProgramElement;
16: import de.uka.ilkd.key.java.visitor.Visitor;
17: import de.uka.ilkd.key.util.ExtList;
18:
19: /**
20: * Modifier.
21: * taken from COMPOST and changed to achieve an immutable structure
22: */
23:
24: public abstract class Modifier extends JavaProgramElement implements
25: TerminalProgramElement {
26:
27: /**
28: * Modifier.
29: */
30:
31: public Modifier() {
32: }
33:
34: /**
35: * Modifier.
36: * @param children May contain: some Comments
37: */
38: public Modifier(ExtList children) {
39: super (children);
40: }
41:
42: /**
43: * Get symbol.
44: * @return the string.
45: */
46:
47: protected abstract String getSymbol();
48:
49: /**
50: * Get symbol text.
51: * @return the symbol text.
52: */
53: public String getText() {
54: return getSymbol();
55: }
56:
57: /** calls the corresponding method of a visitor in order to
58: * perform some action/transformation on this element
59: * @param v the Visitor
60: */
61: public void visit(Visitor v) {
62: v.performActionOnModifier(this );
63: }
64:
65: public void prettyPrint(PrettyPrinter p) throws java.io.IOException {
66: p.printModifier(this);
67: }
68: }
|