IR
[repair.git] / Repair / RepairCompiler / MCC / IR / IntegerLiteralExpr.java
1 package MCC.IR;
2
3 public class IntegerLiteralExpr extends LiteralExpr {
4
5     int value;
6
7     public IntegerLiteralExpr(int value) {
8         this.value = value; 
9         td = ReservedTypeDescriptor.INT;
10     }
11
12     public int getValue() {
13         return value;
14     }
15
16     public void generate(CodeWriter writer, VarDescriptor dest) {
17         writer.outputline("int " + dest.getSafeSymbol() + " = " + value + ";");
18     }
19
20     public void prettyPrint(PrettyPrinter pp) {
21         pp.output("" + value);
22     }
23
24     public TypeDescriptor typecheck(SemanticAnalyzer sa) {
25         td = ReservedTypeDescriptor.INT;
26         return td;
27     }
28
29 }