Skip to content
Snippets Groups Projects
Select Git revision
  • 5c2658813e0b83eddb3a79d3a6db27fea8c83020
  • main default protected
2 results

BinaryRelation.java

Blame
  • BinaryRelation.java 7.66 KiB
    /* This file was generated with JastAdd2 (http://jastadd.org) version 2.3.5 */
    package org.jastadd.ag.ast;
    import java.util.*;
    /**
     * @ast node
     * @declaredat E:\\project\\20211201\\src\\gen\\jastadd\\ag.ast:7
     * @astdecl BinaryRelation : Relation ::= Left:Term Right:Term;
     * @production BinaryRelation : {@link Relation} ::= <span class="component">Left:{@link Term}</span> <span class="component">Right:{@link Term}</span>;
    
     */
    public abstract class BinaryRelation extends Relation implements Cloneable {
      /**
       * @aspect ReferenceCreation
       * @declaredat E:\\project\\20211201\\src\\gen\\jastadd\\agRefResolver.jadd:75
       */
      public static BinaryRelation createRef(String ref) {
        Unresolved$Compare unresolvedNode = new Unresolved$Compare();
        unresolvedNode.setUnresolved$Token(ref);
        unresolvedNode.setUnresolved$ResolveOpposite(true);
        return unresolvedNode;
      }
      /**
       * @aspect ReferenceCreation
       * @declaredat E:\\project\\20211201\\src\\gen\\jastadd\\agRefResolver.jadd:81
       */
      public static BinaryRelation createRefDirection(String ref) {
        Unresolved$Compare unresolvedNode = new Unresolved$Compare();
        unresolvedNode.setUnresolved$Token(ref);
        unresolvedNode.setUnresolved$ResolveOpposite(false);
        return unresolvedNode;
      }
      /**
       * @aspect ResolverTrigger
       * @declaredat E:\\project\\20211201\\src\\gen\\jastadd\\agRefResolver.jadd:324
       */
      public void resolveAll() {
        super.resolveAll();
      }
      /**
       * @aspect RefResolverHelpers
       * @declaredat E:\\project\\20211201\\src\\gen\\jastadd\\agRefResolver.jadd:587
       */
      Unresolved$Node$Interface as$Unresolved() {
        return null;
      }
      /**
       * @aspect RefResolverHelpers
       * @declaredat E:\\project\\20211201\\src\\gen\\jastadd\\agRefResolver.jadd:593
       */
      boolean is$Unresolved() {
        return false;
      }
      /**
       * @declaredat ASTNode:1
       */
      public BinaryRelation() {
        super();
      }
      /**
       * Initializes the child array to the correct size.
       * Initializes List and Opt nta children.
       * @apilevel internal
       * @ast method
       * @declaredat ASTNode:10
       */
      public void init$Children() {
        children = new ASTNode[2];  getChild_handler = new ASTNode$DepGraphNode[children.length];
        state().enterConstruction();
        state().exitConstruction();
      }
      /**
       * @declaredat ASTNode:15
       */
      @ASTNodeAnnotation.Constructor(
        name = {"Left", "Right"},
        type = {"Term", "Term"},
        kind = {"Child", "Child"}
      )
      public BinaryRelation(Term p0, Term p1) {
    state().enterConstruction();
        setChild(p0, 0);
        setChild(p1, 1);
    state().exitConstruction();
      }
      /** @apilevel low-level 
       * @declaredat ASTNode:27
       */
      protected int numChildren() {
        
        state().addHandlerDepTo(numChildren_handler);
        return 2;
      }
      /**
       * @apilevel internal
       * @declaredat ASTNode:35
       */
      public boolean mayHaveRewrite() {
        return false;
      }
      /** @apilevel internal 
       * @declaredat ASTNode:39
       */
      public void flushAttrCache() {
      }
      /** @apilevel internal 
       * @declaredat ASTNode:42
       */
      public void flushCollectionCache() {
      }
      /** @apilevel internal 
       * @declaredat ASTNode:45
       */
      public BinaryRelation clone() throws CloneNotSupportedException {
        BinaryRelation node = (BinaryRelation) super.clone();
        return node;
      }
      /**
       * Create a deep copy of the AST subtree at this node.
       * The copy is dangling, i.e. has no parent.
       * @return dangling copy of the subtree at this node
       * @apilevel low-level
       * @deprecated Please use treeCopy or treeCopyNoTransform instead
       * @declaredat ASTNode:56
       */
      @Deprecated
      public abstract BinaryRelation fullCopy();
      /**
       * Create a deep copy of the AST subtree at this node.
       * The copy is dangling, i.e. has no parent.
       * @return dangling copy of the subtree at this node
       * @apilevel low-level
       * @declaredat ASTNode:64
       */
      public abstract BinaryRelation treeCopyNoTransform();
      /**
       * Create a deep copy of the AST subtree at this node.
       * The subtree of this node is traversed to trigger rewrites before copy.
       * The copy is dangling, i.e. has no parent.
       * @return dangling copy of the subtree at this node
       * @apilevel low-level
       * @declaredat ASTNode:72
       */
      public abstract BinaryRelation treeCopy();
      /** @apilevel internal 
       * @declaredat ASTNode:74
       */
      protected boolean childIsNTA(int index) {
        return super.childIsNTA(index);
      }
      /**
       * @declaredat ASTNode:77
       */
      protected void inc_copyHandlers(BinaryRelation copy) {
        super.inc_copyHandlers(copy);
    
      }
      /** @apilevel internal 
       * @declaredat ASTNode:83
       */
      public void reactToDependencyChange(String attrID, Object _parameters) {
        super.reactToDependencyChange(attrID, _parameters);
      }
      /**
       * @declaredat ASTNode:90
       */
      private boolean inc_throwAway_visited = false;
      /** @apilevel internal 
       * @declaredat ASTNode:92
       */
      public void inc_throwAway() {
      if (inc_throwAway_visited) {
        return;
      }
      inc_throwAway_visited = true;
      inc_state = inc_GARBAGE;
      super.inc_throwAway();
      inc_throwAway_visited = false;
    }
      /**
       * @declaredat ASTNode:101
       */
      private boolean inc_cleanupListeners_visited = false;
      /**
       * @declaredat ASTNode:102
       */
      public void cleanupListeners() {
      if (inc_cleanupListeners_visited) {
        return;
      }
      inc_cleanupListeners_visited = true;
      super.cleanupListeners();
      inc_cleanupListeners_visited = false;
    }
      /**
       * @declaredat ASTNode:110
       */
      private boolean inc_cleanupListenersInTree_visited = false;
      /**
       * @declaredat ASTNode:111
       */
      public void cleanupListenersInTree() {
      if (inc_cleanupListenersInTree_visited) {
        return;
      }
      inc_cleanupListenersInTree_visited = true;
      cleanupListeners();
      for (int i = 0; children != null && i < children.length; i++) {
        ASTNode child = children[i];
        if (child == null) {
          continue;
        }
        child.cleanupListenersInTree();
      }
      inc_cleanupListenersInTree_visited = false;
    }
      /**
       * Replaces the Left child.
       * @param node The new node to replace the Left child.
       * @apilevel high-level
       */
      public BinaryRelation setLeft(Term node) {
        setChild(node, 0);
        return this;
      }
      /**
       * Retrieves the Left child.
       * @return The current node used as the Left child.
       * @apilevel high-level
       */
      @ASTNodeAnnotation.Child(name="Left")
      public Term getLeft() {
        return (Term) getChild(0);
      }
      /**
       * Retrieves the Left child.
       * <p><em>This method does not invoke AST transformations.</em></p>
       * @return The current node used as the Left child.
       * @apilevel low-level
       */
      public Term getLeftNoTransform() {
        return (Term) getChildNoTransform(0);
      }
      /**
       * Replaces the Right child.
       * @param node The new node to replace the Right child.
       * @apilevel high-level
       */
      public BinaryRelation setRight(Term node) {
        setChild(node, 1);
        return this;
      }
      /**
       * Retrieves the Right child.
       * @return The current node used as the Right child.
       * @apilevel high-level
       */
      @ASTNodeAnnotation.Child(name="Right")
      public Term getRight() {
        return (Term) getChild(1);
      }
      /**
       * Retrieves the Right child.
       * <p><em>This method does not invoke AST transformations.</em></p>
       * @return The current node used as the Right child.
       * @apilevel low-level
       */
      public Term getRightNoTransform() {
        return (Term) getChildNoTransform(1);
      }
      /** @apilevel internal */
      public ASTNode rewriteTo() {
        return super.rewriteTo();
      }
      /** @apilevel internal */
      public boolean canRewrite() {
        return false;
      }
    
    }