#include <stdio.h>
#include "starpasr.h"
#include "datablk.h"
#include "pasrmain.h"
#include "iterator.h"

main(argc, argv)
int argc;
char** argv;
{

  id *iter, *list, current;
  char *file, *category, *relationship;
  int i;

  starParser=[WDCStarParser alloc];

  if (argc>3){
    file=*(argv+1);
    category=*(argv+2);
    relationship=*(argv+3);
  }
  else {
    printf("usage: %s filename category relationship\n", argv[0]);
    exit(1);
  }
  [starParser parseDictionary:file];


  // **************************************************************

  if (iter=[[starParser getDictionaryNamed:file] 
	    getAllCategoriesAre :(const char*)relationship 
	    ofCategory :(const char*) category]) {
    iter=[[WDCListIterator alloc] initFrom: iter];
    while ([iter goNext]){
      current=[[[iter getCurrentObject] getContent] getValue];
      printf("%s\n", [current cStringValue]);
    }
  }
  else
    printf("Can not locate such information\n");
  return 0;
}
  






