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.expression.literal;
12:
13: import de.uka.ilkd.key.java.PrettyPrinter;
14: import de.uka.ilkd.key.java.Services;
15: import de.uka.ilkd.key.java.abstraction.KeYJavaType;
16: import de.uka.ilkd.key.java.expression.Literal;
17: import de.uka.ilkd.key.java.visitor.Visitor;
18:
19: /**
20: * Null literal.
21: * Is used as singleton.
22: */
23:
24: public class NullLiteral extends Literal {
25:
26: public static final NullLiteral NULL = new NullLiteral();
27:
28: /**
29: * Constructor for the transformation of COMPOST ASTs to KeY.
30: */
31: private NullLiteral() {
32: super ();
33: }
34:
35: /** calls the corresponding method of a visitor in order to
36: * perform some action/transformation on this element
37: * @param v the Visitor
38: */
39: public void visit(Visitor v) {
40: v.performActionOnNullLiteral(this );
41: }
42:
43: public void prettyPrint(PrettyPrinter p) throws java.io.IOException {
44: p.printNullLiteral(this );
45: }
46:
47: public KeYJavaType getKeYJavaType(Services javaServ) {
48: return javaServ.getJavaInfo().getNullType();
49: }
50:
51: }
|