summaryrefslogtreecommitdiffhomepage
path: root/lexer.cpp
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2020-01-23 21:53:57 +0100
committerRoland Reichwein <mail@reichwein.it>2020-01-23 21:53:57 +0100
commite172ed9f799501c234c8da18cef829244473f1d7 (patch)
tree2c36c8adef69bd7c1b61efc1fe91188ab61ca6d8 /lexer.cpp
parentf7cdbb6635d62a0347be579cb8dd6badec22956d (diff)
Added grammer
Diffstat (limited to 'lexer.cpp')
-rw-r--r--lexer.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lexer.cpp b/lexer.cpp
index 3b26c52..7717b85 100644
--- a/lexer.cpp
+++ b/lexer.cpp
@@ -292,3 +292,11 @@ std::vector<Token> Lexer::Lex(const std::string& s)
return result;
}
+// C++: Preprocessor Tokens To Tokens
+void Lexer::PreprocessorTokensToTokens(std::vector<Token>& tokens)
+{
+ for (auto& i : tokens) {
+ if (i.type == "preprocessing-op-or-punc")
+ i.type = i.value;
+ }
+}