diff options
-rw-r--r-- | grammer.cpp | 2 | ||||
-rw-r--r-- | grammer.h | 3 | ||||
-rw-r--r-- | test-lexer.cpp | 2 |
3 files changed, 6 insertions, 1 deletions
diff --git a/grammer.cpp b/grammer.cpp index a44104c..d275da6 100644 --- a/grammer.cpp +++ b/grammer.cpp @@ -1,5 +1,7 @@ #include "grammer.h" +using namespace Gram; + Compiler::Compiler(const BNF& bnf, const std::string& Top): m_bnf(bnf), m_Top(Top), ReverseBNF{Reverse(bnf)} { } @@ -3,6 +3,8 @@ #include "bnf.h" #include "minicc.h" +namespace Gram { + class Compiler { @@ -17,3 +19,4 @@ public: ProgramNode compile(std::vector<Token> Tokens); }; +} // namespace Gram diff --git a/test-lexer.cpp b/test-lexer.cpp index b76f4cc..4942013 100644 --- a/test-lexer.cpp +++ b/test-lexer.cpp @@ -85,7 +85,7 @@ TEST_F(Test, BNF) { std::cout << i.value << std::endl; } #endif - Compiler compiler(bnf, Top); + Gram::Compiler compiler(bnf, Top); auto Program = compiler.compile(tokens); //ASSERT_EQ(Program, Program_reference); |