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

  @Override
  public Set<CommunityVar> visitCommunitySetReference(
      CommunitySetReference communitySetReference, Configuration arg) {
    String name = communitySetReference.getName();
    CommunitySet cset = arg.getCommunitySets().get(name);
    if (cset == null) {
      throw new BatfishException("Cannot find community set: " + name);
    }
    return toCommunityVarSet(cset);
  }

}