class CommunitySetExprVarCollector implements CommunitySetExprVisitor<Set<CommunityVar>, Configuration> {

  @Override
  public Set<CommunityVar> visitCommunitySetExprReference(
      CommunitySetExprReference communitySetExprReference, Configuration arg) {
    String name = communitySetExprReference.getName();
    CommunitySetExpr setExpr = arg.getCommunitySetExprs().get(name);
    if (setExpr == null) {
      throw new BatfishException("Cannot find community set expression: " + name);
    }
    return setExpr.accept(this, arg);
  }

}