summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2020-01-22 20:59:15 +0100
committerRoland Reichwein <mail@reichwein.it>2020-01-22 20:59:15 +0100
commitf7cdbb6635d62a0347be579cb8dd6badec22956d (patch)
tree51e779573e62a2d29234ae35ff802de3e4f6b5e8
parent3eff766ce1cbed5d3a3c3158614e6741cc1b7f2a (diff)
Namespace Gram
-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);