diff options
author | Alan Conway <aconway@apache.org> | 2008-11-20 22:33:28 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2008-11-20 22:33:28 +0000 |
commit | c4cbebed1e8d08771b75dde15e45e12f086baddc (patch) | |
tree | 02ab1e399bd216052603c4a0ea23e90bfe3b4eb5 | |
parent | f661cd2f825d9b8be125d2808a629487888866c9 (diff) | |
download | qpid-python-c4cbebed1e8d08771b75dde15e45e12f086baddc.tar.gz |
Exorcise remains of boost.spirit parser.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@719410 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | qpid/cpp/configure.ac | 3 | ||||
-rw-r--r-- | qpid/cpp/src/qpid/Url.cpp | 69 |
2 files changed, 1 insertions, 71 deletions
diff --git a/qpid/cpp/configure.ac b/qpid/cpp/configure.ac index 81f46870fe..b4bfb2f402 100644 --- a/qpid/cpp/configure.ac +++ b/qpid/cpp/configure.ac @@ -163,9 +163,6 @@ AC_SUBST(DOWNLOAD_URL) AC_CHECK_HEADERS([boost/shared_ptr.hpp uuid/uuid.h],, AC_MSG_ERROR([Missing required header files.])) -# Link with whichever variant of libboost_thread is available. -AC_SEARCH_LIBS([_ZN5boost6thread4joinEv],[boost_thread-mt boost_thread],,[AC_MSG_ERROR([No boost thread library found])]) - # Check for optional cluster requirements. tmp_LIBS=$LIBS LDFLAGS="$LDFLAGS -L/usr/lib/openais -L/usr/lib64/openais" diff --git a/qpid/cpp/src/qpid/Url.cpp b/qpid/cpp/src/qpid/Url.cpp index d0aa28ab0f..b7d6f76a94 100644 --- a/qpid/cpp/src/qpid/Url.cpp +++ b/qpid/cpp/src/qpid/Url.cpp @@ -22,22 +22,12 @@ #include "qpid/sys/SystemInfo.h" #include "qpid/sys/StrError.h" -#include <limits.h> // NB: must be before boost/spirit headers. -#define BOOST_SPIRIT_THREADSAFE - -#include <boost/spirit.hpp> -#include <boost/spirit/actor.hpp> #include <boost/lexical_cast.hpp> -#include <sstream> -#include <map> #include <algorithm> -#include <limits> -#include <stdio.h> -#include <errno.h> +#include <string.h> -using namespace boost::spirit; using namespace std; using boost::lexical_cast; @@ -192,63 +182,6 @@ class UrlParser { const string UrlParser::LOCALHOST("127.0.0.1"); -// Addition to boost::spirit parsers: accept any character from a -// string. Vastly more compile-time-efficient than long rules of the -// form: ch_p('x') | ch_p('y') |... -// -struct ch_in : public char_parser<ch_in> { - ch_in(const string& chars_) : chars(chars_) {} - bool test(char ch_) const { - return chars.find(ch_) != string::npos; - } - string chars; -}; - -inline ch_in ch_in_p(const string& chars) { - return ch_in(chars); -} - -/** Grammar for AMQP URLs. */ -struct UrlGrammar : public grammar<UrlGrammar> -{ - Url& addr; - - UrlGrammar(Url& addr_) : addr(addr_) {} - - template <class ScannerT> - struct definition { - TcpAddress tcp; - - definition(const UrlGrammar& self) - { - first = eps_p[clear_a(self.addr)] >> amqp_url; - amqp_url = str_p("amqp:") >> prot_addr_list >> - !(str_p("/") >> !parameters); - prot_addr_list = prot_addr % ','; - prot_addr = tcp_prot_addr; // Extend for TLS etc. - - // TCP addresses - tcp_prot_addr = tcp_id >> tcp_addr[push_back_a(self.addr, tcp)]; - tcp_id = !str_p("tcp:"); - tcp_addr = !(host[assign_a(tcp.host)] >> !(':' >> port)); - - // See http://www.apps.ietf.org/rfc/rfc3986.html#sec-A - // for real host grammar. Shortcut: - port = uint_parser<uint16_t>()[assign_a(tcp.port)]; - host = *( unreserved | pct_encoded ); - unreserved = alnum_p | ch_in_p("-._~"); - pct_encoded = "%" >> xdigit_p >> xdigit_p; - parameters = *anychar_p >> end_p; // Ignore, not used yet. - } - - const rule<ScannerT>& start() const { return first; } - - rule<ScannerT> first, amqp_url, prot_addr_list, prot_addr, - tcp_prot_addr, tcp_id, tcp_addr, host, port, - unreserved, pct_encoded, parameters; - }; -}; - void Url::parse(const char* url) { parseNoThrow(url); if (empty()) |