class CommunityMatchExprToBDD implements CommunityMatchExprVisitor<BDD, Arg> {

  @Override
  public BDD visitCommunityMatchExprReference(
      CommunityMatchExprReference communityMatchExprReference, Arg arg) {
    String name = communityMatchExprReference.getName();
    CommunityMatchExpr expr =
        arg.getTransferBDD().getConfiguration().getCommunityMatchExprs().get(name);
    if (expr == null) {
      throw new BatfishException("Cannot find community match expression: " + name);
    }
    return expr.accept(this, arg);
  }

}