summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--grammer.cpp2
-rw-r--r--grammer.h3
-rw-r--r--test-lexer.cpp2
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)}
{
}
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<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);