#include <stdio.h>
#include "coord.h"

extern FILE *yyin;

void do_child();


void main2(int argc, char **argv)
{
  FILE *input;
  int pid;

  if (argc == 2)
    {
      input = fopen (argv[1], "r");
      if (input)
	yyin = input;
      else
	printf ("Could not find input file %s - aborted!\n", argv[1]);
    }

  objects_init();

  /* start subprocess */

/*  if (pid = fork()) */  /* PID of child or zero if parent */
/*    {
      do_child();
    }

  printf ("Subprocess: %d\n", pid);
*/
  yyparse();

  if (argc == 2)
    {
      fclose (input);
    }

/*  map (argc, argv); */
}


LOCATION digi_input();


void do_child()
{
  LOCATION pos;

puts ("A");
  while (!is_digi_valid())
    ;
puts ("B");

  for (;;)
    {
      pos = digi_input();
      printf ("Current location: %s\n", internal2string (pos));
    }

}
