diff options
author | Roland Reichwein <mail@reichwein.it> | 2020-01-22 20:59:15 +0100 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2020-01-22 20:59:15 +0100 |
commit | f7cdbb6635d62a0347be579cb8dd6badec22956d (patch) | |
tree | 51e779573e62a2d29234ae35ff802de3e4f6b5e8 | |
parent | 3eff766ce1cbed5d3a3c3158614e6741cc1b7f2a (diff) |
Namespace Gram
-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); |