Beispiel #1
0
  @Override
  public boolean equals(Object object) {
    if (this == object) {
      return true;
    }

    if (!(object instanceof CellCollection)) {
      return false;
    }

    CellCollection collection = (CellCollection) object;
    return collectionVariables.equals(collection.collectionVariables)
        && values().equals(collection.values());
  }
Beispiel #2
0
 @Override
 public void visit(CellCollection cellCollection) {
   for (Cell cell : cellCollection.cells()) {
     cell.accept(this);
   }
   visit((Collection) cellCollection);
 }
 @Override
 public ASTNode visit(org.kframework.kil.Cell node, Void _void) {
   return CellCollection.singleton(
       CellLabel.of(node.getLabel()),
       (Term) this.visitNode(node.getContents()),
       null,
       globalContext.getDefinition());
 }
  @Override
  public ASTNode visit(org.kframework.kil.Bag node, Void _void) {
    List<org.kframework.kil.Term> contents = new ArrayList<>();
    org.kframework.kil.Bag.flatten(contents, node.getContents());

    CellCollection.Builder builder = CellCollection.builder(null, globalContext.getDefinition());
    for (org.kframework.kil.Term term : contents) {
      if (term instanceof TermComment) {
        continue;
      }
      builder.concatenate((Term) this.visitNode(term));
    }

    return builder.build();
  }