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