ASTIntegerLiteral.java
package edu.udel.cis.vsl.tass.front.minimp.ast.expression;
import edu.udel.cis.vsl.tass.front.minimp.ast.type.ASTIntegerType;
import edu.udel.cis.vsl.tass.front.minimp.ast.type.ASTTypeIF;
public class ASTIntegerLiteral extends ASTLiteralExpression {
private String literalValue;
// Flag indicating whether this integer literal is actually a struct reference designator.
private boolean fromStructInit = false;
public ASTIntegerLiteral(ASTTypeIF type, String value) {
super(type);
literalValue = value;
}
public ASTIntegerLiteral(int value){
super(new ASTIntegerType());
literalValue = "" + value;
}
public ASTIntegerLiteral(String value){
super(new ASTIntegerType());
literalValue = "" + value;
}
public String getValue() {
return literalValue;
}
public void setFromStructInit(boolean value) {
this.fromStructInit = value;
}
public boolean isFromStructInit() {
return this.fromStructInit;
}
public String toString() {
return this.literalValue;
}
}