/* Expression -- 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; /** * This node represents an expression. * This base class is almost empty, the sub classes contain the possible types. * TODO: These are all Boogie Expressions, need to finish this for ACSL. */ public abstract class Expression extends ACSLNode { private static final java.util.function.Predicate VALIDATOR = ACSLNode.VALIDATORS.get(Expression.class); /** * The type of this expression. This is set by the type-checker. */ ACSLType type; /** * The constructor taking initial values. */ public Expression() { super(); assert VALIDATOR == null || VALIDATOR.test(this) : "Invalid Expression: " + this; } /** * The constructor taking initial values. * @param type the type of this expression. */ public Expression(ACSLType type) { super(); this.type = type; assert VALIDATOR == null || VALIDATOR.test(this) : "Invalid Expression: " + this; } /** * Returns a textual description of this object. */ public String toString() { StringBuffer sb = new StringBuffer(); sb.append("Expression").append('['); sb.append(type); return sb.append(']').toString(); } /** * Gets the type of this expression. This is set by the type-checker. * @return the type of this expression. */ public ACSLType getType() { return type; } /** * Sets the type of this expression. This is set by the type-checker. * @param type the type of this expression. */ public void setType(ACSLType type) { this.type = type; } public List getOutgoingNodes() { List children = super.getOutgoingNodes(); children.add(type); return children; } public abstract void accept(ACSLVisitor visitor); public abstract Expression accept(ACSLTransformer visitor); }