1
3 package jminusminus;
4
5 import static jminusminus.CLConstants.*;
6
7
10 class JLiteralLong extends JExpression {
11 private String text;
13
14
20 public JLiteralLong(int line, String text) {
21 super(line);
22 this.text = text;
23 }
24
25
30 public long toLong() {
31 return Long.parseLong(text.substring(0, text.length() - 1));
32 }
33
34
37 public JExpression analyze(Context context) {
38 return this;
40 }
41
42
45 public void codegen(CLEmitter output) {
46 }
48
49
52 public void toJSON(JSONElement json) {
53 JSONElement e = new JSONElement();
54 json.addChild("JLiteralLong:" + line, e);
55 e.addAttribute("type", type == null ? "" : type.toString());
56 e.addAttribute("value", text);
57 }
58 }
59