/* InclusionQuery -- Automatically generated by TreeBuilder (2024-10-27T16:48Z) */ package de.uni_freiburg.informatik.ultimate.crocotta.ast; import java.util.List; /** * Represents a inclusion query which is a special form of a query. */ public class InclusionQuery extends Query { private static final long serialVersionUID = 1L; private static final java.util.function.Predicate VALIDATOR = CrocottaQuery.VALIDATORS.get(InclusionQuery.class); /** * The left of this inclusion query. */ LanguageExpression left; /** * The right of this inclusion query. */ LanguageExpression right; /** * The constructor taking initial values. * @param left the left of this inclusion query. * @param right the right of this inclusion query. */ public InclusionQuery(LanguageExpression left, LanguageExpression right) { super(); this.left = left; this.right = right; assert VALIDATOR == null || VALIDATOR.test(this) : "Invalid InclusionQuery: " + this; } /** * Returns a textual description of this object. */ public String toString() { StringBuffer sb = new StringBuffer(); sb.append("InclusionQuery").append('['); sb.append(left); sb.append(',').append(right); return sb.append(']').toString(); } /** * Gets the left of this inclusion query. * @return the left of this inclusion query. */ public LanguageExpression getLeft() { return left; } /** * Gets the right of this inclusion query. * @return the right of this inclusion query. */ public LanguageExpression getRight() { return right; } /** * Sets the right of this inclusion query. * @param right the right of this inclusion query. */ public void setRight(LanguageExpression right) { this.right = right; } public List getOutgoingNodes() { List children = super.getOutgoingNodes(); children.add(left); children.add(right); return children; } public void accept(CrocottaAstVisitor visitor) { if (visitor.visit((Query)this)) { //visit parent types higher up if necessary } else { return; } if (visitor.visit(this)) { if(left!=null){ left.accept(visitor); } if(right!=null){ right.accept(visitor); } } } public Query accept(CrocottaAstTransformer visitor) { Query node = visitor.transform(this); if(node != this){ return node; } LanguageExpression newleft = null; if(left != null){ newleft = (LanguageExpression)left.accept(visitor); } LanguageExpression newright = null; if(right != null){ newright = (LanguageExpression)right.accept(visitor); } if(left != newleft || right != newright){ return new InclusionQuery(newleft, newright); } return this; } }