/* this program parses input in set format and tells what the elements 
 * and subsets are.
 *
 * The idea is that every thing in a set is an object - sets are objects, 
 * elements are objects, and subsets are merely other sets.  This allows 
 * great versatility in implementing more complex functions, such as 
 * computing the union or intersection of two or more sets.
 * 
 * Element and subset objects are stored in arrays in a set.
 */



#include "jimr.h"
using namespace mine;

//int main(int argc, char *argv[]) {
int main() {  
  char input[MAX_ELEMENTS];
  Set *set;

  cin >> input;

  int elements = set->get_elements(input, set);
  if (elements) {
    cout <<elements <<" elements\n";
    set->print_elements(set);
    set->print_subsets(set);
  }
  else cout <<"couldn't parse set.\n";
  return 0;

}

/*
  Output:

  [Jim@riceja sets]$ ./sets
  {1,2}
  input 0: {
  current:
  input 1: 1
  current: 1
  input 2: ,
  , 1
  current:
  input 3: 2
  current: 2
  input 4: }
  help!2
  2 elements
  Elements:
  1
  Subsets:
  {1}
  {}

  [Jim@riceja sets]$ ./sets
  {1,2,{3}}
  input 0: {
  current:
  input 1: 1
  current: 1
  input 2: ,
  , 1
  current:
  input 3: 2
  current: 2
  input 4: ,
  , 2
  current:
  input 5: {
  current: {
  input 6: 3
  current: {
  input 7: }
  help!{
  current:
  input 8: }
  help!}
  4 elements
  Elements:
  1
  2
  {3}
  Subsets:
  {1}
  {1,2}
  {1,{3}
  {2}
  {2,{3}
  {{3}
  {}

*/

