KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > polyglot > ext > jl > ast > NullLit_c


1 package polyglot.ext.jl.ast;
2
3 import polyglot.ast.*;
4 import polyglot.types.*;
5 import polyglot.visit.*;
6 import polyglot.util.*;
7
8 /**
9  * The Java literal <code>null</code>.
10  */

11 public class NullLit_c extends Lit_c implements NullLit
12 {
13     public NullLit_c(Position pos) {
14     super(pos);
15     }
16
17     /** Type check the expression. */
18     public Node typeCheck(TypeChecker tc) {
19     return type(tc.typeSystem().Null());
20     }
21
22     /** Get the value of the expression, as an object. */
23     public Object JavaDoc objValue() {
24     return null;
25     }
26
27     public String JavaDoc toString() {
28     return "null";
29     }
30
31     /** Write the expression to an output file. */
32     public void prettyPrint(CodeWriter w, PrettyPrinter tr) {
33     w.write("null");
34     }
35
36     public Object JavaDoc constantValue() {
37         return null;
38     }
39 }
40
Popular Tags