summaryrefslogtreecommitdiffhomepage
path: root/minicc.h
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2020-01-21 22:49:30 +0100
committerRoland Reichwein <mail@reichwein.it>2020-01-21 22:49:30 +0100
commitf4b2027868c9733bbbbcb4c5ec6d5462a8447e5d (patch)
tree40ce459f1a501d6c88936c78f6dbcbb8aadd04ca /minicc.h
parent08997620fd617b580c1adbcb03c90cf621aa7069 (diff)
Separate to cpp files
Diffstat (limited to 'minicc.h')
-rw-r--r--minicc.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/minicc.h b/minicc.h
new file mode 100644
index 0000000..0500b8c
--- /dev/null
+++ b/minicc.h
@@ -0,0 +1,26 @@
+#pragma once
+
+#include <cstdlib>
+#include <vector>
+#include <string>
+#include <iostream>
+
+using index_t = size_t;
+
+std::vector<std::string> split(std::string s);
+
+struct Location {
+ size_t line;
+ size_t column;
+};
+
+bool operator==(const Location &a, const Location &b);
+
+struct Token {
+ std::string type;
+ std::string value;
+ Location location;
+};
+
+bool operator==(const Token &a, const Token &b);
+std::ostream& operator<<(std::ostream& os, const Token& token);