From e172ed9f799501c234c8da18cef829244473f1d7 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Thu, 23 Jan 2020 21:53:57 +0100 Subject: Added grammer --- lexer.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lexer.cpp') diff --git a/lexer.cpp b/lexer.cpp index 3b26c52..7717b85 100644 --- a/lexer.cpp +++ b/lexer.cpp @@ -292,3 +292,11 @@ std::vector Lexer::Lex(const std::string& s) return result; } +// C++: Preprocessor Tokens To Tokens +void Lexer::PreprocessorTokensToTokens(std::vector& tokens) +{ + for (auto& i : tokens) { + if (i.type == "preprocessing-op-or-punc") + i.type = i.value; + } +} -- cgit v1.2.3