KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > polyglot > ext > jl > ast > NumLit_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  * An integer literal: longs, ints, shorts, bytes, and chars.
10  */

11 public abstract class NumLit_c extends Lit_c implements NumLit
12 {
13     protected long value;
14
15     public NumLit_c(Position pos, long value) {
16     super(pos);
17     this.value = value;
18     }
19
20     /** Get the value of the expression. */
21     public long longValue() {
22     return this.value;
23     }
24
25     public void dump(CodeWriter w) {
26         super.dump(w);
27
28     w.allowBreak(4, " ");
29     w.begin(0);
30     w.write("(value " + value + ")");
31     w.end();
32     }
33 }
34
Popular Tags