KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > polyglot > ext > jl > ast > Lit_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 import java.util.List JavaDoc;
8
9 /**
10  * <code>Lit</code> represents any Java literal.
11  */

12 public abstract class Lit_c extends Expr_c implements Lit
13 {
14     public Lit_c(Position pos) {
15     super(pos);
16     }
17
18     /** Get the precedence of the expression. */
19     public Precedence precedence() {
20         return Precedence.LITERAL;
21     }
22
23     /**
24      * Return the first (sub)term performed when evaluating this
25      * term.
26      */

27     public Term entry() {
28         return this;
29     }
30
31     /**
32      * Visit this term in evaluation order.
33      */

34     public List JavaDoc acceptCFG(CFGBuilder v, List JavaDoc succs) {
35         return succs;
36     }
37
38     public boolean isConstant() {
39     return true;
40     }
41     
42     public abstract Object JavaDoc constantValue();
43 }
44
Popular Tags