/* IntegerLiteral -- Automatically generated by TreeBuilder (2024-10-27T16:47Z) */ package de.uni_freiburg.informatik.ultimate.model.acsl.ast; import java.util.List; import de.uni_freiburg.informatik.ultimate.model.acsl.ACSLNode; /** * Represents a integer literal which is a special form of a expression. */ public class IntegerLiteral extends Expression { private static final java.util.function.Predicate VALIDATOR = ACSLNode.VALIDATORS.get(IntegerLiteral.class); /** * The integer given as String. This representation is used to support * arbitrarily large numbers. We do not need to compute with them but * give them 1-1 to the decision procedure. */ String value; /** * The constructor taking initial values. * @param value the integer given as String. */ public IntegerLiteral(String value) { super(); this.value = value; assert VALIDATOR == null || VALIDATOR.test(this) : "Invalid IntegerLiteral: " + this; } /** * The constructor taking initial values. * @param type the type of this expression. * @param value the integer given as String. */ public IntegerLiteral(ACSLType type, String value) { super(type); this.value = value; assert VALIDATOR == null || VALIDATOR.test(this) : "Invalid IntegerLiteral: " + this; } /** * Returns a textual description of this object. */ public String toString() { StringBuffer sb = new StringBuffer(); sb.append("IntegerLiteral").append('['); sb.append(value); return sb.append(']').toString(); } /** * Gets the integer given as String. This representation is used to support * arbitrarily large numbers. We do not need to compute with them but * give them 1-1 to the decision procedure. * @return the integer given as String. */ public String getValue() { return value; } public List getOutgoingNodes() { List children = super.getOutgoingNodes(); return children; } public void accept(ACSLVisitor visitor) { if (visitor.visit((Expression)this)) { //visit parent types higher up if necessary } else { return; } if (visitor.visit(this)) { if(type!=null){ type.accept(visitor); } } } public Expression accept(ACSLTransformer visitor) { Expression node = visitor.transform(this); if(node != this){ return node; } ACSLType newtype = null; if(type != null){ newtype = (ACSLType)type.accept(visitor); } if(type != newtype){ return new IntegerLiteral(newtype, value); } return this; } }