From f7cdbb6635d62a0347be579cb8dd6badec22956d Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Wed, 22 Jan 2020 20:59:15 +0100 Subject: Namespace Gram --- grammer.cpp | 2 ++ grammer.h | 3 +++ test-lexer.cpp | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) 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)} { } diff --git a/grammer.h b/grammer.h index 5e76c60..01ea681 100644 --- a/grammer.h +++ b/grammer.h @@ -3,6 +3,8 @@ #include "bnf.h" #include "minicc.h" +namespace Gram { + class Compiler { @@ -17,3 +19,4 @@ public: ProgramNode compile(std::vector 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); -- cgit v1.2.3