/* BitvecLiteral -- 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 bitvec literal which is a special form of a expression. */ public class BitvecLiteral extends Expression { private static final java.util.function.Predicate VALIDATOR = ACSLNode.VALIDATORS.get(BitvecLiteral.class); /** * The value 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 number of bits in this bitvector. */ int length; /** * The constructor taking initial values. * @param value the value given as String. * @param length the number of bits in this bitvector. */ public BitvecLiteral(String value, int length) { super(); this.value = value; this.length = length; assert VALIDATOR == null || VALIDATOR.test(this) : "Invalid BitvecLiteral: " + this; } /** * The constructor taking initial values. * @param type the type of this expression. * @param value the value given as String. * @param length the number of bits in this bitvector. */ public BitvecLiteral(ACSLType type, String value, int length) { super(type); this.value = value; this.length = length; assert VALIDATOR == null || VALIDATOR.test(this) : "Invalid BitvecLiteral: " + this; } /** * Returns a textual description of this object. */ public String toString() { StringBuffer sb = new StringBuffer(); sb.append("BitvecLiteral").append('['); sb.append(value); sb.append(',').append(length); return sb.append(']').toString(); } /** * Gets the value 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 value given as String. */ public String getValue() { return value; } /** * Gets the number of bits in this bitvector. * @return the number of bits in this bitvector. */ public int getLength() { return length; } 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 BitvecLiteral(newtype, value, length); } return this; } }