class CommunitySetExprToBDD implements CommunitySetExprVisitor<BDD, Arg> {

  @Override
  public BDD visitCommunitySetExprReference(
      CommunitySetExprReference communitySetExprReference, Arg arg) {
    String name = communitySetExprReference.getName();
    CommunitySetExpr expr =
        arg.getTransferBDD().getConfiguration().getCommunitySetExprs().get(name);
    if (expr == null) {
      throw new BatfishException("Cannot find community set expression: " + name);
    }
    return expr.accept(this, arg);
  }

}