1
3 package jminusminus;
4
5 import static jminusminus.CLConstants.*;
6
7
10 class JLiteralNull extends JExpression {
11
16 public JLiteralNull(int line) {
17 super(line);
18 }
19
20
23 public JExpression analyze(Context context) {
24 type = Type.NULLTYPE;
25 return this;
26 }
27
28
31 public void codegen(CLEmitter output) {
32 output.addNoArgInstruction(ACONST_NULL);
33 }
34
35
38 public void toJSON(JSONElement json) {
39 JSONElement e = new JSONElement();
40 json.addChild("JLiteralNull:" + line, e);
41 e.addAttribute("type", type == null ? "" : type.toString());
42 e.addAttribute("value", "null");
43 }
44 }
45