Skip to content
Snippets Groups Projects

Resolve "Feature: Add context-free connect"

Merged René Schöne requested to merge 34-feature-add-context-free-connect into dev

Closes #34 (closed)

Edited by René Schöne

Merge request reports

Pipeline #12153 passed

Pipeline passed for 40f351b8 on 34-feature-add-context-free-connect

Approval is optional

Merged by René SchöneRené Schöne 3 years ago (Dec 8, 2021 3:18pm UTC)

Merge details

  • Changes merged into dev with 1fedb9cf (commits were squashed).
  • Deleted the source branch.
  • Auto-merge enabled

Pipeline #12154 passed

Pipeline: RagConnect Dev Pages

#12156

    Pipeline passed for 1fedb9cf on dev

    Activity

    Filter activity
    • Approvals
    • Assignees & reviewers
    • Comments (from bots)
    • Comments (from users)
    • Commits & branches
    • Edits
    • Labels
    • Lock status
    • Mentions
    • Merge request status
    • Tracking
    • René Schöne changed milestone to %1.0.0

      changed milestone to %1.0.0

    • assigned to @rschoene

    • René Schöne added 1 commit

      added 1 commit

      • 1f707942 - working on context-free connect

      Compare with previous version

    • Manual version of aspect to be generated:

      // to be generated
      aspect ToBeGeneratedShared {
        inh ASTNode A.myParent();
        eq Root.getA().myParent() = this;
        eq Root.getSingleA().myParent() = this;
        eq Root.getOptA().myParent() = this;
        eq Root.getListA().myParent() = this;
      
        uncache A.myIndexInList();
        inh int A.myIndexInList();
        eq Root.getA().myIndexInList() = -1;
        eq Root.getSingleA().myIndexInList() = -1;
        eq Root.getOptA().myIndexInList() = -1;
        eq Root.getListA(int i).myIndexInList() = i;
      }
      aspect ToBeGeneratedVersion1 {
        inh String A.myContext();
        eq Root.getA().myContext() = "A";
        eq Root.getSingleA().myContext() = "SingleA";
        eq Root.getOptA().myContext() = "OptA";
        eq Root.getListA().myContext() = "ListA";
      
        inh String A.myParentName();
        eq Root.getA().myParentName() = "Root";
        eq Root.getSingleA().myParentName() = "Root";
        eq Root.getOptA().myParentName() = "Root";
        eq Root.getListA().myParentName() = "Root";
      
        public boolean A.myConnect(String uri) throws java.io.IOException {
          switch (myParentName()) {
            case "Root":
              switch (myContext()) {
                case "A": return ((Root) myParent()).connectA(uri);
                case "SingleA": return ((Root) myParent()).connectSingleA(uri);
                case "OptA": return ((Root) myParent()).connectOptA(uri);
                case "ListA": return ((Root) myParent()).connectListA(uri, myIndexInList());
                default:
                  System.err.println("No matching context for " + this + " in Root");
                  return false;
              }
            default:
              System.err.println("No matching parent for " + this);
              return false;
          }
        }
      
      }
      aspect ToBeGeneratedVersion2 {
        uncache A.alternative_myContext();
        inh String A.alternative_myContext();
        eq Root.getA().alternative_myContext() = "Root.A";
        eq Root.getSingleA().alternative_myContext() = "Root.SingleA";
        eq Root.getOptA().alternative_myContext() = "Root.OptA";
        eq Root.getListA().alternative_myContext() = "Root.ListA";
      
        public boolean A.alternative_myConnect(String uri) throws java.io.IOException {
          switch (alternative_myContext()) {
            case "Root.A": return ((Root) myParent()).connectA(uri);
            case "Root.SingleA": return ((Root) myParent()).connectSingleA(uri);
            case "Root.OptA": return ((Root) myParent()).connectOptA(uri);
            case "Root.ListA": return ((Root) myParent()).connectListA(uri, myIndexInList());
            default:
              System.err.println("No matching context while connecting " + this + " to " + uri);
              return false;
          }
        }
      
        public boolean A.alternative_myDisconnect(String uri) throws java.io.IOException {
          switch (alternative_myContext()) {
            case "Root.A": return ((Root) myParent()).disconnectA(uri);
            case "Root.SingleA": return ((Root) myParent()).disconnectSingleA(uri);
            case "Root.OptA": return ((Root) myParent()).disconnectOptA(uri);
            case "Root.ListA": return ((Root) myParent()).disconnectListA(uri);
            default:
              System.err.println("No matching context while disconnecting for " + this + " from " + uri);
              return false;
          }
        }
      
      }
      
    • René Schöne added 1 commit

      added 1 commit

      • 40f351b8 - working on context-free connect

      Compare with previous version

    • René Schöne marked this merge request as ready

      marked this merge request as ready

    • René Schöne enabled an automatic merge when the pipeline for 40f351b8 succeeds

      enabled an automatic merge when the pipeline for 40f351b8 succeeds

    • merged

    • René Schöne mentioned in commit 1fedb9cf

      mentioned in commit 1fedb9cf

    Please register or sign in to reply
    Loading