aboutsummaryrefslogtreecommitdiff
path: root/include/cps/Lexer.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/cps/Lexer.h')
-rw-r--r--include/cps/Lexer.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/include/cps/Lexer.h b/include/cps/Lexer.h
new file mode 100644
index 0000000..0ad5609
--- /dev/null
+++ b/include/cps/Lexer.h
@@ -0,0 +1,27 @@
+#pragma once
+#include <string>
+#include <iostream>
+
+namespace cps {
+
+enum Token {
+ tok_eof = -1,
+ tok_declare = -2,
+ tok_integer_kw = -3, // INTEGER
+ tok_input = -4,
+ tok_output = -5,
+ tok_identifier = -6,
+ tok_number = -7,
+ tok_assign = -8, // <-
+ tok_colon = -9 // :
+};
+
+class Lexer {
+public:
+ std::string IdentifierStr;
+ int NumVal;
+
+ int gettok();
+};
+
+} // namespace cps