diff options
author | Miodrag Milanovic <mmicko@gmail.com> | 2018-06-28 13:32:06 +0200 |
---|---|---|
committer | Miodrag Milanovic <mmicko@gmail.com> | 2018-06-28 17:57:26 +0200 |
commit | 9cf23d101041d1e990f57d78e4712226b8a449c7 (patch) | |
tree | cf94b24666b7e5e935a1613cbdfafb3ca956bc1b /3rdparty/python-console/ParseHelper.cpp | |
parent | 9347c8742d8faf8b39fea4cbbe13b7a1d2440c18 (diff) | |
download | nextpnr-9cf23d101041d1e990f57d78e4712226b8a449c7.tar.gz nextpnr-9cf23d101041d1e990f57d78e4712226b8a449c7.tar.bz2 nextpnr-9cf23d101041d1e990f57d78e4712226b8a449c7.zip |
move to c++11 remove console writes
Diffstat (limited to '3rdparty/python-console/ParseHelper.cpp')
-rw-r--r-- | 3rdparty/python-console/ParseHelper.cpp | 37 |
1 files changed, 5 insertions, 32 deletions
diff --git a/3rdparty/python-console/ParseHelper.cpp b/3rdparty/python-console/ParseHelper.cpp index 8944a84e..08f0526a 100644 --- a/3rdparty/python-console/ParseHelper.cpp +++ b/3rdparty/python-console/ParseHelper.cpp @@ -28,26 +28,6 @@ THE SOFTWARE. #include <cstdlib> #include "ParseListener.h" -#ifndef NDEBUG -void print(const ParseHelper::Indent& indent) -{ - std::string str = indent.Token; - for (int i = 0; i < str.size(); ++i) - { - switch (str.at(i)) - { - case ' ': - str[i] = 's'; - break; - case '\t': - str[i] = 't'; - break; - } - } - std::cout << str << "\n"; -} -#endif - ParseHelper::Indent:: Indent( ) { } @@ -93,15 +73,11 @@ ParseHelper::ParseHelper( ) void ParseHelper::process( const std::string& str ) { -#ifndef NDEBUG - std::cout << "processing: (" << str << ")\n"; -#endif - std::string top; commandBuffer.push_back(str); //std::string top = commandBuffer.back(); //commandBuffer.pop_back(); - boost::shared_ptr<ParseState> blockStatePtr; + std::shared_ptr<ParseState> blockStatePtr; while (stateStack.size()) { top = commandBuffer.back(); @@ -122,9 +98,6 @@ void ParseHelper::process( const std::string& str ) broadcast( std::string() ); return; } -#ifndef NDEBUG - std::cout << "now processing: (" << top << ")\n"; -#endif { // check for unexpected indent Indent ind; @@ -142,7 +115,7 @@ void ParseHelper::process( const std::string& str ) // enter indented block state if ( top[top.size()-1] == ':' ) { - boost::shared_ptr<ParseState> parseState( + std::shared_ptr<ParseState> parseState( new BlockParseState( *this ) ); stateStack.push_back( parseState ); return; @@ -150,7 +123,7 @@ void ParseHelper::process( const std::string& str ) if ( top[top.size()-1] == '\\' ) { - boost::shared_ptr<ParseState> parseState( + std::shared_ptr<ParseState> parseState( new ContinuationParseState( *this ) ); stateStack.push_back( parseState ); return; @@ -160,7 +133,7 @@ void ParseHelper::process( const std::string& str ) { // FIXME: Every parse state should have its own local buffer commandBuffer.pop_back( ); - boost::shared_ptr<ParseState> parseState( + std::shared_ptr<ParseState> parseState( new BracketParseState( *this, top ) ); stateStack.push_back( parseState ); return; @@ -198,7 +171,7 @@ void ParseHelper::reset( ) bool ParseHelper::isInContinuation( ) const { return (stateStack.size() - && (boost::dynamic_pointer_cast<ContinuationParseState>( + && (std::dynamic_pointer_cast<ContinuationParseState>( stateStack.back()))); } |