shithub: pprolog

ref: 9b4f17521bb8a7d96c09d540880679298ce6f08e
dir: pprolog/main.c

View raw version
#include <u.h>
#include <libc.h>
#include <bio.h>

#include "dat.h"
#include "fns.h"

void usage(void);

void
main(int argc, char *argv[])
{
	ARGBEGIN{
	case 'd':
		debug = 1;
		break;
	default:
		usage();
	}ARGEND

	clausenr = 2; /* Start at two since 0 is for the facts in the database, and 1 is for queries */
	initflags();
	initstreams();
	initmodules();

	while(argc != 0){
		parsemodule(argv[0]);
		argc--;
		argv++;
	}

	repl();
	exits(nil);
}

void
usage(void)
{
	fprint(2, "Usage: pprolog [-d] modulefiles\n");
	exits("Usage");
}