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