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.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/cps/Lexer.h b/include/cps/Lexer.h
index 2af0260..d83e808 100644
--- a/include/cps/Lexer.h
+++ b/include/cps/Lexer.h
@@ -1,4 +1,5 @@
#pragma once
+#include <istream>
#include <string>
#include <cstdint>
@@ -87,9 +88,13 @@ enum Token {
};
class Lexer {
+ std::istream &Input;
+ int LastChar = ' ';
int CurrentLine = 1;
bool HadError = false;
public:
+ explicit Lexer(std::istream &Input) : Input(Input) {}
+
std::string IdentifierStr;
std::string StringVal;
int64_t NumVal;