diff options
author | sbrandt <sbrandt@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2013-02-26 22:45:13 +0000 |
---|---|---|
committer | sbrandt <sbrandt@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2013-02-26 22:45:13 +0000 |
commit | 8735c439a15ed19e666922981efb63ca56b7fd32 (patch) | |
tree | dbb53fa7738ad77166921e6e81a321bd2f86787e /src | |
parent | 2808b605fea61bbd9ff50a46020061579fb19f41 (diff) |
Fix a namespace issue
git-svn-id: http://svn.cactuscode.org/flesh/trunk@4967 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src')
-rw-r--r-- | src/piraha/Generic.cc | 2 | ||||
-rw-r--r-- | src/piraha/Grammar.cc | 7 | ||||
-rw-r--r-- | src/piraha/Makefile | 4 |
3 files changed, 9 insertions, 4 deletions
diff --git a/src/piraha/Generic.cc b/src/piraha/Generic.cc index 5026828b..1695b873 100644 --- a/src/piraha/Generic.cc +++ b/src/piraha/Generic.cc @@ -1,6 +1,8 @@ #include "Piraha.hpp" #include <fstream> +using namespace piraha; + void read_file(const char *file,std::string& buf) { std::ifstream in; in.open(file); diff --git a/src/piraha/Grammar.cc b/src/piraha/Grammar.cc index b222a34a..9592e7c2 100644 --- a/src/piraha/Grammar.cc +++ b/src/piraha/Grammar.cc @@ -1,6 +1,6 @@ #include "Piraha.hpp" -using namespace piraha; +namespace piraha { extern smart_ptr<Pattern> compile(smart_ptr<Group> g,bool ignCase,smart_ptr<Grammar> gram); @@ -8,7 +8,7 @@ smart_ptr<Grammar> pegGrammar = AutoGrammar::reparserGenerator(); void Grammar::compile(std::string name,smart_ptr<Group> g) { default_rule = name; - smart_ptr<Pattern> p = ::compile(g,false,this); + smart_ptr<Pattern> p = piraha::compile(g,false,this); patterns.put(name,p); } void Grammar::compile(std::string name,std::string pattern) { @@ -16,7 +16,7 @@ void Grammar::compile(std::string name,std::string pattern) { smart_ptr<Matcher> m = new Matcher(pegGrammar,"pattern",pattern.c_str()); smart_ptr<Group> g = m.dup<Group>(); if(m->matches()) { - smart_ptr<Pattern> p = ::compile(g,false,this); + smart_ptr<Pattern> p = piraha::compile(g,false,this); patterns.put(name,p); } else { std::cout << "Could not compile(" << name << "," << pattern << ")" << std::endl; @@ -24,3 +24,4 @@ void Grammar::compile(std::string name,std::string pattern) { assert(false); } } +} diff --git a/src/piraha/Makefile b/src/piraha/Makefile index 4463a251..7528fc54 100644 --- a/src/piraha/Makefile +++ b/src/piraha/Makefile @@ -1,12 +1,14 @@ # Build the standalone tool # +CXX = g++ +CXXFLAGS = -Wall SRCS = AutoGrammar.cc Bracket.cc Dot.cc End.cc \ Generic.cc Grammar.cc Group.cc ILiteral.cc \ Literal.cc Lookup.cc Matcher.cc Multi.cc \ Or.cc ReParse.cc Seq.cc smart_ptr.cc Start.cc generic : $(SRCS) Piraha.hpp smart_ptr.hpp - g++ -Wall -I . -g -o generic $(SRCS) + $(CXX) -I . -g -o generic $(SRCS) clean : rm -f generic |