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

main(argc, argv)
int argc;
char** argv;
{
  id list;
  // the following variables are needed by the star parser.

  // progName=*argv;
  // fileList=argv+1;
  // nFiles=argc-1;
  starParser=[WDCStarParser alloc];

  if (argc >1)
    {
      [starParser parseDictionary:argv[1]];
      [starParser parseDictionary:argv[2]];
    }
/*
  printf("Show Data Definition Blocks who's _category is diffrn_radiation\n\n");
  list=[[starParser getDictionary] 
	getDefinitionBlocksWhos :"_item.category_id" is :"diffrn_radiation"];
  [list printForDebugger];
  [list free];
  printf("\n\n");
  printf("Show Data Definition Blocks who's _category is entity_reference\n\n");
  list=[[starParser getDictionary] 
	getDefinitionBlocksWhos :"_item.category_id" is :"entity_reference"];
  [list printForDebugger];
  [list free];
  printf("\n\n");
*/
  /*
     printf("Show Data Definition Blocks who's _name is _citation_special_details\n\n");
     list=[[starParser getDictionary] 
     getDefinitionBlocksWhos :"_item.name" is :"'_citation_special_details'"];
     [list printForDebugger];
     [list free];
     printf("\n\n");
     */
  /*
     printf("Show Data Definition Blocks Which has no _category defined\n\n");
     list=[[starParser getDictionary] 
     getDefinitionBlocksHaveNo :"_item.category_id"];
     [list printForDebugger];
     [list free];
     printf("\n\n");
     printf("Show Data Definition Blocks Which has no _type defined\n\n");
     list=[[starParser getDictionary] getDefinitionBlocksHaveNo :"_type"];
     [list printForDebugger];
     [list free];
     printf("\n\n");
     printf("Show Data Definition Blocks Which has no _list_reference defined\n\n");
     list=[[starParser getDictionary] getDefinitionBlocksHaveNo :"_list_reference"];
     [list printForDebugger];
     [list free];
     */

  /*
     printf("\n\n");
     printf("List all data category\n\n");
     list=[[starParser getDictionary] getAllUnique:"_item.category_id"];
     [list printForDebugger];
     [list free];
     */

  /*
   [[[starParser getDictionary] getDefinitionBlockAtKey:"data_list_reference"]
   printForDebugger];
   */
  
  // [starParser printForDebugger];
  [[[[starParser getDictionaryList] 
     getDefinitionBlockAtKey :"save_item.name"]
    getAllDataItems :"_item.name"] printForDebugger];
  return 0;
}

