/* GhostUpdate -- 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 ghost update which is a special form of a code statement. */ public class GhostUpdate extends CodeStatement { private static final java.util.function.Predicate VALIDATOR = ACSLNode.VALIDATORS.get(GhostUpdate.class); /** * The identifier of this ghost update. */ String identifier; /** * The expr of this ghost update. */ Expression expr; /** * The constructor taking initial values. * @param identifier the identifier of this ghost update. * @param expr the expr of this ghost update. */ public GhostUpdate(String identifier, Expression expr) { super(); this.identifier = identifier; this.expr = expr; assert VALIDATOR == null || VALIDATOR.test(this) : "Invalid GhostUpdate: " + this; } /** * Returns a textual description of this object. */ public String toString() { StringBuffer sb = new StringBuffer(); sb.append("GhostUpdate").append('['); sb.append(identifier); sb.append(',').append(expr); return sb.append(']').toString(); } /** * Gets the identifier of this ghost update. * @return the identifier of this ghost update. */ public String getIdentifier() { return identifier; } /** * Gets the expr of this ghost update. * @return the expr of this ghost update. */ public Expression getExpr() { return expr; } public List getOutgoingNodes() { List children = super.getOutgoingNodes(); children.add(expr); return children; } public void accept(ACSLVisitor visitor) { if (visitor.visit((CodeStatement)this)) { //visit parent types higher up if necessary } else { return; } if (visitor.visit(this)) { if(expr!=null){ expr.accept(visitor); } } } public CodeStatement accept(ACSLTransformer visitor) { CodeStatement node = visitor.transform(this); if(node != this){ return node; } Expression newexpr = null; if(expr != null){ newexpr = (Expression)expr.accept(visitor); } if(expr != newexpr){ return new GhostUpdate(identifier, newexpr); } return this; } }