/* AtLabelExpression -- 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 at label expression which is a special form of a expression. */ public class AtLabelExpression extends Expression { private static final java.util.function.Predicate VALIDATOR = ACSLNode.VALIDATORS.get(AtLabelExpression.class); /** * refers to the value at a certain position, determined * by the given label. */ Expression formula; /** * The label of this at label expression. */ String label; /** * The constructor taking initial values. * @param formula refers to the value at a certain position, determined * by the given label. * @param label the label of this at label expression. */ public AtLabelExpression(Expression formula, String label) { super(); this.formula = formula; this.label = label; assert VALIDATOR == null || VALIDATOR.test(this) : "Invalid AtLabelExpression: " + this; } /** * The constructor taking initial values. * @param type the type of this expression. * @param formula refers to the value at a certain position, determined * by the given label. * @param label the label of this at label expression. */ public AtLabelExpression(ACSLType type, Expression formula, String label) { super(type); this.formula = formula; this.label = label; assert VALIDATOR == null || VALIDATOR.test(this) : "Invalid AtLabelExpression: " + this; } /** * Returns a textual description of this object. */ public String toString() { StringBuffer sb = new StringBuffer(); sb.append("AtLabelExpression").append('['); sb.append(formula); sb.append(',').append(label); return sb.append(']').toString(); } /** * Gets refers to the value at a certain position, determined * by the given label. * @return refers to the value at a certain position, determined * by the given label. */ public Expression getFormula() { return formula; } /** * Gets the label of this at label expression. * @return the label of this at label expression. */ public String getLabel() { return label; } public List getOutgoingNodes() { List children = super.getOutgoingNodes(); children.add(formula); 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(formula!=null){ formula.accept(visitor); } if(type!=null){ type.accept(visitor); } } } public Expression accept(ACSLTransformer visitor) { Expression node = visitor.transform(this); if(node != this){ return node; } Expression newformula = null; if(formula != null){ newformula = (Expression)formula.accept(visitor); } ACSLType newtype = null; if(type != null){ newtype = (ACSLType)type.accept(visitor); } if(formula != newformula || type != newtype){ return new AtLabelExpression(newtype, newformula, label); } return this; } }