/* Case -- 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 case. */ public class Case extends ACSLNode { private static final java.util.function.Predicate VALIDATOR = ACSLNode.VALIDATORS.get(Case.class); /** * The poly id of this case. */ PolyIdentifier polyId; /** * The formula of this case. */ Expression formula; /** * The constructor taking initial values. * @param polyId the poly id of this case. * @param formula the formula of this case. */ public Case(PolyIdentifier polyId, Expression formula) { super(); this.polyId = polyId; this.formula = formula; assert VALIDATOR == null || VALIDATOR.test(this) : "Invalid Case: " + this; } /** * Returns a textual description of this object. */ public String toString() { StringBuffer sb = new StringBuffer(); sb.append("Case").append('['); sb.append(polyId); sb.append(',').append(formula); return sb.append(']').toString(); } /** * Gets the poly id of this case. * @return the poly id of this case. */ public PolyIdentifier getPolyId() { return polyId; } /** * Gets the formula of this case. * @return the formula of this case. */ public Expression getFormula() { return formula; } public List getOutgoingNodes() { List children = super.getOutgoingNodes(); children.add(polyId); children.add(formula); return children; } public void accept(ACSLVisitor visitor) { if (visitor.visit(this)) { if(polyId!=null){ polyId.accept(visitor); } if(formula!=null){ formula.accept(visitor); } } } public Case accept(ACSLTransformer visitor) { Case node = visitor.transform(this); if(node != this){ return node; } PolyIdentifier newpolyId = null; if(polyId != null){ newpolyId = (PolyIdentifier)polyId.accept(visitor); } Expression newformula = null; if(formula != null){ newformula = (Expression)formula.accept(visitor); } if(polyId != newpolyId || formula != newformula){ return new Case(newpolyId, newformula); } return this; } }