shithub: pprolog

Download patch

ref: 0b36426d023e45d6acbc7672c7083a91d10913a8
author: Peter Mikkelsen <peter@pmikkelsen.com>
date: Mon Jun 28 18:31:14 EDT 2021

Initial commit. Start working on a new prolog implementation for 9front, now that I at least have a better understanding of what goes into a compiler :)

--- /dev/null
+++ b/dat.h
@@ -1,0 +1,1 @@
+int debug;
\ No newline at end of file
--- /dev/null
+++ b/main.c
@@ -1,0 +1,31 @@
+#include <u.h>
+#include <libc.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
+
+	if(argc != 0)
+		usage();
+
+	exits(nil);
+}
+
+void
+usage(void)
+{
+	fprint(2, "Usage: pprolog [-d]\n");
+	exits("Usage");
+}
\ No newline at end of file
--- /dev/null
+++ b/mkfile
@@ -1,0 +1,11 @@
+</$objtype/mkfile
+
+TARG=pprolog
+
+OFILES=main.$O parser.$O
+
+HFILES=dat.h fns.h
+
+BIN=/$objtype/bin
+
+</sys/src/cmd/mkone
\ No newline at end of file
--- /dev/null
+++ b/parser.c
@@ -1,0 +1,5 @@
+#include <u.h>
+#include <libc.h>
+
+#include "dat.h"
+#include "fns.h"