beginnings of REPL
[muddle-interpreter.git] / src / read.h
diff --git a/src/read.h b/src/read.h
new file mode 100644 (file)
index 0000000..2d87835
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+Copyright (C) 2017 Keziah Wesley
+
+You can redistribute and/or modify this file under the terms of the
+GNU Affero General Public License as published by the Free Software
+Foundation, either version 3 of the License, or (at your option) any
+later version.
+
+This file is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public
+License along with this file. If not, see
+<http://www.gnu.org/licenses/>.
+*/
+
+#ifndef READ_H
+#define READ_H
+
+#include <stdint.h>
+
+typedef union object object;
+typedef struct
+{
+  object *pos;
+  uint32_t framelen;
+  uint32_t _pad;
+} reader_stack;
+
+// TODO: hide this, export higher-level interface
+const char *read_token (const char *p, reader_stack * st);
+
+#endif // READ_H