From 8735c439a15ed19e666922981efb63ca56b7fd32 Mon Sep 17 00:00:00 2001 From: sbrandt Date: Tue, 26 Feb 2013 22:45:13 +0000 Subject: Fix a namespace issue git-svn-id: http://svn.cactuscode.org/flesh/trunk@4967 17b73243-c579-4c4c-a9d2-2d5706c11dac --- src/piraha/Generic.cc | 2 ++ src/piraha/Grammar.cc | 7 ++++--- src/piraha/Makefile | 4 +++- 3 files changed, 9 insertions(+), 4 deletions(-) (limited to 'src') 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 +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 compile(smart_ptr g,bool ignCase,smart_ptr gram); @@ -8,7 +8,7 @@ smart_ptr pegGrammar = AutoGrammar::reparserGenerator(); void Grammar::compile(std::string name,smart_ptr g) { default_rule = name; - smart_ptr p = ::compile(g,false,this); + smart_ptr 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 m = new Matcher(pegGrammar,"pattern",pattern.c_str()); smart_ptr g = m.dup(); if(m->matches()) { - smart_ptr p = ::compile(g,false,this); + smart_ptr 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 -- cgit v1.2.3