From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2622 invoked by alias); 9 Feb 2002 07:46:03 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 2566 invoked by uid 71); 9 Feb 2002 07:46:01 -0000 Resent-Date: 9 Feb 2002 07:46:01 -0000 Resent-Message-ID: <20020209074601.2564.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, jcab@JCABs-Rumblings.com Received:(qmail 27176 invoked by uid 61); 9 Feb 2002 07:42:30 -0000 Message-Id:<20020209074230.27175.qmail@sources.redhat.com> Date: Fri, 08 Feb 2002 23:46:00 -0000 From: jcab@JCABs-Rumblings.com Reply-To: jcab@JCABs-Rumblings.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version:gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/5639: Internal compiler error on lifted class X-SW-Source: 2002-02/txt/msg00217.txt.bz2 List-Id: >Number: 5639 >Category: c++ >Synopsis: Internal compiler error on lifted class >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: ice-on-legal-code >Submitter-Id: net >Arrival-Date: Fri Feb 08 23:46:01 PST 2002 >Closed-Date: >Last-Modified: >Originator: Juan Carlos Arevalo-Baeza >Release: 2.95.3-5 (cygwin special) >Organization: >Environment: CygWin on Windows 2000 Professional >Description: The attached c_grammar.ii file was generated on the crash. Original compilation command: g++ c_grammar.cpp -O2 -ftemplate-depth-50 -save-temps -v Step that crashes: /usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/cc1plus.exe c_grammar.ii -quiet -dumpbase c_grammar.cc -O2 -version -ftemplate-depth-50 -o c_grammar.s Messages: c_grammar.cpp:332: Internal compiler error. c_grammar.cpp:332: Please submit a full bug report. c_grammar.cpp:332: See for instructions. Applying the following diff to the c_grammar.ii file (it just adds a line of code) compiles just fine: 39244a39245,39246 > symbols<> keywords; > That was generated as: diff Bug/c_grammar.ii Works/c_grammar.ii The problem is probably caused by the extremely heavy use of templates and/or the huge initialization list of the class in question. >How-To-Repeat: Just compile the file: g++ c_grammar.ii -O2 -ftemplate-depth-50 -save-temps -v >Fix: Workaround: if the member "keywords" of the base class is the one used, the compiler crashes. If I add that same member declaration to the child class, the compiler doesn't crash. >Release-Note: >Audit-Trail: >Unformatted: > struct make_tuple_mapper { typedef tuple::type, typename make_tuple_traits::type, typename make_tuple_traits::type, typename make_tuple_traits::type, typename make_tuple_traits::type, typename make_tuple_traits::type, typename make_tuple_traits::type, typename make_tuple_traits::type, typename make_tuple_traits::type, typename make_tuple_traits::type> type; }; } inline tuple<> make_tuple() { return tuple<>(); } template inline typename detail::make_tuple_mapper::type make_tuple(const T0& t0) { typedef typename detail::make_tuple_mapper::type t; return t(t0); } template inline typename detail::make_tuple_mapper::type make_tuple(const T0& t0, const T1& t1) { typedef typename detail::make_tuple_mapper::type t; return t(t0, t1); } template inline typename detail::make_tuple_mapper::type make_tuple(const T0& t0, const T1& t1, const T2& t2) { typedef typename detail::make_tuple_mapper::type t; return t(t0, t1, t2); } template inline typename detail::make_tuple_mapper::type make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3) { typedef typename detail::make_tuple_mapper::type t; return t(t0, t1, t2, t3); } template inline typename detail::make_tuple_mapper::type make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3, const T4& t4) { typedef typename detail::make_tuple_mapper::type t; return t(t0, t1, t2, t3, t4); } template inline typename detail::make_tuple_mapper::type make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5) { typedef typename detail::make_tuple_mapper::type t; return t(t0, t1, t2, t3, t4, t5); } template inline typename detail::make_tuple_mapper::type make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6) { typedef typename detail::make_tuple_mapper ::type t; return t(t0, t1, t2, t3, t4, t5, t6); } template inline typename detail::make_tuple_mapper::type make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7) { typedef typename detail::make_tuple_mapper ::type t; return t(t0, t1, t2, t3, t4, t5, t6, t7); } template inline typename detail::make_tuple_mapper ::type make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8) { typedef typename detail::make_tuple_mapper ::type t; return t(t0, t1, t2, t3, t4, t5, t6, t7, t8); } template inline typename detail::make_tuple_mapper ::type make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9) { typedef typename detail::make_tuple_mapper ::type t; return t(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9); } template inline tuple tie(T1& t1) { return tuple (t1); } template inline tuple tie(T1& t1, T2& t2) { return tuple (t1, t2); } template inline tuple tie(T1& t1, T2& t2, T3& t3) { return tuple (t1, t2, t3); } template inline tuple tie(T1& t1, T2& t2, T3& t3, T4& t4) { return tuple (t1, t2, t3, t4); } template inline tuple tie(T1& t1, T2& t2, T3& t3, T4& t4, T5& t5) { return tuple (t1, t2, t3, t4, t5); } template inline tuple tie(T1& t1, T2& t2, T3& t3, T4& t4, T5& t5, T6& t6) { return tuple (t1, t2, t3, t4, t5, t6); } template inline tuple tie(T1& t1, T2& t2, T3& t3, T4& t4, T5& t5, T6& t6, T7& t7) { return tuple (t1, t2, t3, t4, t5, t6, t7); } template inline tuple tie(T1& t1, T2& t2, T3& t3, T4& t4, T5& t5, T6& t6, T7& t7, T8& t8) { return tuple (t1, t2, t3, t4, t5, t6, t7, t8); } template inline tuple tie(T1& t1, T2& t2, T3& t3, T4& t4, T5& t5, T6& t6, T7& t7, T8& t8, T9& t9) { return tuple (t1, t2, t3, t4, t5, t6, t7, t8, t9); } template inline tuple tie(T1& t1, T2& t2, T3& t3, T4& t4, T5& t5, T6& t6, T7& t7, T8& t8, T9& t9, T10& t10) { return tuple (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10); } } } # 31 "/usr/include/boost/tuple/tuple.hpp" 2 3 namespace boost { using tuples::tuple; using tuples::make_tuple; using tuples::tie; using tuples::get; } # 34 "/usr/include/boost/spirit/spirit_attr_fwd.hpp" 2 3 namespace spirit { typedef boost::tuples::null_type nil_t; template < typename T0 = nil_t, typename T1 = nil_t, typename T2 = nil_t, typename T3 = nil_t, typename T4 = nil_t, typename T5 = nil_t, typename T6 = nil_t, typename T7 = nil_t, typename T8 = nil_t, typename T9 = nil_t > class closure; template class closure_parser; template < typename ClosureT = closure<>, typename IteratorT = scanner<>, typename ParsePolicyT = match_policy> struct attr_rule; template struct remove_wrap > { typedef typename boost::tuples::element::type type; }; template struct remove_wrap const> { typedef typename boost::tuples::element::type const type; }; namespace impl { template struct local_saver; } } # 35 "/usr/include/boost/spirit/attr/closure.hpp" 2 3 namespace spirit { template class closure_parser : public unary, public parser > { public: typedef TupleT tuple_t; typedef typename boost::tuples::element<0, TupleT>::type return_t; typedef closure_parser_category parser_category; closure_parser(TupleT*& ptr, ParserT const& parser); template attr_match do_parse(IteratorT& first, IteratorT const& last) const; template attr_action, ActionT> operator[](ActionT const& actor) const { typedef attr_action, ActionT> actor_t; return actor_t(*this, actor); } private: TupleT*& ptr; }; template class local { public: typedef typename boost::tuples::element::type type; local(TupleT*& ptr); operator type&() const; local& operator=(type const& val); type& get() const; private: TupleT*& ptr; }; template struct closure_member {}; closure_member<0> const m0 = closure_member<0>(); closure_member<1> const m1 = closure_member<1>(); closure_member<2> const m2 = closure_member<2>(); closure_member<3> const m3 = closure_member<3>(); closure_member<4> const m4 = closure_member<4>(); closure_member<5> const m5 = closure_member<5>(); closure_member<6> const m6 = closure_member<6>(); closure_member<7> const m7 = closure_member<7>(); closure_member<8> const m8 = closure_member<8>(); closure_member<9> const m9 = closure_member<9>(); namespace impl { template struct local_type { typedef local type; static type init(TupleT*& ptr); }; template struct local_type { typedef nil_t type; static nil_t init(TupleT*); }; } template < typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9 > class base_closure { public: typedef boost::tuples:: tuple tuple_t; typedef impl::local_type LT0; typedef impl::local_type LT1; typedef impl::local_type LT2; typedef impl::local_type LT3; typedef impl::local_type LT4; typedef impl::local_type LT5; typedef impl::local_type LT6; typedef impl::local_type LT7; typedef impl::local_type LT8; typedef impl::local_type LT9; typedef typename LT0::type L0; typedef typename LT1::type L1; typedef typename LT2::type L2; typedef typename LT3::type L3; typedef typename LT4::type L4; typedef typename LT5::type L5; typedef typename LT6::type L6; typedef typename LT7::type L7; typedef typename LT8::type L8; typedef typename LT9::type L9; typedef boost::tuples:: tuple local_t; base_closure(); template variable > operator()(closure_member) { return variable >( boost::tuples::get(locals)); } template typename boost::tuples::element::type const& get(closure_member) const { return boost::tuples::get(*ptr); } template typename boost::tuples::element::type& get(closure_member) { return boost::tuples::get(*ptr); } template void set( closure_member, typename boost::tuples::element::type const& val ) const { boost::tuples::get(*ptr) = val; } protected: mutable tuple_t* ptr; local_t locals; }; template < typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9 > class closure : public base_closure { public: typedef base_closure base_closure_t; typedef typename base_closure_t::tuple_t tuple_t; closure(); template closure_parser operator[](parser const& subject) const { return closure_parser(this->ptr, subject.derived()); } }; } # 1 "/usr/include/boost/spirit/attr/impl/closure.ipp" 1 3 namespace spirit { namespace impl { template struct local_saver { local_saver(T*& ptr_) : current(), previous(ptr_), ptr(ptr_) { ptr = ¤t; } template local_saver(T *& ptr_, OtherT const& init) : current(init), previous(ptr_), ptr(ptr_) { ptr = ¤t; } ~local_saver() { ptr = previous; } T current; T* previous; T*& ptr; }; } template inline closure_parser::closure_parser( TupleT*& ptr_, ParserT const& parser) : unary(parser), ptr(ptr_) { } template template inline attr_match::type, typename ParsePolicyT::match_t> closure_parser::do_parse( IteratorT& first, IteratorT const& last) const { # 130 "/usr/include/boost/spirit/attr/impl/closure.ipp" 3 impl::local_saver l(ptr); attr_match hit ( this->subject().template do_parse(first, last), boost::tuples::get<0>(*ptr)); return hit; } namespace impl { template struct parser_return, ParsePolicyT> { typedef attr_match::type, typename ParsePolicyT::match_t> match_t; }; } template inline local::local(TupleT*& ptr_) : ptr(ptr_) {} template inline local::operator typename boost::tuples::element::type&() const { return get(); } template inline local& local::operator=(type const& val) { get() = val; return *this; } template inline local::type& local::get() const { (( ptr ) ? (void)0 : __assert("/usr/include/boost/spirit/attr/impl/closure.ipp", 184, "ptr")) ; return boost::tuples::get(*ptr); } namespace impl { template inline local_type::type local_type::init(TupleT*& ptr) { return type(ptr); } template inline nil_t local_type::init(TupleT*) { return nil_t(); } } template < typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9 > inline base_closure::base_closure() : ptr(0), locals( LT0::init(ptr), LT1::init(ptr), LT2::init(ptr), LT3::init(ptr), LT4::init(ptr), LT5::init(ptr), LT6::init(ptr), LT7::init(ptr), LT8::init(ptr), LT9::init(ptr) ) { } template < typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9 > inline closure::closure() { } } # 398 "/usr/include/boost/spirit/attr/closure.hpp" 2 3 # 57 "/usr/include/boost/spirit/spirit_attr.hpp" 2 3 # 1 "/usr/include/boost/spirit/attr/attr_rule.hpp" 1 3 namespace spirit { template struct param_parser : public unary, public parser > { typedef TupleT tuple_t; typedef typename boost::tuples::element<0, TupleT>::type return_t; typedef param_parser_category parser_category; param_parser(InitTupleT const& init, TupleT *&ptr, ParserT const& parser); template attr_match do_parse(IteratorT& first, IteratorT const& last) const; template attr_action, ActionT> operator[](ActionT const& actor) const { typedef attr_action< param_parser, ActionT> actor_t; return actor_t(*this, actor); } private: TupleT *&ptr; InitTupleT init; }; template struct param_parser_gen { param_parser_gen(TupleT *& ptr_, ParserT const& parser_); template param_parser< TupleT, ParserT, typename boost::tuples::detail:: make_tuple_mapper::type > operator() (T0 const& t0); template param_parser< TupleT, ParserT, typename boost::tuples::detail:: make_tuple_mapper::type > operator() (T0 const& t0, T1 const& t1); template param_parser< TupleT, ParserT, typename boost::tuples::detail:: make_tuple_mapper::type > operator() (T0 const& t0, T1 const& t1, T2 const& t2); template param_parser< TupleT, ParserT, typename boost::tuples::detail:: make_tuple_mapper::type > operator() (T0 const& t0, T1 const& t1, T2 const& t2, T3 const& t3); template param_parser< TupleT, ParserT, typename boost::tuples::detail:: make_tuple_mapper::type > operator() (T0 const& t0, T1 const& t1, T2 const& t2, T3 const& t3, T4 const& t4); template < typename T0, typename T1, typename T2, typename T3, typename T4, typename T5 > param_parser< TupleT, ParserT, typename boost::tuples::detail:: make_tuple_mapper::type > operator() (T0 const& t0, T1 const& t1, T2 const& t2, T3 const& t3, T4 const& t4, T5 const& t5); template < typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6 > param_parser< TupleT, ParserT, typename boost::tuples::detail:: make_tuple_mapper::type > operator() (T0 const& t0, T1 const& t1, T2 const& t2, T3 const& t3, T4 const& t4, T5 const& t5, T6 const& t6); template < typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7 > param_parser< TupleT, ParserT, typename boost::tuples::detail:: make_tuple_mapper::type > operator() (T0 const& t0, T1 const& t1, T2 const& t2, T3 const& t3, T4 const& t4, T5 const& t5, T6 const& t6, T7 const& t7); template < typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8 > param_parser< TupleT, ParserT, typename boost::tuples::detail:: make_tuple_mapper::type > operator() (T0 const& t0, T1 const& t1, T2 const& t2, T3 const& t3, T4 const& t4, T5 const& t5, T6 const& t6, T7 const& t7, T8 const& t8); template < typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9 > param_parser< TupleT, ParserT, typename boost::tuples::detail:: make_tuple_mapper::type > operator() (T0 const& t0, T1 const& t1, T2 const& t2, T3 const& t3, T4 const& t4, T5 const& t5, T6 const& t6, T7 const& t7, T8 const& t8, T9 const& t9); private: TupleT*& ptr; ParserT const& parser; }; template struct attr_rule : public base_rule >, public ClosureT::base_closure_t { typedef attr_rule this_t; typedef base_rule rule_t; typedef typename ClosureT::base_closure_t closure_t; typedef typename closure_t::tuple_t tuple_t; typedef typename boost::tuples::element<0, tuple_t>::type return_t; typedef closure_parser_category parser_category; attr_rule(); explicit attr_rule(rule_id const& id); attr_rule(this_t const& other); attr_rule(rule_t const& other); template attr_rule(parser const& parser); ~attr_rule(); template attr_match do_parse(IteratorT2& first, IteratorT2 const& last) const; attr_rule& operator=(attr_rule const& other); attr_rule& operator=(rule_t const& other); template attr_rule& operator=(ParserT const& parser); template variable > operator()(closure_member cm) { return closure_t::operator()(cm); } template attr_action operator[](ActionT const& actor) const { typedef attr_action< this_t, ActionT> actor_t; return actor_t(*this, actor); } rule_t const& rule_base() const { return *static_cast(this); } param_parser_gen init; }; template struct embed_trait > { typedef attr_rule const& type; }; } # 1 "/usr/include/boost/spirit/attr/impl/attr_rule.ipp" 1 3 namespace spirit { template inline param_parser::param_parser( InitTupleT const &init_, TupleT *&ptr_, ParserT const& parser) : unary(parser), init(init_), ptr(ptr_) { } template template inline attr_match::type, typename ParsePolicyT::match_t> param_parser::do_parse( IteratorT& first, IteratorT const& last) const { # 85 "/usr/include/boost/spirit/attr/impl/attr_rule.ipp" 3 impl::local_saver l(ptr, init); attr_match hit( this->subject().template do_parse(first, last), boost::tuples::get<0>(*ptr)); return hit; } namespace impl { template struct parser_return, ParsePolicyT> { typedef attr_match::type, typename ParsePolicyT::match_t> match_t; }; } template param_parser_gen ::param_parser_gen(TupleT *& ptr_, ParserT const &parser_) : ptr(ptr_), parser(parser_) { } template template inline param_parser< TupleT, ParserT, typename boost::tuples::detail::make_tuple_mapper::type > param_parser_gen ::operator()(T0 const &t0) { typedef typename boost::tuples::detail::make_tuple_mapper::type init_tuple_t; return param_parser( boost::tuples::make_tuple(t0), ptr, parser); } template template inline param_parser< TupleT, ParserT, typename boost::tuples::detail::make_tuple_mapper::type > param_parser_gen ::operator()(T0 const &t0, T1 const &t1) { typedef typename boost::tuples::detail::make_tuple_mapper::type init_tuple_t; return param_parser( boost::tuples::make_tuple(t0, t1), ptr, parser); } template template inline param_parser< TupleT, ParserT, typename boost::tuples::detail::make_tuple_mapper::type > param_parser_gen ::operator()(T0 const &t0, T1 const &t1, T2 const &t2) { typedef typename boost::tuples::detail::make_tuple_mapper::type init_tuple_t; return param_parser( boost::tuples::make_tuple(t0, t1, t2), ptr, parser); } template template inline param_parser< TupleT, ParserT, typename boost::tuples::detail::make_tuple_mapper::type > param_parser_gen ::operator()(T0 const &t0, T1 const &t1, T2 const &t2, T3 const &t3) { typedef typename boost::tuples::detail::make_tuple_mapper::type init_tuple_t; return param_parser( boost::tuples::make_tuple(t0, t1, t2, t3), ptr, parser); } template template inline param_parser< TupleT, ParserT, typename boost::tuples::detail::make_tuple_mapper< T0, T1, T2, T3, T4>::type > param_parser_gen ::operator()(T0 const &t0, T1 const &t1, T2 const &t2, T3 const &t3, T4 const &t4) { typedef typename boost::tuples::detail::make_tuple_mapper< T0, T1, T2, T3, T4>::type init_tuple_t; return param_parser( boost::tuples::make_tuple(t0, t1, t2, t3, t4), ptr, parser); } template template < typename T0, typename T1, typename T2, typename T3, typename T4, typename T5 > inline param_parser< TupleT, ParserT, typename boost::tuples::detail::make_tuple_mapper< T0, T1, T2, T3, T4, T5>::type > param_parser_gen ::operator()(T0 const &t0, T1 const &t1, T2 const &t2, T3 const &t3, T4 const &t4, T5 const &t5) { typedef typename boost::tuples::detail::make_tuple_mapper< T0, T1, T2, T3, T4, T5>::type init_tuple_t; return param_parser( boost::tuples::make_tuple(t0, t1, t2, t3, t4, t5), ptr, parser); } template template < typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6 > inline param_parser< TupleT, ParserT, typename boost::tuples::detail::make_tuple_mapper< T0, T1, T2, T3, T4, T5, T6>::type > param_parser_gen ::operator()(T0 const &t0, T1 const &t1, T2 const &t2, T3 const &t3, T4 const &t4, T5 const &t5, T6 const &t6) { typedef typename boost::tuples::detail::make_tuple_mapper< T0, T1, T2, T3, T4, T5, T6>::type init_tuple_t; return param_parser( boost::tuples::make_tuple(t0, t1, t2, t3, t4, t5, t6), ptr, parser); } template template < typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7 > inline param_parser< TupleT, ParserT, typename boost::tuples::detail::make_tuple_mapper< T0, T1, T2, T3, T4, T5, T6, T7>::type > param_parser_gen ::operator()(T0 const &t0, T1 const &t1, T2 const &t2, T3 const &t3, T4 const &t4, T5 const &t5, T6 const &t6, T7 const &t7) { typedef typename boost::tuples::detail::make_tuple_mapper< T0, T1, T2, T3, T4, T5, T6, T7>::type init_tuple_t; return param_parser( boost::tuples::make_tuple(t0, t1, t2, t3, t4, t5, t6, t7), ptr, parser); } template template < typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8 > inline param_parser< TupleT, ParserT, typename boost::tuples::detail::make_tuple_mapper< T0, T1, T2, T3, T4, T5, T6, T7, T8>::type > param_parser_gen ::operator()(T0 const &t0, T1 const &t1, T2 const &t2, T3 const &t3, T4 const &t4, T5 const &t5, T6 const &t6, T7 const &t7, T8 const &t8) { typedef typename boost::tuples::detail::make_tuple_mapper< T0, T1, T2, T3, T4, T5, T6, T7, T8>::type init_tuple_t; return param_parser( boost::tuples::make_tuple(t0, t1, t2, t3, t4, t5, t6, t7, t8), ptr, parser); } template template < typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9 > inline param_parser< TupleT, ParserT, typename boost::tuples::detail::make_tuple_mapper< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>::type > param_parser_gen ::operator()(T0 const &t0, T1 const &t1, T2 const &t2, T3 const &t3, T4 const &t4, T5 const &t5, T6 const &t6, T7 const &t7, T8 const &t8, T9 const &t9) { typedef typename boost::tuples::detail::make_tuple_mapper< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>::type init_tuple_t; return param_parser( boost::tuples::make_tuple(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9), ptr, parser); } template inline attr_rule::attr_rule() : init(this->ptr, rule_base()) { } template inline attr_rule::attr_rule(rule_id const& id) : rule_t(id), init(this->ptr, rule_base()) { } template inline attr_rule ::attr_rule(attr_rule const& other) : rule_t(static_cast(other)), init(this->ptr, rule_base()) { } template inline attr_rule ::attr_rule(rule_t const& other) : rule_t(other), init(this->ptr, rule_base()) { } template template inline attr_rule ::attr_rule(parser const& parser) : rule_t(parser), init(this->ptr, rule_base()) { } template inline attr_rule::~attr_rule() { } template template inline attr_match< typename boost::tuples::element<0, typename ClosureT::base_closure_t::tuple_t>::type, typename ParsePolicyT::match_t > attr_rule ::do_parse(IteratorT2& first, IteratorT2 const& last) const { typedef closure_parser closure_parser_t; return closure_parser_t(this->ptr, rule_base()).template do_parse(first, last); } namespace impl { template struct parser_return, ParsePolicyT> { typedef attr_match::type, typename ParsePolicyT::match_t> match_t; }; } template inline attr_rule& attr_rule ::operator=(attr_rule const& other) { if (this != &other) *static_cast(this) = other; return *this; } template inline attr_rule& attr_rule ::operator=(rule_t const& other) { *static_cast(this) = other; return *this; } template template inline attr_rule& attr_rule ::operator=(ParserT const& parser) { *static_cast(this) = parser; return *this; } } # 318 "/usr/include/boost/spirit/attr/attr_rule.hpp" 2 3 # 58 "/usr/include/boost/spirit/spirit_attr.hpp" 2 3 # 1 "/usr/include/boost/spirit/attr/semantics.hpp" 1 3 namespace spirit { template struct semantic_expression { typedef DerivedT derived_t; DerivedT& derived(); DerivedT const& derived() const; template void operator()(ArgT const& val) const; template void operator()(IteratorT const& begin, IteratorT const& end) const; }; template struct parser_argument : public semantic_expression > { typedef T const& result_type; typedef T const& argument_type; T const& eval(T const& val) const; }; template struct value : public semantic_expression > { typedef T const& result_type; typedef T const& argument_type; value(T const& val); template T const& eval(ArgT const& arg) const; T const val; }; template value const val(T const& v); namespace impl { template struct arg_of_2; template struct arg_of_3; template struct arg_of_4; } template struct binary_sexpr : public binary, public semantic_expression > { typedef RT result_type; typedef typename impl::arg_of_2::type argument_type; binary_sexpr(A const& a, B const& b); template RT eval(ArgT const& arg) const; }; template struct unary_sexpr : public unary, public semantic_expression > { typedef RT result_type; typedef typename A::argument_type argument_type; unary_sexpr(A const& a); template RT eval(ArgT const& arg) const; }; template struct sequence_sexpr; template struct if_else_sexpr; template struct if_sexpr; template struct while_sexpr; template struct for_sexpr; namespace impl { # 261 "/usr/include/boost/spirit/attr/semantics.hpp" 3 template struct bool_t {}; template struct sexpr_ { typedef typename T::derived_t type; static type get(T const& x) { return type(x.derived()); } }; template struct sexpr_ > { typedef value type; static type get(T const& x) { return type(x); } }; template struct is_sexpr { typedef bool_t< boost::is_convertible*>::value > type; }; template struct sexpr : public sexpr_::type> {}; } template < typename A, typename B, typename FuncT, typename RT = typename impl::sexpr::type::result_type> struct make_binary_sexpr; template < typename A, typename FuncT, typename RT = typename impl::sexpr::type::result_type> struct make_unary_sexpr; namespace impl { struct do_assign; } template struct variable_access { operator ElementT&() const; operator ActualT&() const; }; template struct variable_access { operator ElementT&() const; }; template class variable : public variable_access< variable, T, typename boost::remove_reference::type>::type >, public semantic_expression > { public: typedef T value_type; typedef typename remove_wrap::type actual_ref; typedef typename boost::remove_reference::type actual_type; typedef actual_type& result_type; typedef actual_type const& argument_type; explicit variable(T& ref); T& get() const; template void operator()(ArgT const& val) const; template void operator()(IteratorT const& begin, IteratorT const& end) const; template result_type eval(ArgT const& arg) const; template typename make_binary_sexpr, B, impl::do_assign>::type operator=(B const& rhs) const { return make_binary_sexpr, B, impl::do_assign> ::gen(*this, rhs); } private: T& ref; }; template variable const ref(T& t); template variable const & ref(variable const &t); namespace impl { struct do_plus_assign; struct do_minus_assign; struct do_times_assign; struct do_divide_assign; struct do_mod_assign; struct do_shift_left_assign; struct do_shift_right_assign; struct do_bit_and_assign; struct do_bit_or_assign; struct do_bit_xor_assign; } template typename make_binary_sexpr::type operator+=(semantic_expression const& lhs, B const& rhs); template typename make_binary_sexpr::type operator-=(semantic_expression const& lhs, B const& rhs); template typename make_binary_sexpr::type operator*=(semantic_expression const& lhs, B const& rhs); template typename make_binary_sexpr::type operator/=(semantic_expression const& lhs, B const& rhs); template typename make_binary_sexpr::type operator%=(semantic_expression const& lhs, B const& rhs); template typename make_binary_sexpr::type operator<<=(semantic_expression const& lhs, B const& rhs); template typename make_binary_sexpr::type operator>>=(semantic_expression const& lhs, B const& rhs); template typename make_binary_sexpr::type operator&=(semantic_expression const& lhs, B const& rhs); template typename make_binary_sexpr::type operator|=(semantic_expression const& lhs, B const& rhs); template typename make_binary_sexpr::type operator^=(semantic_expression const& lhs, B const& rhs); template struct make_unary_sexpr_rval : public make_unary_sexpr::type::result_type>::type> {}; namespace impl { struct do_pre_increment; struct do_pre_decrement; struct do_post_increment; struct do_post_decrement; } template typename make_unary_sexpr::type operator++(semantic_expression const& a); template typename make_unary_sexpr::type operator--(semantic_expression const& a); template typename make_unary_sexpr_rval::type operator++(semantic_expression const& a, int); template typename make_unary_sexpr_rval::type operator--(semantic_expression const& a, int); template struct make_binary_sexpr_rval : public make_binary_sexpr::type::result_type>::type> {}; namespace impl { struct do_plus; struct do_minus; struct do_times; struct do_divide; struct do_mod; struct do_shift_left; struct do_shift_right; struct do_bit_and; struct do_bit_or; struct do_bit_xor; } template typename make_binary_sexpr_rval::type operator+(semantic_expression const& lhs, B const& rhs); template typename make_binary_sexpr_rval::type operator-(semantic_expression const& lhs, B const& rhs); template typename make_binary_sexpr_rval::type operator*(semantic_expression const& lhs, B const& rhs); template typename make_binary_sexpr_rval::type operator/(semantic_expression const& lhs, B const& rhs); template typename make_binary_sexpr_rval::type operator%(semantic_expression const& lhs, B const& rhs); template typename make_binary_sexpr_rval::type operator<<(semantic_expression const& lhs, B const& rhs); template typename make_binary_sexpr_rval::type operator>>(semantic_expression const& lhs, B const& rhs); template typename make_binary_sexpr_rval::type operator&(semantic_expression const& lhs, B const& rhs); template typename make_binary_sexpr_rval::type operator|(semantic_expression const& lhs, B const& rhs); template typename make_binary_sexpr_rval::type operator^(semantic_expression const& lhs, B const& rhs); namespace impl { struct do_negate; struct do_complement; } template typename make_unary_sexpr_rval::type operator-(semantic_expression const& a); template typename make_unary_sexpr_rval::type operator~(semantic_expression const& a); namespace impl { struct do_logical_and; struct do_logical_or; struct do_equal; struct do_not_equal; struct do_less_than; struct do_less_than_equal; struct do_greater_than; struct do_greater_than_equal; } template typename make_binary_sexpr::type operator&&(semantic_expression const& lhs, B const& rhs); template typename make_binary_sexpr::type operator||(semantic_expression const& lhs, B const& rhs); template typename make_binary_sexpr::type operator==(semantic_expression const& lhs, B const& rhs); template typename make_binary_sexpr::type operator!=(semantic_expression const& lhs, B const& rhs); template typename make_binary_sexpr::type operator<(semantic_expression const& lhs, B const& rhs); template typename make_binary_sexpr::type operator<=(semantic_expression const& lhs, B const& rhs); template typename make_binary_sexpr::type operator>(semantic_expression const& lhs, B const& rhs); template typename make_binary_sexpr::type operator>=(semantic_expression const& lhs, B const& rhs); namespace impl { struct do_not; template struct do_c_cast; template struct do_const_cast; template struct do_static_cast; template struct do_reinterpret_cast; template struct do_dynamic_cast; template struct do_parsing_cast; } template typename make_unary_sexpr::type operator!(semantic_expression const& a); template typename make_unary_sexpr, TargetT>::type semantic_c_cast(semantic_expression const& a); template typename make_unary_sexpr, TargetT>::type semantic_const_cast(semantic_expression const& a); template typename make_unary_sexpr, TargetT>::type semantic_static_cast(semantic_expression const& a); template typename make_unary_sexpr, TargetT>::type semantic_reinterpret_cast(semantic_expression const& a); template typename make_unary_sexpr, TargetT>::type semantic_dynamic_cast(semantic_expression const& a); template typename make_unary_sexpr, typename ParserT::return_t>::type parsing_cast(semantic_expression const& a); template struct sequence_sexpr : public binary, public semantic_expression > { typedef typename A::result_type result_type; typedef typename impl::arg_of_2::type argument_type; sequence_sexpr(A const& a, B const& b); template result_type eval(ArgT const& arg) const; }; template sequence_sexpr operator,( semantic_expression const& lhs, semantic_expression const& rhs); template struct if_else_sexpr : public binary >, public semantic_expression > { typedef typename ThenT::result_type result_type; typedef typename impl::arg_of_3::type argument_type; if_else_sexpr(CondT const& cond, ThenT const& then, ElseT const& else_); template result_type eval(ArgT const& arg) const; }; template struct if_sexpr : public binary, public semantic_expression > { typedef bool result_type; typedef typename impl::arg_of_2::type argument_type; if_sexpr(CondT const& cond, ThenT const& then); template if_else_sexpr::type> else_(ElseT const& else_); template bool eval(ArgT const& arg) const; }; template struct if_gen : public unary { if_gen(CondT const& cond); template if_sexpr::type> operator()(ThenT const& then); }; template if_gen::type> if_(CondT const& cond); template struct while_sexpr : public binary, public semantic_expression > { typedef bool result_type; typedef typename impl::arg_of_2::type argument_type; while_sexpr(CondT const& cond, DoT const& do_); template bool eval(ArgT const& arg) const; }; template struct while_gen : public unary { while_gen(CondT const& cond); template while_sexpr::type> operator()(DoT const& do_); }; template while_gen::type> while_(CondT const& cond); template struct for_sexpr : public binary, binary >, public semantic_expression > { typedef bool result_type; typedef typename impl::arg_of_4::type argument_type; for_sexpr(InitT const& init, CondT const& cond, IncrT const& incr, DoT const& do_); template bool eval(ArgT const& arg) const; }; template struct for_gen : public binary, IncrT> { for_gen(InitT const& init, CondT const& cond, IncrT const& incr); template for_sexpr::type> operator()(DoT const& do_); }; template for_gen< typename impl::sexpr::type, typename impl::sexpr::type, typename impl::sexpr::type > for_(InitT const& init, CondT const& cond, IncrT const& incr); namespace impl { struct do_print; } template typename make_unary_sexpr::type cout_(T const& a); template < typename A, typename FuncT, typename RT > struct make_unary_sexpr { typedef unary_sexpr::type, FuncT, RT> type; static type gen(A const& a); }; template < typename A, typename B, typename FuncT, typename RT > struct make_binary_sexpr { typedef binary_sexpr< typename impl::sexpr::type, typename impl::sexpr::type, FuncT, RT> type; static type gen(A const& lhs, B const& rhs); }; } # 1 "/usr/include/boost/spirit/attr/impl/semantics.ipp" 1 3 namespace spirit { namespace impl { template struct arg_of_2 { typedef A sexpr_t; typedef typename A::argument_type type; }; template struct arg_of_2 > { typedef parser_argument sexpr_t; typedef typename sexpr_t::argument_type type; }; template struct arg_of_3 { typedef typename arg_of_2< A, typename arg_of_2::sexpr_t>::type type; }; template struct arg_of_4 { typedef typename arg_of_2< typename arg_of_2::sexpr_t, typename arg_of_2::sexpr_t>::type type; }; } template inline DerivedT& semantic_expression::derived() { return *static_cast(this); } template inline DerivedT const& semantic_expression::derived() const { return *static_cast(this); } template template inline void semantic_expression::operator()(ArgT const& arg) const { this->derived().eval(arg); } template template inline void semantic_expression::operator() (IteratorT const& begin, IteratorT const& end) const { std::pair iter_pair(begin, end); this->derived().eval(iter_pair); } template inline T const& parser_argument::eval(T const& arg) const { return arg; } template inline value::value(T const& val_) : val(val_) {} template template inline T const& value::eval(ArgT const& ) const { return val; } template inline value const val(T const& v) { return value(v); } template inline unary_sexpr::unary_sexpr(A const& a) : unary(a) {} template template inline RT unary_sexpr::eval(ArgT const& arg) const { return FuncT::apply(this->subject().eval(arg)); } template inline unary_sexpr::type, FuncT, RT> make_unary_sexpr::gen(A const& a) { return type(impl::sexpr::get(a)); } template inline binary_sexpr ::binary_sexpr(A const& a, B const& b) : binary(a, b) {} template template inline RT binary_sexpr::eval(ArgT const& arg) const { return FuncT::apply(this->left().eval(arg), this->right().eval(arg)); } template inline binary_sexpr< typename impl::sexpr::type, typename impl::sexpr::type, FuncT, RT > make_binary_sexpr::gen(A const& lhs, B const& rhs) { return type(impl::sexpr::get(lhs), impl::sexpr::get(rhs)); } namespace impl { struct do_assign { template static A& apply(A& a, B const& b) { return a = b; } }; struct do_plus_assign { template static A& apply(A& a, B const& b) { return a += b; } }; struct do_minus_assign { template static A& apply(A& a, B const& b) { return a -= b; } }; struct do_times_assign { template static A& apply(A& a, B const& b) { return a *= b; } }; struct do_divide_assign { template static A& apply(A& a, B const& b) { return a /= b; } }; struct do_mod_assign { template static A& apply(A& a, B const& b) { return a %= b; } }; struct do_shift_left_assign { template static A& apply(A& a, B const& b) { return a <<= b; } }; struct do_shift_right_assign { template static A& apply(A& a, B const& b) { return a >>= b; } }; struct do_bit_and_assign { template static A& apply(A& a, B const& b) { return a &= b; } }; struct do_bit_or_assign { template static A& apply(A& a, B const& b) { return a |= b; } }; struct do_bit_xor_assign { template static A& apply(A& a, B const& b) { return a ^= b; } }; struct do_plus { template static A apply(A const& a, B const& b) { return a + b; } }; struct do_minus { template static A apply(A const& a, B const& b) { return a - b; } }; struct do_times { template static A apply(A const& a, B const& b) { return a * b; } }; struct do_divide { template static A apply(A const& a, B const& b) { return a / b; } }; struct do_mod { template static A apply(A const& a, B const& b) { return a % b; } }; struct do_shift_left { template static A apply(A const& a, B const& b) { return a << b; } }; struct do_shift_right { template static A apply(A const& a, B const& b) { return a >> b; } }; struct do_bit_and { template static A apply(A const& a, B const& b) { return a & b; } }; struct do_bit_or { template static A apply(A const& a, B const& b) { return a | b; } }; struct do_bit_xor { template static A apply(A const& a, B const& b) { return a ^ b; } }; struct do_negate { template static A apply(A const& a) { return -a; } }; struct do_complement { template static A apply(A const& a) { return ~a; } }; struct do_pre_increment { template static A& apply(A& a) { return ++a; } }; struct do_pre_decrement { template static A& apply(A& a) { return --a; } }; struct do_post_increment { template static A apply(A& a) { A t(a); ++a; return t; } }; struct do_post_decrement { template static A apply(A& a) { A t(a); --a; return t; } }; struct do_logical_and { template static bool apply(A const& a, B const& b) { return a && b; } }; struct do_logical_or { template static bool apply(A const& a, B const& b) { return a || b; } }; struct do_equal { template static bool apply(A const& a, B const& b) { return a == b; } }; struct do_not_equal { template static bool apply(A const& a, B const& b) { return a != b; } }; struct do_less_than { template static bool apply(A const& a, B const& b) { return a < b; } }; struct do_less_than_equal { template static bool apply(A const& a, B const& b) { return a <= b; } }; struct do_greater_than { template static bool apply(A const& a, B const& b) { return a > b; } }; struct do_greater_than_equal { template static bool apply(A const& a, B const& b) { return a >= b; } }; struct do_not { template static bool apply(A const& a) { return !a; } }; struct do_print { template static A& apply(A& a) { std::cout << a; return a; } }; template struct do_c_cast { template static TargetT apply(A &a) { return (TargetT)a; } }; template struct do_const_cast { template static TargetT apply(A &a) { return const_cast(a); } }; template struct do_static_cast { template static TargetT apply(A &a) { return static_cast(a); } }; template struct do_reinterpret_cast { template static TargetT apply(A &a) { return reinterpret_cast(a); } }; template struct do_dynamic_cast { template static TargetT apply(A &a) { return dynamic_cast(a); } }; template struct do_parsing_cast { template static typename ParserT::return_t apply(TokenT const &token) { typedef typename ParserT::return_t return_t; typedef typename TokenT::const_iterator_t const_iterator_t; return_t result = return_t(); const_iterator_t first = token.begin(); parse (first, token.end(), ParserT()[ref(result)]); return result; } }; } template variable_access::operator ElementT&() const { return static_cast(this)->get(); } template variable_access::operator ActualT&() const { return static_cast(this)->get(); } template variable_access::operator ElementT&() const { return static_cast(this)->get(); } template inline variable const ref(T& t) { return variable(t); } template inline variable const & ref(variable const &t) { return t; } template inline variable::variable(T& ref_) : ref(ref_) {} template inline T& variable::get() const { return ref; } template template inline void variable::operator()(ArgT const& val) const { ref = val; } template template inline void variable::operator()(IteratorT const& begin, IteratorT const& end) const { actual_type temp(begin, end); actual_type& aref = ref; aref.swap(temp); } template template inline typename boost::remove_reference::type>::type& variable::eval(ArgT const& ) const { return ref; } template inline typename make_binary_sexpr::type operator+=(semantic_expression const& lhs, B const& rhs) { return make_binary_sexpr ::gen(lhs.derived(), rhs); } template inline typename make_binary_sexpr::type operator-=(semantic_expression const& lhs, B const& rhs) { return make_binary_sexpr ::gen(lhs.derived(), rhs); } template inline typename make_binary_sexpr::type operator*=(semantic_expression const& lhs, B const& rhs) { return make_binary_sexpr ::gen(lhs.derived(), rhs); } template inline typename make_binary_sexpr::type operator/=(semantic_expression const& lhs, B const& rhs) { return make_binary_sexpr ::gen(lhs.derived(), rhs); } template inline typename make_binary_sexpr::type operator%=(semantic_expression const& lhs, B const& rhs) { return make_binary_sexpr ::gen(lhs.derived(), rhs); } template inline typename make_binary_sexpr::type operator<<=(semantic_expression const& lhs, B const& rhs) { return make_binary_sexpr ::gen(lhs.derived(), rhs); } template inline typename make_binary_sexpr::type operator>>=(semantic_expression const& lhs, B const& rhs) { return make_binary_sexpr ::gen(lhs.derived(), rhs); } template inline typename make_binary_sexpr::type operator&=(semantic_expression const& lhs, B const& rhs) { return make_binary_sexpr ::gen(lhs.derived(), rhs); } template inline typename make_binary_sexpr::type operator|=(semantic_expression const& lhs, B const& rhs) { return make_binary_sexpr ::gen(lhs.derived(), rhs); } template inline typename make_binary_sexpr::type operator^=(semantic_expression const& lhs, B const& rhs) { return make_binary_sexpr ::gen(lhs.derived(), rhs); } template inline typename make_unary_sexpr::type operator++(semantic_expression const& a) { return make_unary_sexpr::gen(a.derived()); } template inline typename make_unary_sexpr::type operator--(semantic_expression const& a) { return make_unary_sexpr::gen(a.derived()); } template inline typename make_unary_sexpr_rval::type operator++(semantic_expression const& a, int) { return make_unary_sexpr_rval::gen(a.derived()); } template inline typename make_unary_sexpr_rval::type operator--(semantic_expression const& a, int) { return make_unary_sexpr_rval::gen(a.derived()); } template inline typename make_binary_sexpr_rval::type operator+(semantic_expression const& lhs, B const& rhs) { return make_binary_sexpr_rval ::gen(lhs.derived(), rhs); } template inline typename make_binary_sexpr_rval::type operator-(semantic_expression const& lhs, B const& rhs) { return make_binary_sexpr_rval ::gen(lhs.derived(), rhs); } template inline typename make_binary_sexpr_rval::type operator*(semantic_expression const& lhs, B const& rhs) { return make_binary_sexpr_rval ::gen(lhs.derived(), rhs); } template inline typename make_binary_sexpr_rval::type operator/(semantic_expression const& lhs, B const& rhs) { return make_binary_sexpr_rval ::gen(lhs.derived(), rhs); } template inline typename make_binary_sexpr_rval::type operator%(semantic_expression const& lhs, B const& rhs) { return make_binary_sexpr_rval ::gen(lhs.derived(), rhs); } template inline typename make_binary_sexpr_rval::type operator<<(semantic_expression const& lhs, B const& rhs) { return make_binary_sexpr_rval ::gen(lhs.derived(), rhs); } template inline typename make_binary_sexpr_rval::type operator>>(semantic_expression const& lhs, B const& rhs) { return make_binary_sexpr_rval ::gen(lhs.derived(), rhs); } template inline typename make_binary_sexpr_rval::type operator&(semantic_expression const& lhs, B const& rhs) { return make_binary_sexpr_rval ::gen(lhs.derived(), rhs); } template inline typename make_binary_sexpr_rval::type operator|(semantic_expression const& lhs, B const& rhs) { return make_binary_sexpr_rval ::gen(lhs.derived(), rhs); } template inline typename make_binary_sexpr_rval::type operator^(semantic_expression const& lhs, B const& rhs) { return make_binary_sexpr_rval ::gen(lhs.derived(), rhs); } template inline typename make_unary_sexpr_rval::type operator-(semantic_expression const& a) { return make_unary_sexpr_rval ::gen(a.derived()); } template inline typename make_unary_sexpr_rval::type operator~(semantic_expression const& a) { return make_unary_sexpr_rval ::gen(a.derived()); } template inline typename make_binary_sexpr::type operator&&(semantic_expression const& lhs, B const& rhs) { return make_binary_sexpr ::gen(lhs.derived(), rhs); } template inline typename make_binary_sexpr::type operator||(semantic_expression const& lhs, B const& rhs) { return make_binary_sexpr ::gen(lhs.derived(), rhs); } template inline typename make_binary_sexpr::type operator==(semantic_expression const& lhs, B const& rhs) { return make_binary_sexpr ::gen(lhs.derived(), rhs); } template inline typename make_binary_sexpr::type operator!=(semantic_expression const& lhs, B const& rhs) { return make_binary_sexpr ::gen(lhs.derived(), rhs); } template inline typename make_binary_sexpr::type operator<(semantic_expression const& lhs, B const& rhs) { return make_binary_sexpr ::gen(lhs.derived(), rhs); } template inline typename make_binary_sexpr::type operator<=(semantic_expression const& lhs, B const& rhs) { return make_binary_sexpr ::gen(lhs.derived(), rhs); } template inline typename make_binary_sexpr::type operator>(semantic_expression const& lhs, B const& rhs) { return make_binary_sexpr ::gen(lhs.derived(), rhs); } template inline typename make_binary_sexpr::type operator>=(semantic_expression const& lhs, B const& rhs) { return make_binary_sexpr ::gen(lhs.derived(), rhs); } template inline typename make_unary_sexpr::type operator!(semantic_expression const& a) { return make_unary_sexpr ::gen(a.derived()); } template inline typename make_unary_sexpr, TargetT>::type semantic_c_cast(semantic_expression const& a) { return make_unary_sexpr, TargetT> ::gen(a.derived()); } template inline typename make_unary_sexpr, TargetT>::type semantic_const_cast(semantic_expression const& a) { return make_unary_sexpr, TargetT> ::gen(a.derived()); } template inline typename make_unary_sexpr, TargetT>::type semantic_static_cast(semantic_expression const& a) { return make_unary_sexpr, TargetT> ::gen(a.derived()); } template inline typename make_unary_sexpr, TargetT>::type semantic_reinterpret_cast(semantic_expression const& a) { return make_unary_sexpr, TargetT>::gen(a.derived()); } template inline typename make_unary_sexpr, TargetT>::type semantic_dynamic_cast(semantic_expression const& a) { return make_unary_sexpr, TargetT>::gen(a.derived()); } template inline typename make_unary_sexpr, typename ParserT::return_t>::type parsing_cast(semantic_expression const& a) { return make_unary_sexpr, typename ParserT::return_t>::gen(a.derived()); } template inline sequence_sexpr::sequence_sexpr(A const& a, B const& b) : binary(a, b) {} template template inline typename A::result_type sequence_sexpr::eval(ArgT const& arg) const { typename A::result_type r = this->left().eval(arg); this->right().eval(arg); return r; } template inline sequence_sexpr operator,( semantic_expression const& lhs, semantic_expression const& rhs) { return sequence_sexpr(lhs.derived(), rhs.derived()); } template inline if_else_sexpr ::if_else_sexpr(CondT const& cond, ThenT const& then, ElseT const& else_) : binary > (cond, binary(then, else_)) {} template template inline typename ThenT::result_type if_else_sexpr::eval(ArgT const& arg) const { if (bool(this->left().eval(arg))) return this->right().left().eval(arg); else return this->right().right().eval(arg); } template if_sexpr::if_sexpr(CondT const& cond, ThenT const& then) : binary(cond, then) {} template template if_else_sexpr::type> if_sexpr::else_(ElseT const& else_) { return if_else_sexpr::type> (this->left(), this->right(), impl::sexpr::get(else_)); } template template inline bool if_sexpr::eval(ArgT const& arg) const { if (bool(this->left().eval(arg))) { this->right().eval(arg); return true; } return false; } template inline if_gen::if_gen(CondT const& cond) : unary(cond) {} template template inline if_sexpr::type> if_gen::operator()(ThenT const& then) { return if_sexpr::type> (this->subject(), impl::sexpr::get(then)); } template inline if_gen::type> if_(CondT const& cond) { return if_gen::type> (impl::sexpr::get(cond)); } template while_sexpr::while_sexpr(CondT const& cond, DoT const& do_) : binary(cond, do_) {} template template inline bool while_sexpr::eval(ArgT const& arg) const { while (bool(this->left().eval(arg))) this->right().eval(arg); return false; } template inline while_gen::while_gen(CondT const& cond) : unary(cond) {} template template inline while_sexpr::type> while_gen::operator()(DoT const& do_) { return while_sexpr::type> (this->subject(), impl::sexpr::get(do_)); } template inline while_gen::type> while_(CondT const& cond) { return while_gen::type> (impl::sexpr::get(cond)); } template inline for_sexpr ::for_sexpr(InitT const& init, CondT const& cond, IncrT const& incr, DoT const& do_) : binary, binary > (binary(init, cond), binary(incr, do_)) {} template template inline bool for_sexpr::eval(ArgT const& arg) const { for (this->left().left().eval(arg); bool(this->left().right().eval(arg)); this->right().left().eval(arg)) this->right().right().eval(arg); return false; } template for_gen ::for_gen(InitT const& init, CondT const& cond, IncrT const& incr) : binary, IncrT> (binary(init, cond), incr) {} template template inline for_sexpr::type> for_gen::operator()(DoT const& do_) { return for_sexpr::type>( this->left().left(), this->left().right(), this->right(), impl::sexpr::get(do_)); } template inline for_gen< typename impl::sexpr::type, typename impl::sexpr::type, typename impl::sexpr::type > for_(InitT const& init, CondT const& cond, IncrT const& incr) { return for_gen< typename impl::sexpr::type, typename impl::sexpr::type, typename impl::sexpr::type>( impl::sexpr::get(init), impl::sexpr::get(cond), impl::sexpr::get(incr)); } template typename make_unary_sexpr::type cout_(T const& a) { return make_unary_sexpr::gen(a); } } # 982 "/usr/include/boost/spirit/attr/semantics.hpp" 2 3 # 59 "/usr/include/boost/spirit/spirit_attr.hpp" 2 3 # 1 "/usr/include/boost/spirit/attr/grammar.hpp" 1 3 namespace spirit { template struct grammar : public parser { typedef ReturnT return_t; template attr_action operator[](ActionT const& actor) const { return attr_action(this->derived(), actor); } template attr_match do_parse(IteratorT& first, IteratorT const& last) const; }; template struct grammar : public parser { template typename ParsePolicyT::match_t do_parse(IteratorT& first, IteratorT const& last) const; }; } # 1 "/usr/include/boost/spirit/attr/impl/grammar.ipp" 1 3 namespace spirit { template template inline attr_match grammar ::do_parse(IteratorT& first, IteratorT const& last) const { static typename DerivedT::template definition def; return def.start().template do_parse(first, last); } namespace impl { template struct parser_return, ParsePolicyT> { typedef attr_match match_t; }; } template template inline typename ParsePolicyT::match_t grammar ::do_parse(IteratorT& first, IteratorT const& last) const { static typename DerivedT::template definition def; return def.start().template do_parse(first, last); } namespace impl { template struct parser_return, ParsePolicyT> { typedef typename ParsePolicyT::match_t match_t; }; } } # 155 "/usr/include/boost/spirit/attr/grammar.hpp" 2 3 # 60 "/usr/include/boost/spirit/spirit_attr.hpp" 2 3 # 56 "/usr/include/boost/spirit/spirit.hpp" 2 3 # 1 "/usr/include/boost/spirit/spirit_utility.hpp" 1 3 # 1 "/usr/include/boost/spirit/utility/numerics.hpp" 1 3 # 1 "/usr/include/boost/spirit/spirit_utility_fwd.hpp" 1 3 namespace spirit { template class symbols; template struct list_action_iterator; } # 35 "/usr/include/boost/spirit/utility/numerics.hpp" 2 3 namespace spirit { template < typename T = unsigned, int Radix = 10, unsigned MinDigits = 1, int MaxDigits = -1 > struct uint_parser : public parser > { typedef T return_t; typedef uint_parser this_t; template attr_action operator[](ActionT const& actor) const { typedef attr_action action; return action(*this, actor); } template attr_match do_parse(IteratorT& first, IteratorT const& last) const; }; template < typename T = int, int Radix = 10, unsigned MinDigits = 1, int MaxDigits = -1 > struct int_parser : public parser > { typedef T return_t; typedef int_parser this_t; template attr_action operator[](ActionT const& actor) const { typedef attr_action action; return action(*this, actor); } template attr_match do_parse(IteratorT& first, IteratorT const& last) const; }; namespace impl { template struct parser_return, ParsePolicyT> { typedef attr_match match_t; }; template struct parser_return, ParsePolicyT> { typedef attr_match match_t; }; } int_parser const int_p = int_parser(); uint_parser const uint_p = uint_parser(); uint_parser const bin_p = uint_parser(); uint_parser const oct_p = uint_parser(); uint_parser const hex_p = uint_parser(); template struct ureal_parser_policies { template static attr_match parse_n(IteratorT& first, IteratorT const& last) { return uint_parser().template do_parse(first, last); } template static match parse_dot(IteratorT& first, IteratorT const& last) { return ch_p('.').parse(first, last); } template static attr_match parse_frac_n(IteratorT& first, IteratorT const& last) { return uint_parser().template do_parse(first, last); } template static match parse_exp(IteratorT& first, IteratorT const& last) { return nocase_d['e'].parse(first, last); } template static attr_match parse_exp_n(IteratorT& first, IteratorT const& last) { return int_parser().template do_parse(first, last); } }; template struct real_parser_policies : public ureal_parser_policies { template static attr_match parse_n(IteratorT& first, IteratorT const& last) { return int_parser().template do_parse(first, last); } }; template < typename T = double, typename RealPoliciesT = ureal_parser_policies > struct real_parser : public parser > { typedef T return_t; typedef real_parser this_t; template attr_action operator[](ActionT const& actor) const { typedef attr_action action; return action(*this, actor); } template attr_match do_parse(IteratorT& first, IteratorT const& last) const; }; namespace impl { template struct parser_return, ParsePolicyT> { typedef attr_match match_t; }; } real_parser > const ureal_p = real_parser >(); real_parser > const real_p = real_parser >(); } # 1 "/usr/include/boost/spirit/utility/impl/numerics.ipp" 1 3 # 1 "/usr/include/g++-3/cmath" 1 3 # 1 "/usr/include/math.h" 1 3 extern "C" { # 1 "/usr/include/machine/ieeefp.h" 1 3 # 68 "/usr/include/machine/ieeefp.h" 3 # 155 "/usr/include/machine/ieeefp.h" 3 # 10 "/usr/include/math.h" 2 3 union __dmath { __uint32_t i[2]; double d; }; extern __attribute__(( dllimport )) const union __dmath __infinity[]; extern double atan (double) ; extern double cos (double) ; extern double sin (double) ; extern double tan (double) ; extern double tanh (double) ; extern double frexp (double, int *) ; extern double modf (double, double *) ; extern double ceil (double) ; extern double fabs (double) ; extern double floor (double) ; extern double acos (double) ; extern double asin (double) ; extern double atan2 (double, double) ; extern double cosh (double) ; extern double sinh (double) ; extern double exp (double) ; extern double ldexp (double, int) ; extern double log (double) ; extern double log10 (double) ; extern double pow (double, double) ; extern double sqrt (double) ; extern double fmod (double, double) ; extern double infinity (void) ; extern double nan (void) ; extern int isnan (double) ; extern int isinf (double) ; extern int finite (double) ; extern double copysign (double, double) ; extern int ilogb (double) ; extern double asinh (double) ; extern double cbrt (double) ; extern double nextafter (double, double) ; extern double rint (double) ; extern double scalbn (double, int) ; extern double log1p (double) ; extern double expm1 (double) ; extern double acosh (double) ; extern double atanh (double) ; extern double remainder (double, double) ; extern double gamma (double) ; extern double gamma_r (double, int *) ; extern double lgamma (double) ; extern double lgamma_r (double, int *) ; extern double erf (double) ; extern double erfc (double) ; extern double y0 (double) ; extern double y1 (double) ; extern double yn (int, double) ; extern double j0 (double) ; extern double j1 (double) ; extern double jn (int, double) ; extern double hypot (double, double) ; extern double cabs(); extern double drem (double, double) ; extern float atanf (float) ; extern float cosf (float) ; extern float sinf (float) ; extern float tanf (float) ; extern float tanhf (float) ; extern float frexpf (float, int *) ; extern float modff (float, float *) ; extern float ceilf (float) ; extern float fabsf (float) ; extern float floorf (float) ; extern float acosf (float) ; extern float asinf (float) ; extern float atan2f (float, float) ; extern float coshf (float) ; extern float sinhf (float) ; extern float expf (float) ; extern float ldexpf (float, int) ; extern float logf (float) ; extern float log10f (float) ; extern float powf (float, float) ; extern float sqrtf (float) ; extern float fmodf (float, float) ; extern float infinityf (void) ; extern float nanf (void) ; extern int isnanf (float) ; extern int isinff (float) ; extern int finitef (float) ; extern float copysignf (float, float) ; extern int ilogbf (float) ; extern float asinhf (float) ; extern float cbrtf (float) ; extern float nextafterf (float, float) ; extern float rintf (float) ; extern float scalbnf (float, int) ; extern float log1pf (float) ; extern float expm1f (float) ; extern float acoshf (float) ; extern float atanhf (float) ; extern float remainderf (float, float) ; extern float gammaf (float) ; extern float gammaf_r (float, int *) ; extern float lgammaf (float) ; extern float lgammaf_r (float, int *) ; extern float erff (float) ; extern float erfcf (float) ; extern float y0f (float) ; extern float y1f (float) ; extern float ynf (int, float) ; extern float j0f (float) ; extern float j1f (float) ; extern float jnf (int, float) ; extern float hypotf (float, float) ; extern float cabsf(); extern float dremf (float, float) ; extern int *__signgam (void) ; struct __exception { int type; char *name; double arg1; double arg2; double retval; int err; }; extern int matherr (struct __exception *e) ; enum __fdlibm_version { __fdlibm_ieee = -1, __fdlibm_svid, __fdlibm_xopen, __fdlibm_posix }; extern __attribute__(( dllimport )) const enum __fdlibm_version __fdlib_version ; } # 7 "/usr/include/g++-3/cmath" 2 3 #pragma interface "cmath" extern "C++" { # 38 "/usr/include/g++-3/cmath" 3 inline float abs (float x) { return fabs (x); } inline double abs (double x) { return fabs (x); } # 71 "/usr/include/g++-3/cmath" 3 inline long double abs (long double x) { return fabs (x); } } # 35 "/usr/include/boost/spirit/utility/impl/numerics.ipp" 2 3 namespace spirit { namespace impl { template bool extract_sign(IteratorT& iter, unsigned& count) { count = 0; bool neg = *iter == '-'; if (neg || (*iter == '+')) { ++iter; ++count; return neg; } return false; } template struct radix_traits; template<> struct radix_traits<2> { template static bool is_valid(CharT ch) { return ('0' == ch || '1' == ch); } template static int digit(CharT ch) { return ch - '0'; } }; template<> struct radix_traits<8> { template static bool is_valid(CharT ch) { return ('0' <= ch && ch <= '7'); } template static int digit(CharT ch) { return ch - '0'; } }; template<> struct radix_traits<10> { template static bool is_valid(CharT ch) { return isdigit(ch); } template static int digit(CharT ch) { return ch - '0'; } }; template<> struct radix_traits<16> { template static bool is_valid(CharT ch) { return isxdigit(ch); } template static int digit(CharT ch) { if (isdigit(ch)) return ch - '0'; return tolower(ch) - 'a' + 10; } }; template struct positive_accumulate { template static bool check(T const& n, T const& prev) { return n < prev; } template static void add(T& n, CharT ch) { n += radix_traits::digit(ch); } }; template struct negative_accumulate { template static bool check(T const& n, T const& prev) { return n > prev; } template static void add(T& n, CharT ch) { n -= radix_traits::digit(ch); } }; template struct extract_int_base { template static bool body(IteratorT& first, T& n) { T prev = n; n *= Radix; if (Accumulate::check(n, prev)) return false; prev = n; Accumulate::add(n, *first); if (Accumulate::check(n, prev)) return false; return true; } }; template < int Radix, unsigned MinDigits, int MaxDigits, typename Accumulate = positive_accumulate > struct extract_int { typedef extract_int_base base; typedef radix_traits check; template static bool f(IteratorT& first, IteratorT const& last, T& n, unsigned& count) { unsigned i = 0; for (; (i < MaxDigits) && (first != last) && check::is_valid(*first); ++i, ++first, ++count) { if (!base::body(first, n)) return false; } return i >= MinDigits; } }; template struct extract_int { typedef extract_int_base base; typedef radix_traits check; template static bool f(IteratorT& first, IteratorT const& last, T& n, unsigned& count) { unsigned i = 0; for (; (first != last) && check::is_valid(*first); ++i, ++first, ++count) { if (!base::body(first, n)) return false; } return i >= MinDigits; } }; } template template inline attr_match uint_parser::do_parse( IteratorT& first, IteratorT const& last) const { typedef attr_match attr_match; if (first == last) return attr_match(); typedef typename impl::strip_scanner::iterator_type plain_iter; plain_iter i1 = impl::strip_scanner::get(first); plain_iter i2 = impl::strip_scanner::get(last); T n = 0; unsigned count = 0; if (impl::extract_int::f(i1, i2, n, count)) { first = i1; return attr_match(count, n); } return attr_match(); } template template inline attr_match int_parser::do_parse( IteratorT& first, IteratorT const& last) const { typedef attr_match attr_match; if (first == last) return attr_match(); typedef typename impl::strip_scanner::iterator_type plain_iter; plain_iter i1 = impl::strip_scanner::get(first); plain_iter i2 = impl::strip_scanner::get(last); T n = 0; unsigned count = 0; if (impl::extract_sign(i1, count) ? impl::extract_int >::f(i1, i2, n, count) : impl::extract_int::f(i1, i2, n, count)) { first = i1; return attr_match(count, n); } return attr_match(); } template template attr_match real_parser::do_parse( IteratorT& first, IteratorT const& last) const { typedef attr_match sub_match; typedef attr_match attr_match; if (first == last) return attr_match(); typedef typename impl::strip_scanner::iterator_type plain_iter; plain_iter i1 = impl::strip_scanner::get(first); plain_iter i2 = impl::strip_scanner::get(last); sub_match n_match = RealPoliciesT::parse_n(i1, i2); T n = n_match.value(); bool got_a_number = n_match; unsigned count = got_a_number ? n_match.length() : 0; bool neg = n < 0; if (count == 0 && impl::extract_sign(i1, count)) { neg = true; } if (RealPoliciesT::parse_dot(i1, i2)) { if (sub_match hit = RealPoliciesT::parse_frac_n(i1, i2)) { hit.value() *= std::pow(10, static_cast(-hit.length())); if (neg) n -= hit.value(); else n += hit.value(); count += hit.length() + 1; } } else { if (!got_a_number) return attr_match(); } if (match e_hit = RealPoliciesT::parse_exp(i1, i2)) { if (sub_match hit = RealPoliciesT::parse_exp_n(i1, i2)) { n *= std::pow(10, static_cast(hit.value())); count += hit.length() + e_hit.length(); } else { return attr_match(); } } first = i1; return attr_match(count, n); } } # 250 "/usr/include/boost/spirit/utility/numerics.hpp" 2 3 # 54 "/usr/include/boost/spirit/spirit_utility.hpp" 2 3 # 1 "/usr/include/boost/spirit/utility/symbols.hpp" 1 3 namespace spirit { template class tst; template class symbol_inserter; template class symbol_action; template < typename T = int, typename CharT = char, typename SetT = tst > class symbols : private SetT, public parser > { public: typedef T symbol_data_t; symbols(); symbols(symbols const& other); ~symbols(); symbols& operator=(symbols const& other); symbol_inserter const& operator=(CharT const* str); template attr_match do_parse(IteratorT& first, IteratorT const& last) const; template symbol_action, ActionT> operator[](ActionT const& actor) const { return symbol_action, ActionT>(*this, actor); } symbol_inserter const add; }; template T* add(symbols& table, CharT const* sym, T const& data = T()); template T* find(symbols& table, CharT const* sym); template struct embed_trait > { typedef symbols const& type; }; template class symbol_action : public unary, public parser > { public: typedef action_parser_category parser_category; symbol_action(ParserT const& parser, ActionT const& actor); template typename ParsePolicyT::match_t do_parse(IteratorT& first, IteratorT const& last) const; ActionT const &predicate() const { return actor; } private: typename embed_trait::type actor; }; template class symbol_inserter { public: symbol_inserter(SetT& set); template T* operator()( IteratorT first, IteratorT const& last, T const& data = T()) const; template symbol_inserter const& operator,(CharT const* str) const; private: SetT& set; }; } # 1 "/usr/include/boost/spirit/utility/impl/symbols.ipp" 1 3 # 1 "/usr/include/g++-3/memory" 1 3 # 1 "/usr/include/g++-3/stl_tempbuf.h" 1 3 template pair<_Tp*, ptrdiff_t> __get_temporary_buffer(ptrdiff_t __len, _Tp*) { if (__len > ptrdiff_t(2147483647 / sizeof(_Tp))) __len = 2147483647 / sizeof(_Tp); while (__len > 0) { _Tp* __tmp = (_Tp*) malloc((size_t)__len * sizeof(_Tp)); if (__tmp != 0) return pair<_Tp*, ptrdiff_t>(__tmp, __len); __len /= 2; } return pair<_Tp*, ptrdiff_t>((_Tp*)0, 0); } template inline pair<_Tp*, ptrdiff_t> get_temporary_buffer(ptrdiff_t __len) { return __get_temporary_buffer(__len, (_Tp*) 0); } template inline pair<_Tp*, ptrdiff_t> get_temporary_buffer(ptrdiff_t __len, _Tp*) { return __get_temporary_buffer(__len, (_Tp*) 0); } template void return_temporary_buffer(_Tp* __p) { free(__p); } template class _Temporary_buffer { private: ptrdiff_t _M_original_len; ptrdiff_t _M_len; _Tp* _M_buffer; void _M_allocate_buffer() { _M_original_len = _M_len; _M_buffer = 0; if (_M_len > (ptrdiff_t)(2147483647 / sizeof(_Tp))) _M_len = 2147483647 / sizeof(_Tp); while (_M_len > 0) { _M_buffer = (_Tp*) malloc(_M_len * sizeof(_Tp)); if (_M_buffer) break; _M_len /= 2; } } void _M_initialize_buffer(const _Tp&, __true_type) {} void _M_initialize_buffer(const _Tp& val, __false_type) { uninitialized_fill_n(_M_buffer, _M_len, val); } public: ptrdiff_t size() const { return _M_len; } ptrdiff_t requested_size() const { return _M_original_len; } _Tp* begin() { return _M_buffer; } _Tp* end() { return _M_buffer + _M_len; } _Temporary_buffer(_ForwardIterator __first, _ForwardIterator __last) { typedef typename __type_traits<_Tp>::has_trivial_default_constructor _Trivial; try { _M_len = 0; distance(__first, __last, _M_len); _M_allocate_buffer(); if (_M_len > 0) _M_initialize_buffer(*__first, _Trivial()); } catch(...) { free(_M_buffer); _M_buffer = 0; _M_len = 0 ; throw; } ; } ~_Temporary_buffer() { destroy(_M_buffer, _M_buffer + _M_len); free(_M_buffer); } private: _Temporary_buffer(const _Temporary_buffer&) {} void operator=(const _Temporary_buffer&) {} }; template ::value_type > struct temporary_buffer : public _Temporary_buffer<_ForwardIterator, _Tp> { temporary_buffer(_ForwardIterator __first, _ForwardIterator __last) : _Temporary_buffer<_ForwardIterator, _Tp>(__first, __last) {} ~temporary_buffer() {} }; # 21 "/usr/include/g++-3/memory" 2 3 # 1 "/usr/include/g++-3/stl_raw_storage_iter.h" 1 3 template class raw_storage_iterator { protected: _ForwardIterator _M_iter; public: typedef output_iterator_tag iterator_category; typedef void value_type; typedef void difference_type; typedef void pointer; typedef void reference; explicit raw_storage_iterator(_ForwardIterator __x) : _M_iter(__x) {} raw_storage_iterator& operator*() { return *this; } raw_storage_iterator& operator=(const _Tp& __element) { construct(&*_M_iter, __element); return *this; } raw_storage_iterator<_ForwardIterator, _Tp>& operator++() { ++_M_iter; return *this; } raw_storage_iterator<_ForwardIterator, _Tp> operator++(int) { raw_storage_iterator<_ForwardIterator, _Tp> __tmp = *this; ++_M_iter; return __tmp; } }; # 73 "/usr/include/g++-3/stl_raw_storage_iter.h" 3 # 23 "/usr/include/g++-3/memory" 2 3 template class auto_ptr { private: _Tp* _M_ptr; public: typedef _Tp element_type; explicit auto_ptr(_Tp* __p = 0) throw() : _M_ptr(__p) {} auto_ptr(auto_ptr& __a) throw() : _M_ptr(__a.release()) {} template auto_ptr(auto_ptr<_Tp1>& __a) throw() : _M_ptr(__a.release()) {} auto_ptr& operator=(auto_ptr& __a) throw() { if (&__a != this) { delete _M_ptr; _M_ptr = __a.release(); } return *this; } template auto_ptr& operator=(auto_ptr<_Tp1>& __a) throw() { if (__a.get() != this->get()) { delete _M_ptr; _M_ptr = __a.release(); } return *this; } ~auto_ptr() throw() { delete _M_ptr; } _Tp& operator*() const throw() { return *_M_ptr; } _Tp* operator->() const throw() { return _M_ptr; } _Tp* get() const throw() { return _M_ptr; } _Tp* release() throw() { _Tp* __tmp = _M_ptr; _M_ptr = 0; return __tmp; } void reset(_Tp* __p = 0) throw() { delete _M_ptr; _M_ptr = __p; } private: template struct auto_ptr_ref { _Tp1* _M_ptr; auto_ptr_ref(_Tp1* __p) : _M_ptr(__p) {} }; public: auto_ptr(auto_ptr_ref<_Tp> __ref) throw() : _M_ptr(__ref._M_ptr) {} template operator auto_ptr_ref<_Tp1>() throw() { return auto_ptr_ref<_Tp>(this->release()); } template operator auto_ptr<_Tp1>() throw() { return auto_ptr<_Tp1>(this->release()); } }; # 35 "/usr/include/boost/spirit/utility/impl/symbols.ipp" 2 3 namespace spirit { template class tst { public: struct search_info { T* data; unsigned length; }; tst(); tst(tst const& other); ~tst(); tst& operator=(tst const& other); template T* add(IteratorT first, IteratorT const& last, T const& data); template search_info find(IteratorT& first, IteratorT const& last) const; private: struct node; node* root; }; template struct tst::node { node(CharT value); ~node(); # 109 "/usr/include/boost/spirit/utility/impl/symbols.ipp" 3 node* clone() const; union center { node* link; T* data; }; CharT value; node* left; center middle; node* right; }; template inline tst::node::node(CharT value_) : value(value_), left(0), right(0) { middle.link = 0; } template inline tst::node::~node() { delete left; delete right; if (value) delete middle.link; else delete middle.data; } template inline typename tst::node* tst::node::clone() const { std::auto_ptr copy(new node(value)); if (left) copy->left = left->clone(); if (right) copy->right = right->clone(); if (value && middle.link) copy->middle.link = middle.link->clone(); else copy->middle.data = new T(*middle.data); return copy.release(); } template inline tst::tst() : root(0) { } template inline tst::tst(tst const& other) : root(other.root->clone()) { } template inline tst::~tst() { delete root; } template inline tst& tst::operator=(tst const& other) { if (this != &other) { node* new_root = other.root->clone(); delete root; root = new_root; } return *this; } template template T* tst::add( IteratorT first, IteratorT const& last, T const& data) { if (first == last) return 0; node** np = &root; CharT ch = *first; while (true) { if (*np == 0 || ch == 0) { node* right = 0; if (np != 0) right = *np; *np = new node(ch); if (right) (**np).right = right; } if (ch < (**np).value) { np = &(**np).left; } else { if (ch == (**np).value) { if (ch == 0) { if ((**np).middle.data == 0) { (**np).middle.data = new T(data); return (**np).middle.data; } else { return 0; } } ++first; ch = (first == last) ? 0 : *first; np = &(**np).middle.link; } else { np = &(**np).right; } } } } template template typename tst::search_info tst::find(IteratorT& first, IteratorT const& last) const { node* np = root; CharT ch = *first; IteratorT save = first; search_info result = { 0, 0 }; while (np) { if (ch < np->value) { if (np->value == 0) result.data = np->middle.data; np = np->left; } else { if (ch == np->value) { if (first == last) { result.data = np->middle.data; break; } ch = *(++first); np = np->middle.link; ++result.length; } else { if (np->value == 0) result.data = np->middle.data; np = np->right; } } } if (result.data == 0) first = save; return result; } template symbol_inserter::symbol_inserter(SetT& set_) : set(set_) { } template template inline T* symbol_inserter::operator()( IteratorT first, IteratorT const& last, T const& data) const { return set.add(first, last, data); } template template inline symbol_inserter const& symbol_inserter::operator,(CharT const* str) const { CharT const* last = str; while (*last) last++; set.add(str, last, T()); return *this; } template inline symbol_action::symbol_action( ParserT const& parser, ActionT const& actor_) : unary(parser), actor(actor_) { } template template inline typename ParsePolicyT::match_t symbol_action::do_parse( IteratorT& first, IteratorT const& last) const { typedef impl::strip_scanner strip_scanner; typename strip_scanner::iterator_type begin = strip_scanner::get(first); attr_match hit = this->subject().template do_parse(first, last); if (hit) actor(begin, strip_scanner::get(first), *hit.value()); return hit; } template inline symbols::symbols() : tst(), add(*this) { } template symbols::symbols(symbols const& other) : tst(other) , parser >() , add(*this) { } template inline symbols::~symbols() { } template inline symbols& symbols::operator=(symbols const& other) { tst::operator=(other); return *this; } template inline symbol_inserter const& symbols::operator=(CharT const* str) { return add, str; } template template inline attr_match symbols::do_parse( IteratorT& first, IteratorT const& last) const { typename SetT::search_info result = tst::find(first, last); if (result.data) return attr_match (result.length, result.data); else return attr_match(); } namespace impl { template struct parser_return, ParsePolicyT> { typedef attr_match match_t; }; } template inline T* find(symbols& table, CharT const* sym) { CharT const* last = sym; while (*last) last++; return table.template do_parse(sym, last).value(); } template inline T* add(symbols& table, CharT const* sym, T const& data) { CharT const* last = sym; while (*last) last++; return table.add(sym, last, data); } } # 273 "/usr/include/boost/spirit/utility/symbols.hpp" 2 3 # 55 "/usr/include/boost/spirit/spirit_utility.hpp" 2 3 # 1 "/usr/include/boost/spirit/utility/chset.hpp" 1 3 namespace spirit { namespace impl { template class chset_rep; struct chset_converter; } template class chset; template chset operator|(chset const& a, chset const& b); template chset operator-(chset const& a, chset const& b); template class chset: public char_parser > { public: chset(); chset(chset const& arg); explicit chset(CharT arg); explicit chset(anychar_ arg); explicit chset(nothing_ arg); explicit chset(chlit const& arg); explicit chset(range const& arg); ~chset(); chset& operator=(chset const& rhs); chset& operator=(CharT rhs); chset& operator=(anychar_ rhs); chset& operator=(nothing_ rhs); chset& operator=(chlit const& rhs); chset& operator=(range const& rhs); void set(range const& arg); void clear(range const& arg); bool test(CharT ch) const; void add(CharT ch); template explicit chset(CharTB const* definition); template chset(chset const& arg); template chset& operator=(chset const& rhs); friend chset operator-<>(chset const&, chset const&); friend chset operator|<>(chset const&, chset const&); friend struct impl::chset_converter; impl::chset_rep* ptr; }; template chset operator~(chset const& a); template chset operator|(chset const& a, chset const& b); template chset operator&(chset const& a, chset const& b); template chset operator-(chset const& a, chset const& b); template chset operator^(chset const& a, chset const& b); template chset operator~(range const& a); template chset operator|(chset const& a, range const& b); template chset operator&(chset const& a, range const& b); template chset operator-(chset const& a, range const& b); template chset operator^(chset const& a, range const& b); template chset operator|(range const& a, chset const& b); template chset operator&(range const& a, chset const& b); template chset operator-(range const& a, chset const& b); template chset operator^(range const& a, chset const& b); template chset operator~(chlit const& a); template chset operator|(chset const& a, chlit const& b); template chset operator&(chset const& a, chlit const& b); template chset operator-(chset const& a, chlit const& b); template chset operator^(chset const& a, chlit const& b); template chset operator|(chlit const& a, chset const& b); template chset operator&(chlit const& a, chset const& b); template chset operator-(chlit const& a, chset const& b); template chset operator^(chlit const& a, chset const& b); template chset operator|(chset const& a, CharT b); template chset operator&(chset const& a, CharT b); template chset operator-(chset const& a, CharT b); template chset operator^(chset const& a, CharT b); template chset operator|(CharT a, chset const& b); template chset operator&(CharT a, chset const& b); template chset operator-(CharT a, chset const& b); template chset operator^(CharT a, chset const& b); nothing_ operator~(anychar_ a); template chset operator|(chset const& a, anychar_ b); template chset operator&(chset const& a, anychar_ b); template chset operator-(chset const& a, anychar_ b); template chset operator^(chset const& a, anychar_ b); template chset operator|(anychar_ a, chset const& b); template chset operator&(anychar_ a, chset const& b); template chset operator-(anychar_ a, chset const& b); template chset operator^(anychar_ a, chset const& b); template chset operator|(chset const& a, nothing_ b); template chset operator&(chset const& a, nothing_ b); template chset operator-(chset const& a, nothing_ b); template chset operator^(chset const& a, nothing_ b); template chset operator|(nothing_ a, chset const& b); template chset operator&(nothing_ a, chset const& b); template chset operator-(nothing_ a, chset const& b); template chset operator^(nothing_ a, chset const& b); template class variable; template chset chset_p(ParamT param); } # 1 "/usr/include/boost/spirit/utility/impl/chset.ipp" 1 3 # 1 "/usr/include/g++-3/algorithm" 1 3 # 1 "/usr/include/g++-3/stl_algo.h" 1 3 # 1 "/usr/include/g++-3/stl_heap.h" 1 3 template void __push_heap(_RandomAccessIterator __first, _Distance __holeIndex, _Distance __topIndex, _Tp __value) { _Distance __parent = (__holeIndex - 1) / 2; while (__holeIndex > __topIndex && *(__first + __parent) < __value) { *(__first + __holeIndex) = *(__first + __parent); __holeIndex = __parent; __parent = (__holeIndex - 1) / 2; } *(__first + __holeIndex) = __value; } template inline void __push_heap_aux(_RandomAccessIterator __first, _RandomAccessIterator __last, _Distance*, _Tp*) { __push_heap(__first, _Distance((__last - __first) - 1), _Distance(0), _Tp(*(__last - 1))); } template inline void push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) { __push_heap_aux(__first, __last, __distance_type( __first ) , __value_type( __first ) ); } template void __push_heap(_RandomAccessIterator __first, _Distance __holeIndex, _Distance __topIndex, _Tp __value, _Compare __comp) { _Distance __parent = (__holeIndex - 1) / 2; while (__holeIndex > __topIndex && __comp(*(__first + __parent), __value)) { *(__first + __holeIndex) = *(__first + __parent); __holeIndex = __parent; __parent = (__holeIndex - 1) / 2; } *(__first + __holeIndex) = __value; } template inline void __push_heap_aux(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp, _Distance*, _Tp*) { __push_heap(__first, _Distance((__last - __first) - 1), _Distance(0), _Tp(*(__last - 1)), __comp); } template inline void push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) { __push_heap_aux(__first, __last, __comp, __distance_type( __first ) , __value_type( __first ) ); } template void __adjust_heap(_RandomAccessIterator __first, _Distance __holeIndex, _Distance __len, _Tp __value) { _Distance __topIndex = __holeIndex; _Distance __secondChild = 2 * __holeIndex + 2; while (__secondChild < __len) { if (*(__first + __secondChild) < *(__first + (__secondChild - 1))) __secondChild--; *(__first + __holeIndex) = *(__first + __secondChild); __holeIndex = __secondChild; __secondChild = 2 * (__secondChild + 1); } if (__secondChild == __len) { *(__first + __holeIndex) = *(__first + (__secondChild - 1)); __holeIndex = __secondChild - 1; } __push_heap(__first, __holeIndex, __topIndex, __value); } template inline void __pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _RandomAccessIterator __result, _Tp __value, _Distance*) { *__result = *__first; __adjust_heap(__first, _Distance(0), _Distance(__last - __first), __value); } template inline void __pop_heap_aux(_RandomAccessIterator __first, _RandomAccessIterator __last, _Tp*) { __pop_heap(__first, __last - 1, __last - 1, _Tp(*(__last - 1)), __distance_type( __first ) ); } template inline void pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) { __pop_heap_aux(__first, __last, __value_type( __first ) ); } template void __adjust_heap(_RandomAccessIterator __first, _Distance __holeIndex, _Distance __len, _Tp __value, _Compare __comp) { _Distance __topIndex = __holeIndex; _Distance __secondChild = 2 * __holeIndex + 2; while (__secondChild < __len) { if (__comp(*(__first + __secondChild), *(__first + (__secondChild - 1)))) __secondChild--; *(__first + __holeIndex) = *(__first + __secondChild); __holeIndex = __secondChild; __secondChild = 2 * (__secondChild + 1); } if (__secondChild == __len) { *(__first + __holeIndex) = *(__first + (__secondChild - 1)); __holeIndex = __secondChild - 1; } __push_heap(__first, __holeIndex, __topIndex, __value, __comp); } template inline void __pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _RandomAccessIterator __result, _Tp __value, _Compare __comp, _Distance*) { *__result = *__first; __adjust_heap(__first, _Distance(0), _Distance(__last - __first), __value, __comp); } template inline void __pop_heap_aux(_RandomAccessIterator __first, _RandomAccessIterator __last, _Tp*, _Compare __comp) { __pop_heap(__first, __last - 1, __last - 1, _Tp(*(__last - 1)), __comp, __distance_type( __first ) ); } template inline void pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) { __pop_heap_aux(__first, __last, __value_type( __first ) , __comp); } template void __make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Tp*, _Distance*) { if (__last - __first < 2) return; _Distance __len = __last - __first; _Distance __parent = (__len - 2)/2; while (true) { __adjust_heap(__first, __parent, __len, _Tp(*(__first + __parent))); if (__parent == 0) return; __parent--; } } template inline void make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) { __make_heap(__first, __last, __value_type( __first ) , __distance_type( __first ) ); } template void __make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp, _Tp*, _Distance*) { if (__last - __first < 2) return; _Distance __len = __last - __first; _Distance __parent = (__len - 2)/2; while (true) { __adjust_heap(__first, __parent, __len, _Tp(*(__first + __parent)), __comp); if (__parent == 0) return; __parent--; } } template inline void make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) { __make_heap(__first, __last, __comp, __value_type( __first ) , __distance_type( __first ) ); } template void sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) { while (__last - __first > 1) pop_heap(__first, __last--); } template void sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) { while (__last - __first > 1) pop_heap(__first, __last--, __comp); } # 34 "/usr/include/g++-3/stl_algo.h" 2 3 template inline const _Tp& __median(const _Tp& __a, const _Tp& __b, const _Tp& __c) { if (__a < __b) if (__b < __c) return __b; else if (__a < __c) return __c; else return __a; else if (__a < __c) return __a; else if (__b < __c) return __c; else return __b; } template inline const _Tp& __median(const _Tp& __a, const _Tp& __b, const _Tp& __c, _Compare __comp) { if (__comp(__a, __b)) if (__comp(__b, __c)) return __b; else if (__comp(__a, __c)) return __c; else return __a; else if (__comp(__a, __c)) return __a; else if (__comp(__b, __c)) return __c; else return __b; } template _Function for_each(_InputIter __first, _InputIter __last, _Function __f) { for ( ; __first != __last; ++__first) __f(*__first); return __f; } template inline _InputIter find(_InputIter __first, _InputIter __last, const _Tp& __val, input_iterator_tag) { while (__first != __last && *__first != __val) ++__first; return __first; } template inline _InputIter find_if(_InputIter __first, _InputIter __last, _Predicate __pred, input_iterator_tag) { while (__first != __last && !__pred(*__first)) ++__first; return __first; } template _RandomAccessIter find(_RandomAccessIter __first, _RandomAccessIter __last, const _Tp& __val, random_access_iterator_tag) { typename iterator_traits<_RandomAccessIter>::difference_type __trip_count = (__last - __first) >> 2; for ( ; __trip_count > 0 ; --__trip_count) { if (*__first == __val) return __first; ++__first; if (*__first == __val) return __first; ++__first; if (*__first == __val) return __first; ++__first; if (*__first == __val) return __first; ++__first; } switch(__last - __first) { case 3: if (*__first == __val) return __first; ++__first; case 2: if (*__first == __val) return __first; ++__first; case 1: if (*__first == __val) return __first; ++__first; case 0: default: return __last; } } template _RandomAccessIter find_if(_RandomAccessIter __first, _RandomAccessIter __last, _Predicate __pred, random_access_iterator_tag) { typename iterator_traits<_RandomAccessIter>::difference_type __trip_count = (__last - __first) >> 2; for ( ; __trip_count > 0 ; --__trip_count) { if (__pred(*__first)) return __first; ++__first; if (__pred(*__first)) return __first; ++__first; if (__pred(*__first)) return __first; ++__first; if (__pred(*__first)) return __first; ++__first; } switch(__last - __first) { case 3: if (__pred(*__first)) return __first; ++__first; case 2: if (__pred(*__first)) return __first; ++__first; case 1: if (__pred(*__first)) return __first; ++__first; case 0: default: return __last; } } template inline _InputIter find(_InputIter __first, _InputIter __last, const _Tp& __val) { return find(__first, __last, __val, __iterator_category( __first ) ); } template inline _InputIter find_if(_InputIter __first, _InputIter __last, _Predicate __pred) { return find_if(__first, __last, __pred, __iterator_category( __first ) ); } template _ForwardIter adjacent_find(_ForwardIter __first, _ForwardIter __last) { if (__first == __last) return __last; _ForwardIter __next = __first; while(++__next != __last) { if (*__first == *__next) return __first; __first = __next; } return __last; } template _ForwardIter adjacent_find(_ForwardIter __first, _ForwardIter __last, _BinaryPredicate __binary_pred) { if (__first == __last) return __last; _ForwardIter __next = __first; while(++__next != __last) { if (__binary_pred(*__first, *__next)) return __first; __first = __next; } return __last; } template void count(_InputIter __first, _InputIter __last, const _Tp& __value, _Size& __n) { for ( ; __first != __last; ++__first) if (*__first == __value) ++__n; } template void count_if(_InputIter __first, _InputIter __last, _Predicate __pred, _Size& __n) { for ( ; __first != __last; ++__first) if (__pred(*__first)) ++__n; } template typename iterator_traits<_InputIter>::difference_type count(_InputIter __first, _InputIter __last, const _Tp& __value) { typename iterator_traits<_InputIter>::difference_type __n = 0; for ( ; __first != __last; ++__first) if (*__first == __value) ++__n; return __n; } template typename iterator_traits<_InputIter>::difference_type count_if(_InputIter __first, _InputIter __last, _Predicate __pred) { typename iterator_traits<_InputIter>::difference_type __n = 0; for ( ; __first != __last; ++__first) if (__pred(*__first)) ++__n; return __n; } template _ForwardIter1 search(_ForwardIter1 __first1, _ForwardIter1 __last1, _ForwardIter2 __first2, _ForwardIter2 __last2) { if (__first1 == __last1 || __first2 == __last2) return __first1; _ForwardIter2 __tmp(__first2); ++__tmp; if (__tmp == __last2) return find(__first1, __last1, *__first2); _ForwardIter2 __p1, __p; __p1 = __first2; ++__p1; _ForwardIter1 __current = __first1; while (__first1 != __last1) { __first1 = find(__first1, __last1, *__first2); if (__first1 == __last1) return __last1; __p = __p1; __current = __first1; if (++__current == __last1) return __last1; while (*__current == *__p) { if (++__p == __last2) return __first1; if (++__current == __last1) return __last1; } ++__first1; } return __first1; } template _ForwardIter1 search(_ForwardIter1 __first1, _ForwardIter1 __last1, _ForwardIter2 __first2, _ForwardIter2 __last2, _BinaryPred __predicate) { if (__first1 == __last1 || __first2 == __last2) return __first1; _ForwardIter2 __tmp(__first2); ++__tmp; if (__tmp == __last2) return find(__first1, __last1, *__first2); _ForwardIter2 __p1, __p; __p1 = __first2; ++__p1; _ForwardIter1 __current = __first1; while (__first1 != __last1) { while (__first1 != __last1) { if (__predicate(*__first1, *__first2)) break; ++__first1; } while (__first1 != __last1 && !__predicate(*__first1, *__first2)) ++__first1; if (__first1 == __last1) return __last1; __p = __p1; __current = __first1; if (++__current == __last1) return __last1; while (__predicate(*__current, *__p)) { if (++__p == __last2) return __first1; if (++__current == __last1) return __last1; } ++__first1; } return __first1; } template _ForwardIter search_n(_ForwardIter __first, _ForwardIter __last, _Integer __count, const _Tp& __val) { if (__count <= 0) return __first; else { __first = find(__first, __last, __val); while (__first != __last) { _Integer __n = __count - 1; _ForwardIter __i = __first; ++__i; while (__i != __last && __n != 0 && *__i == __val) { ++__i; --__n; } if (__n == 0) return __first; else __first = find(__i, __last, __val); } return __last; } } template _ForwardIter search_n(_ForwardIter __first, _ForwardIter __last, _Integer __count, const _Tp& __val, _BinaryPred __binary_pred) { if (__count <= 0) return __first; else { while (__first != __last) { if (__binary_pred(*__first, __val)) break; ++__first; } while (__first != __last) { _Integer __n = __count - 1; _ForwardIter __i = __first; ++__i; while (__i != __last && __n != 0 && __binary_pred(*__i, __val)) { ++__i; --__n; } if (__n == 0) return __first; else { while (__i != __last) { if (__binary_pred(*__i, __val)) break; ++__i; } __first = __i; } } return __last; } } template _ForwardIter2 swap_ranges(_ForwardIter1 __first1, _ForwardIter1 __last1, _ForwardIter2 __first2) { for ( ; __first1 != __last1; ++__first1, ++__first2) iter_swap(__first1, __first2); return __first2; } template _OutputIter transform(_InputIter __first, _InputIter __last, _OutputIter __result, _UnaryOperation __oper) { for ( ; __first != __last; ++__first, ++__result) *__result = __oper(*__first); return __result; } template _OutputIter transform(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _OutputIter __result, _BinaryOperation __binary_op) { for ( ; __first1 != __last1; ++__first1, ++__first2, ++__result) *__result = __binary_op(*__first1, *__first2); return __result; } template void replace(_ForwardIter __first, _ForwardIter __last, const _Tp& __old_value, const _Tp& __new_value) { for ( ; __first != __last; ++__first) if (*__first == __old_value) *__first = __new_value; } template void replace_if(_ForwardIter __first, _ForwardIter __last, _Predicate __pred, const _Tp& __new_value) { for ( ; __first != __last; ++__first) if (__pred(*__first)) *__first = __new_value; } template _OutputIter replace_copy(_InputIter __first, _InputIter __last, _OutputIter __result, const _Tp& __old_value, const _Tp& __new_value) { for ( ; __first != __last; ++__first, ++__result) *__result = *__first == __old_value ? __new_value : *__first; return __result; } template _OutputIter replace_copy_if(Iterator __first, Iterator __last, _OutputIter __result, _Predicate __pred, const _Tp& __new_value) { for ( ; __first != __last; ++__first, ++__result) *__result = __pred(*__first) ? __new_value : *__first; return __result; } template void generate(_ForwardIter __first, _ForwardIter __last, _Generator __gen) { for ( ; __first != __last; ++__first) *__first = __gen(); } template _OutputIter generate_n(_OutputIter __first, _Size __n, _Generator __gen) { for ( ; __n > 0; --__n, ++__first) *__first = __gen(); return __first; } template _OutputIter remove_copy(_InputIter __first, _InputIter __last, _OutputIter __result, const _Tp& __value) { for ( ; __first != __last; ++__first) if (*__first != __value) { *__result = *__first; ++__result; } return __result; } template _OutputIter remove_copy_if(_InputIter __first, _InputIter __last, _OutputIter __result, _Predicate __pred) { for ( ; __first != __last; ++__first) if (!__pred(*__first)) { *__result = *__first; ++__result; } return __result; } template _ForwardIter remove(_ForwardIter __first, _ForwardIter __last, const _Tp& __value) { __first = find(__first, __last, __value); _ForwardIter __i = __first; return __first == __last ? __first : remove_copy(++__i, __last, __first, __value); } template _ForwardIter remove_if(_ForwardIter __first, _ForwardIter __last, _Predicate __pred) { __first = find_if(__first, __last, __pred); _ForwardIter __i = __first; return __first == __last ? __first : remove_copy_if(++__i, __last, __first, __pred); } template _OutputIter __unique_copy(_InputIter __first, _InputIter __last, _OutputIter __result, _Tp*) { _Tp __value = *__first; *__result = __value; while (++__first != __last) if (__value != *__first) { __value = *__first; *++__result = __value; } return ++__result; } template inline _OutputIter __unique_copy(_InputIter __first, _InputIter __last, _OutputIter __result, output_iterator_tag) { return __unique_copy(__first, __last, __result, __value_type( __first ) ); } template _ForwardIter __unique_copy(_InputIter __first, _InputIter __last, _ForwardIter __result, forward_iterator_tag) { *__result = *__first; while (++__first != __last) if (*__result != *__first) *++__result = *__first; return ++__result; } template inline _OutputIter unique_copy(_InputIter __first, _InputIter __last, _OutputIter __result) { if (__first == __last) return __result; return __unique_copy(__first, __last, __result, __iterator_category( __result ) ); } template _OutputIter __unique_copy(_InputIter __first, _InputIter __last, _OutputIter __result, _BinaryPredicate __binary_pred, _Tp*) { _Tp __value = *__first; *__result = __value; while (++__first != __last) if (!__binary_pred(__value, *__first)) { __value = *__first; *++__result = __value; } return ++__result; } template inline _OutputIter __unique_copy(_InputIter __first, _InputIter __last, _OutputIter __result, _BinaryPredicate __binary_pred, output_iterator_tag) { return __unique_copy(__first, __last, __result, __binary_pred, __value_type( __first ) ); } template _ForwardIter __unique_copy(_InputIter __first, _InputIter __last, _ForwardIter __result, _BinaryPredicate __binary_pred, forward_iterator_tag) { *__result = *__first; while (++__first != __last) if (!__binary_pred(*__result, *__first)) *++__result = *__first; return ++__result; } template inline _OutputIter unique_copy(_InputIter __first, _InputIter __last, _OutputIter __result, _BinaryPredicate __binary_pred) { if (__first == __last) return __result; return __unique_copy(__first, __last, __result, __binary_pred, __iterator_category( __result ) ); } template _ForwardIter unique(_ForwardIter __first, _ForwardIter __last) { __first = adjacent_find(__first, __last); return unique_copy(__first, __last, __first); } template _ForwardIter unique(_ForwardIter __first, _ForwardIter __last, _BinaryPredicate __binary_pred) { __first = adjacent_find(__first, __last, __binary_pred); return unique_copy(__first, __last, __first, __binary_pred); } template void __reverse(_BidirectionalIter __first, _BidirectionalIter __last, bidirectional_iterator_tag) { while (true) if (__first == __last || __first == --__last) return; else iter_swap(__first++, __last); } template void __reverse(_RandomAccessIter __first, _RandomAccessIter __last, random_access_iterator_tag) { while (__first < __last) iter_swap(__first++, --__last); } template inline void reverse(_BidirectionalIter __first, _BidirectionalIter __last) { __reverse(__first, __last, __iterator_category( __first ) ); } template _OutputIter reverse_copy(_BidirectionalIter __first, _BidirectionalIter __last, _OutputIter __result) { while (__first != __last) { --__last; *__result = *__last; ++__result; } return __result; } template _EuclideanRingElement __gcd(_EuclideanRingElement __m, _EuclideanRingElement __n) { while (__n != 0) { _EuclideanRingElement __t = __m % __n; __m = __n; __n = __t; } return __m; } template _ForwardIter __rotate(_ForwardIter __first, _ForwardIter __middle, _ForwardIter __last, _Distance*, forward_iterator_tag) { if (__first == __middle) return __last; if (__last == __middle) return __first; _ForwardIter __first2 = __middle; do { swap(*__first++, *__first2++); if (__first == __middle) __middle = __first2; } while (__first2 != __last); _ForwardIter __new_middle = __first; __first2 = __middle; while (__first2 != __last) { swap (*__first++, *__first2++); if (__first == __middle) __middle = __first2; else if (__first2 == __last) __first2 = __middle; } return __new_middle; } template _BidirectionalIter __rotate(_BidirectionalIter __first, _BidirectionalIter __middle, _BidirectionalIter __last, _Distance*, bidirectional_iterator_tag) { if (__first == __middle) return __last; if (__last == __middle) return __first; __reverse(__first, __middle, bidirectional_iterator_tag()); __reverse(__middle, __last, bidirectional_iterator_tag()); while (__first != __middle && __middle != __last) swap (*__first++, *--__last); if (__first == __middle) { __reverse(__middle, __last, bidirectional_iterator_tag()); return __last; } else { __reverse(__first, __middle, bidirectional_iterator_tag()); return __first; } } template _RandomAccessIter __rotate(_RandomAccessIter __first, _RandomAccessIter __middle, _RandomAccessIter __last, _Distance *, _Tp *) { _Distance __n = __last - __first; _Distance __k = __middle - __first; _Distance __l = __n - __k; _RandomAccessIter __result = __first + (__last - __middle); if (__k == __l) { swap_ranges(__first, __middle, __middle); return __result; } _Distance __d = __gcd(__n, __k); for (_Distance __i = 0; __i < __d; __i++) { _Tp __tmp = *__first; _RandomAccessIter __p = __first; if (__k < __l) { for (_Distance __j = 0; __j < __l/__d; __j++) { if (__p > __first + __l) { *__p = *(__p - __l); __p -= __l; } *__p = *(__p + __k); __p += __k; } } else { for (_Distance __j = 0; __j < __k/__d - 1; __j ++) { if (__p < __last - __k) { *__p = *(__p + __k); __p += __k; } *__p = * (__p - __l); __p -= __l; } } *__p = __tmp; ++__first; } return __result; } template inline _ForwardIter rotate(_ForwardIter __first, _ForwardIter __middle, _ForwardIter __last) { return __rotate(__first, __middle, __last, __distance_type( __first ) , __iterator_category( __first ) ); } template _OutputIter rotate_copy(_ForwardIter __first, _ForwardIter __middle, _ForwardIter __last, _OutputIter __result) { return copy(__first, __middle, copy(__middle, __last, __result)); } template inline _Distance __random_number(_Distance __n) { return rand() % __n; } template inline void random_shuffle(_RandomAccessIter __first, _RandomAccessIter __last) { if (__first == __last) return; for (_RandomAccessIter __i = __first + 1; __i != __last; ++__i) iter_swap(__i, __first + __random_number((__i - __first) + 1)); } template void random_shuffle(_RandomAccessIter __first, _RandomAccessIter __last, _RandomNumberGenerator& __rand) { if (__first == __last) return; for (_RandomAccessIter __i = __first + 1; __i != __last; ++__i) iter_swap(__i, __first + __rand((__i - __first) + 1)); } template _OutputIter random_sample_n(_ForwardIter __first, _ForwardIter __last, _OutputIter __out, const _Distance __n) { _Distance __remaining = 0; distance(__first, __last, __remaining); _Distance __m = min(__n, __remaining); while (__m > 0) { if (__random_number(__remaining) < __m) { *__out = *__first; ++__out; --__m; } --__remaining; ++__first; } return __out; } template _OutputIter random_sample_n(_ForwardIter __first, _ForwardIter __last, _OutputIter __out, const _Distance __n, _RandomNumberGenerator& __rand) { _Distance __remaining = 0; distance(__first, __last, __remaining); _Distance __m = min(__n, __remaining); while (__m > 0) { if (__rand(__remaining) < __m) { *__out = *__first; ++__out; --__m; } --__remaining; ++__first; } return __out; } template _RandomAccessIter __random_sample(_InputIter __first, _InputIter __last, _RandomAccessIter __out, const _Distance __n) { _Distance __m = 0; _Distance __t = __n; for ( ; __first != __last && __m < __n; ++__m, ++__first) __out[__m] = *__first; while (__first != __last) { ++__t; _Distance __M = __random_number(__t); if (__M < __n) __out[__M] = *__first; ++__first; } return __out + __m; } template _RandomAccessIter __random_sample(_InputIter __first, _InputIter __last, _RandomAccessIter __out, _RandomNumberGenerator& __rand, const _Distance __n) { _Distance __m = 0; _Distance __t = __n; for ( ; __first != __last && __m < __n; ++__m, ++__first) __out[__m] = *__first; while (__first != __last) { ++__t; _Distance __M = __rand(__t); if (__M < __n) __out[__M] = *__first; ++__first; } return __out + __m; } template inline _RandomAccessIter random_sample(_InputIter __first, _InputIter __last, _RandomAccessIter __out_first, _RandomAccessIter __out_last) { return __random_sample(__first, __last, __out_first, __out_last - __out_first); } template inline _RandomAccessIter random_sample(_InputIter __first, _InputIter __last, _RandomAccessIter __out_first, _RandomAccessIter __out_last, _RandomNumberGenerator& __rand) { return __random_sample(__first, __last, __out_first, __rand, __out_last - __out_first); } template _ForwardIter __partition(_ForwardIter __first, _ForwardIter __last, _Predicate __pred, forward_iterator_tag) { if (__first == __last) return __first; while (__pred(*__first)) if (++__first == __last) return __first; _ForwardIter __next = __first; while (++__next != __last) if (__pred(*__next)) { swap(*__first, *__next); ++__first; } return __first; } template _BidirectionalIter __partition(_BidirectionalIter __first, _BidirectionalIter __last, _Predicate __pred, bidirectional_iterator_tag) { while (true) { while (true) if (__first == __last) return __first; else if (__pred(*__first)) ++__first; else break; --__last; while (true) if (__first == __last) return __first; else if (!__pred(*__last)) --__last; else break; iter_swap(__first, __last); ++__first; } } template inline _ForwardIter partition(_ForwardIter __first, _ForwardIter __last, _Predicate __pred) { return __partition(__first, __last, __pred, __iterator_category( __first ) ); } template _ForwardIter __inplace_stable_partition(_ForwardIter __first, _ForwardIter __last, _Predicate __pred, _Distance __len) { if (__len == 1) return __pred(*__first) ? __last : __first; _ForwardIter __middle = __first; advance(__middle, __len / 2); return rotate(__inplace_stable_partition(__first, __middle, __pred, __len / 2), __middle, __inplace_stable_partition(__middle, __last, __pred, __len - __len / 2)); } template _ForwardIter __stable_partition_adaptive(_ForwardIter __first, _ForwardIter __last, _Predicate __pred, _Distance __len, _Pointer __buffer, _Distance __buffer_size) { if (__len <= __buffer_size) { _ForwardIter __result1 = __first; _Pointer __result2 = __buffer; for ( ; __first != __last ; ++__first) if (__pred(*__first)) { *__result1 = *__first; ++__result1; } else { *__result2 = *__first; ++__result2; } copy(__buffer, __result2, __result1); return __result1; } else { _ForwardIter __middle = __first; advance(__middle, __len / 2); return rotate(__stable_partition_adaptive( __first, __middle, __pred, __len / 2, __buffer, __buffer_size), __middle, __stable_partition_adaptive( __middle, __last, __pred, __len - __len / 2, __buffer, __buffer_size)); } } template inline _ForwardIter __stable_partition_aux(_ForwardIter __first, _ForwardIter __last, _Predicate __pred, _Tp*, _Distance*) { _Temporary_buffer<_ForwardIter, _Tp> __buf(__first, __last); if (__buf.size() > 0) return __stable_partition_adaptive(__first, __last, __pred, _Distance(__buf.requested_size()), __buf.begin(), __buf.size()); else return __inplace_stable_partition(__first, __last, __pred, _Distance(__buf.requested_size())); } template inline _ForwardIter stable_partition(_ForwardIter __first, _ForwardIter __last, _Predicate __pred) { if (__first == __last) return __first; else return __stable_partition_aux(__first, __last, __pred, __value_type( __first ) , __distance_type( __first ) ); } template _RandomAccessIter __unguarded_partition(_RandomAccessIter __first, _RandomAccessIter __last, _Tp __pivot) { while (true) { while (*__first < __pivot) ++__first; --__last; while (__pivot < *__last) --__last; if (!(__first < __last)) return __first; iter_swap(__first, __last); ++__first; } } template _RandomAccessIter __unguarded_partition(_RandomAccessIter __first, _RandomAccessIter __last, _Tp __pivot, _Compare __comp) { while (true) { while (__comp(*__first, __pivot)) ++__first; --__last; while (__comp(__pivot, *__last)) --__last; if (!(__first < __last)) return __first; iter_swap(__first, __last); ++__first; } } const int __stl_threshold = 16; template void __unguarded_linear_insert(_RandomAccessIter __last, _Tp __val) { _RandomAccessIter __next = __last; --__next; while (__val < *__next) { *__last = *__next; __last = __next; --__next; } *__last = __val; } template void __unguarded_linear_insert(_RandomAccessIter __last, _Tp __val, _Compare __comp) { _RandomAccessIter __next = __last; --__next; while (__comp(__val, *__next)) { *__last = *__next; __last = __next; --__next; } *__last = __val; } template inline void __linear_insert(_RandomAccessIter __first, _RandomAccessIter __last, _Tp*) { _Tp __val = *__last; if (__val < *__first) { copy_backward(__first, __last, __last + 1); *__first = __val; } else __unguarded_linear_insert(__last, __val); } template inline void __linear_insert(_RandomAccessIter __first, _RandomAccessIter __last, _Tp*, _Compare __comp) { _Tp __val = *__last; if (__comp(__val, *__first)) { copy_backward(__first, __last, __last + 1); *__first = __val; } else __unguarded_linear_insert(__last, __val, __comp); } template void __insertion_sort(_RandomAccessIter __first, _RandomAccessIter __last) { if (__first == __last) return; for (_RandomAccessIter __i = __first + 1; __i != __last; ++__i) __linear_insert(__first, __i, __value_type( __first ) ); } template void __insertion_sort(_RandomAccessIter __first, _RandomAccessIter __last, _Compare __comp) { if (__first == __last) return; for (_RandomAccessIter __i = __first + 1; __i != __last; ++__i) __linear_insert(__first, __i, __value_type( __first ) , __comp); } template void __unguarded_insertion_sort_aux(_RandomAccessIter __first, _RandomAccessIter __last, _Tp*) { for (_RandomAccessIter __i = __first; __i != __last; ++__i) __unguarded_linear_insert(__i, _Tp(*__i)); } template inline void __unguarded_insertion_sort(_RandomAccessIter __first, _RandomAccessIter __last) { __unguarded_insertion_sort_aux(__first, __last, __value_type( __first ) ); } template void __unguarded_insertion_sort_aux(_RandomAccessIter __first, _RandomAccessIter __last, _Tp*, _Compare __comp) { for (_RandomAccessIter __i = __first; __i != __last; ++__i) __unguarded_linear_insert(__i, _Tp(*__i), __comp); } template inline void __unguarded_insertion_sort(_RandomAccessIter __first, _RandomAccessIter __last, _Compare __comp) { __unguarded_insertion_sort_aux(__first, __last, __value_type( __first ) , __comp); } template void __final_insertion_sort(_RandomAccessIter __first, _RandomAccessIter __last) { if (__last - __first > __stl_threshold) { __insertion_sort(__first, __first + __stl_threshold); __unguarded_insertion_sort(__first + __stl_threshold, __last); } else __insertion_sort(__first, __last); } template void __final_insertion_sort(_RandomAccessIter __first, _RandomAccessIter __last, _Compare __comp) { if (__last - __first > __stl_threshold) { __insertion_sort(__first, __first + __stl_threshold, __comp); __unguarded_insertion_sort(__first + __stl_threshold, __last, __comp); } else __insertion_sort(__first, __last, __comp); } template inline _Size __lg(_Size __n) { _Size __k; for (__k = 0; __n != 1; __n >>= 1) ++__k; return __k; } template void __introsort_loop(_RandomAccessIter __first, _RandomAccessIter __last, _Tp*, _Size __depth_limit) { while (__last - __first > __stl_threshold) { if (__depth_limit == 0) { partial_sort(__first, __last, __last); return; } --__depth_limit; _RandomAccessIter __cut = __unguarded_partition(__first, __last, _Tp(__median(*__first, *(__first + (__last - __first)/2), *(__last - 1)))); __introsort_loop(__cut, __last, (_Tp*) 0, __depth_limit); __last = __cut; } } template void __introsort_loop(_RandomAccessIter __first, _RandomAccessIter __last, _Tp*, _Size __depth_limit, _Compare __comp) { while (__last - __first > __stl_threshold) { if (__depth_limit == 0) { partial_sort(__first, __last, __last, __comp); return; } --__depth_limit; _RandomAccessIter __cut = __unguarded_partition(__first, __last, _Tp(__median(*__first, *(__first + (__last - __first)/2), *(__last - 1), __comp)), __comp); __introsort_loop(__cut, __last, (_Tp*) 0, __depth_limit, __comp); __last = __cut; } } template inline void sort(_RandomAccessIter __first, _RandomAccessIter __last) { if (__first != __last) { __introsort_loop(__first, __last, __value_type( __first ) , __lg(__last - __first) * 2); __final_insertion_sort(__first, __last); } } template inline void sort(_RandomAccessIter __first, _RandomAccessIter __last, _Compare __comp) { if (__first != __last) { __introsort_loop(__first, __last, __value_type( __first ) , __lg(__last - __first) * 2, __comp); __final_insertion_sort(__first, __last, __comp); } } template void __inplace_stable_sort(_RandomAccessIter __first, _RandomAccessIter __last) { if (__last - __first < 15) { __insertion_sort(__first, __last); return; } _RandomAccessIter __middle = __first + (__last - __first) / 2; __inplace_stable_sort(__first, __middle); __inplace_stable_sort(__middle, __last); __merge_without_buffer(__first, __middle, __last, __middle - __first, __last - __middle); } template void __inplace_stable_sort(_RandomAccessIter __first, _RandomAccessIter __last, _Compare __comp) { if (__last - __first < 15) { __insertion_sort(__first, __last, __comp); return; } _RandomAccessIter __middle = __first + (__last - __first) / 2; __inplace_stable_sort(__first, __middle, __comp); __inplace_stable_sort(__middle, __last, __comp); __merge_without_buffer(__first, __middle, __last, __middle - __first, __last - __middle, __comp); } template void __merge_sort_loop(_RandomAccessIter1 __first, _RandomAccessIter1 __last, _RandomAccessIter2 __result, _Distance __step_size) { _Distance __two_step = 2 * __step_size; while (__last - __first >= __two_step) { __result = merge(__first, __first + __step_size, __first + __step_size, __first + __two_step, __result); __first += __two_step; } __step_size = min(_Distance(__last - __first), __step_size); merge(__first, __first + __step_size, __first + __step_size, __last, __result); } template void __merge_sort_loop(_RandomAccessIter1 __first, _RandomAccessIter1 __last, _RandomAccessIter2 __result, _Distance __step_size, _Compare __comp) { _Distance __two_step = 2 * __step_size; while (__last - __first >= __two_step) { __result = merge(__first, __first + __step_size, __first + __step_size, __first + __two_step, __result, __comp); __first += __two_step; } __step_size = min(_Distance(__last - __first), __step_size); merge(__first, __first + __step_size, __first + __step_size, __last, __result, __comp); } const int __stl_chunk_size = 7; template void __chunk_insertion_sort(_RandomAccessIter __first, _RandomAccessIter __last, _Distance __chunk_size) { while (__last - __first >= __chunk_size) { __insertion_sort(__first, __first + __chunk_size); __first += __chunk_size; } __insertion_sort(__first, __last); } template void __chunk_insertion_sort(_RandomAccessIter __first, _RandomAccessIter __last, _Distance __chunk_size, _Compare __comp) { while (__last - __first >= __chunk_size) { __insertion_sort(__first, __first + __chunk_size, __comp); __first += __chunk_size; } __insertion_sort(__first, __last, __comp); } template void __merge_sort_with_buffer(_RandomAccessIter __first, _RandomAccessIter __last, _Pointer __buffer, _Distance*) { _Distance __len = __last - __first; _Pointer __buffer_last = __buffer + __len; _Distance __step_size = __stl_chunk_size; __chunk_insertion_sort(__first, __last, __step_size); while (__step_size < __len) { __merge_sort_loop(__first, __last, __buffer, __step_size); __step_size *= 2; __merge_sort_loop(__buffer, __buffer_last, __first, __step_size); __step_size *= 2; } } template void __merge_sort_with_buffer(_RandomAccessIter __first, _RandomAccessIter __last, _Pointer __buffer, _Distance*, _Compare __comp) { _Distance __len = __last - __first; _Pointer __buffer_last = __buffer + __len; _Distance __step_size = __stl_chunk_size; __chunk_insertion_sort(__first, __last, __step_size, __comp); while (__step_size < __len) { __merge_sort_loop(__first, __last, __buffer, __step_size, __comp); __step_size *= 2; __merge_sort_loop(__buffer, __buffer_last, __first, __step_size, __comp); __step_size *= 2; } } template void __stable_sort_adaptive(_RandomAccessIter __first, _RandomAccessIter __last, _Pointer __buffer, _Distance __buffer_size) { _Distance __len = (__last - __first + 1) / 2; _RandomAccessIter __middle = __first + __len; if (__len > __buffer_size) { __stable_sort_adaptive(__first, __middle, __buffer, __buffer_size); __stable_sort_adaptive(__middle, __last, __buffer, __buffer_size); } else { __merge_sort_with_buffer(__first, __middle, __buffer, (_Distance*)0); __merge_sort_with_buffer(__middle, __last, __buffer, (_Distance*)0); } __merge_adaptive(__first, __middle, __last, _Distance(__middle - __first), _Distance(__last - __middle), __buffer, __buffer_size); } template void __stable_sort_adaptive(_RandomAccessIter __first, _RandomAccessIter __last, _Pointer __buffer, _Distance __buffer_size, _Compare __comp) { _Distance __len = (__last - __first + 1) / 2; _RandomAccessIter __middle = __first + __len; if (__len > __buffer_size) { __stable_sort_adaptive(__first, __middle, __buffer, __buffer_size, __comp); __stable_sort_adaptive(__middle, __last, __buffer, __buffer_size, __comp); } else { __merge_sort_with_buffer(__first, __middle, __buffer, (_Distance*)0, __comp); __merge_sort_with_buffer(__middle, __last, __buffer, (_Distance*)0, __comp); } __merge_adaptive(__first, __middle, __last, _Distance(__middle - __first), _Distance(__last - __middle), __buffer, __buffer_size, __comp); } template inline void __stable_sort_aux(_RandomAccessIter __first, _RandomAccessIter __last, _Tp*, _Distance*) { _Temporary_buffer<_RandomAccessIter, _Tp> buf(__first, __last); if (buf.begin() == 0) __inplace_stable_sort(__first, __last); else __stable_sort_adaptive(__first, __last, buf.begin(), _Distance(buf.size())); } template inline void __stable_sort_aux(_RandomAccessIter __first, _RandomAccessIter __last, _Tp*, _Distance*, _Compare __comp) { _Temporary_buffer<_RandomAccessIter, _Tp> buf(__first, __last); if (buf.begin() == 0) __inplace_stable_sort(__first, __last, __comp); else __stable_sort_adaptive(__first, __last, buf.begin(), _Distance(buf.size()), __comp); } template inline void stable_sort(_RandomAccessIter __first, _RandomAccessIter __last) { __stable_sort_aux(__first, __last, __value_type( __first ) , __distance_type( __first ) ); } template inline void stable_sort(_RandomAccessIter __first, _RandomAccessIter __last, _Compare __comp) { __stable_sort_aux(__first, __last, __value_type( __first ) , __distance_type( __first ) , __comp); } template void __partial_sort(_RandomAccessIter __first, _RandomAccessIter __middle, _RandomAccessIter __last, _Tp*) { make_heap(__first, __middle); for (_RandomAccessIter __i = __middle; __i < __last; ++__i) if (*__i < *__first) __pop_heap(__first, __middle, __i, _Tp(*__i), __distance_type( __first ) ); sort_heap(__first, __middle); } template inline void partial_sort(_RandomAccessIter __first, _RandomAccessIter __middle, _RandomAccessIter __last) { __partial_sort(__first, __middle, __last, __value_type( __first ) ); } template void __partial_sort(_RandomAccessIter __first, _RandomAccessIter __middle, _RandomAccessIter __last, _Tp*, _Compare __comp) { make_heap(__first, __middle, __comp); for (_RandomAccessIter __i = __middle; __i < __last; ++__i) if (__comp(*__i, *__first)) __pop_heap(__first, __middle, __i, _Tp(*__i), __comp, __distance_type( __first ) ); sort_heap(__first, __middle, __comp); } template inline void partial_sort(_RandomAccessIter __first, _RandomAccessIter __middle, _RandomAccessIter __last, _Compare __comp) { __partial_sort(__first, __middle, __last, __value_type( __first ) , __comp); } template _RandomAccessIter __partial_sort_copy(_InputIter __first, _InputIter __last, _RandomAccessIter __result_first, _RandomAccessIter __result_last, _Distance*, _Tp*) { if (__result_first == __result_last) return __result_last; _RandomAccessIter __result_real_last = __result_first; while(__first != __last && __result_real_last != __result_last) { *__result_real_last = *__first; ++__result_real_last; ++__first; } make_heap(__result_first, __result_real_last); while (__first != __last) { if (*__first < *__result_first) __adjust_heap(__result_first, _Distance(0), _Distance(__result_real_last - __result_first), _Tp(*__first)); ++__first; } sort_heap(__result_first, __result_real_last); return __result_real_last; } template inline _RandomAccessIter partial_sort_copy(_InputIter __first, _InputIter __last, _RandomAccessIter __result_first, _RandomAccessIter __result_last) { return __partial_sort_copy(__first, __last, __result_first, __result_last, __distance_type( __result_first ) , __value_type( __first ) ); } template _RandomAccessIter __partial_sort_copy(_InputIter __first, _InputIter __last, _RandomAccessIter __result_first, _RandomAccessIter __result_last, _Compare __comp, _Distance*, _Tp*) { if (__result_first == __result_last) return __result_last; _RandomAccessIter __result_real_last = __result_first; while(__first != __last && __result_real_last != __result_last) { *__result_real_last = *__first; ++__result_real_last; ++__first; } make_heap(__result_first, __result_real_last, __comp); while (__first != __last) { if (__comp(*__first, *__result_first)) __adjust_heap(__result_first, _Distance(0), _Distance(__result_real_last - __result_first), _Tp(*__first), __comp); ++__first; } sort_heap(__result_first, __result_real_last, __comp); return __result_real_last; } template inline _RandomAccessIter partial_sort_copy(_InputIter __first, _InputIter __last, _RandomAccessIter __result_first, _RandomAccessIter __result_last, _Compare __comp) { return __partial_sort_copy(__first, __last, __result_first, __result_last, __comp, __distance_type( __result_first ) , __value_type( __first ) ); } template void __nth_element(_RandomAccessIter __first, _RandomAccessIter __nth, _RandomAccessIter __last, _Tp*) { while (__last - __first > 3) { _RandomAccessIter __cut = __unguarded_partition(__first, __last, _Tp(__median(*__first, *(__first + (__last - __first)/2), *(__last - 1)))); if (__cut <= __nth) __first = __cut; else __last = __cut; } __insertion_sort(__first, __last); } template inline void nth_element(_RandomAccessIter __first, _RandomAccessIter __nth, _RandomAccessIter __last) { __nth_element(__first, __nth, __last, __value_type( __first ) ); } template void __nth_element(_RandomAccessIter __first, _RandomAccessIter __nth, _RandomAccessIter __last, _Tp*, _Compare __comp) { while (__last - __first > 3) { _RandomAccessIter __cut = __unguarded_partition(__first, __last, _Tp(__median(*__first, *(__first + (__last - __first)/2), *(__last - 1), __comp)), __comp); if (__cut <= __nth) __first = __cut; else __last = __cut; } __insertion_sort(__first, __last, __comp); } template inline void nth_element(_RandomAccessIter __first, _RandomAccessIter __nth, _RandomAccessIter __last, _Compare __comp) { __nth_element(__first, __nth, __last, __value_type( __first ) , __comp); } template _ForwardIter __lower_bound(_ForwardIter __first, _ForwardIter __last, const _Tp& __val, _Distance*) { _Distance __len = 0; distance(__first, __last, __len); _Distance __half; _ForwardIter __middle; while (__len > 0) { __half = __len >> 1; __middle = __first; advance(__middle, __half); if (*__middle < __val) { __first = __middle; ++__first; __len = __len - __half - 1; } else __len = __half; } return __first; } template inline _ForwardIter lower_bound(_ForwardIter __first, _ForwardIter __last, const _Tp& __val) { return __lower_bound(__first, __last, __val, __distance_type( __first ) ); } template _ForwardIter __lower_bound(_ForwardIter __first, _ForwardIter __last, const _Tp& __val, _Compare __comp, _Distance*) { _Distance __len = 0; distance(__first, __last, __len); _Distance __half; _ForwardIter __middle; while (__len > 0) { __half = __len >> 1; __middle = __first; advance(__middle, __half); if (__comp(*__middle, __val)) { __first = __middle; ++__first; __len = __len - __half - 1; } else __len = __half; } return __first; } template inline _ForwardIter lower_bound(_ForwardIter __first, _ForwardIter __last, const _Tp& __val, _Compare __comp) { return __lower_bound(__first, __last, __val, __comp, __distance_type( __first ) ); } template _ForwardIter __upper_bound(_ForwardIter __first, _ForwardIter __last, const _Tp& __val, _Distance*) { _Distance __len = 0; distance(__first, __last, __len); _Distance __half; _ForwardIter __middle; while (__len > 0) { __half = __len >> 1; __middle = __first; advance(__middle, __half); if (__val < *__middle) __len = __half; else { __first = __middle; ++__first; __len = __len - __half - 1; } } return __first; } template inline _ForwardIter upper_bound(_ForwardIter __first, _ForwardIter __last, const _Tp& __val) { return __upper_bound(__first, __last, __val, __distance_type( __first ) ); } template _ForwardIter __upper_bound(_ForwardIter __first, _ForwardIter __last, const _Tp& __val, _Compare __comp, _Distance*) { _Distance __len = 0; distance(__first, __last, __len); _Distance __half; _ForwardIter __middle; while (__len > 0) { __half = __len >> 1; __middle = __first; advance(__middle, __half); if (__comp(__val, *__middle)) __len = __half; else { __first = __middle; ++__first; __len = __len - __half - 1; } } return __first; } template inline _ForwardIter upper_bound(_ForwardIter __first, _ForwardIter __last, const _Tp& __val, _Compare __comp) { return __upper_bound(__first, __last, __val, __comp, __distance_type( __first ) ); } template pair<_ForwardIter, _ForwardIter> __equal_range(_ForwardIter __first, _ForwardIter __last, const _Tp& __val, _Distance*) { _Distance __len = 0; distance(__first, __last, __len); _Distance __half; _ForwardIter __middle, __left, __right; while (__len > 0) { __half = __len >> 1; __middle = __first; advance(__middle, __half); if (*__middle < __val) { __first = __middle; ++__first; __len = __len - __half - 1; } else if (__val < *__middle) __len = __half; else { __left = lower_bound(__first, __middle, __val); advance(__first, __len); __right = upper_bound(++__middle, __first, __val); return pair<_ForwardIter, _ForwardIter>(__left, __right); } } return pair<_ForwardIter, _ForwardIter>(__first, __first); } template inline pair<_ForwardIter, _ForwardIter> equal_range(_ForwardIter __first, _ForwardIter __last, const _Tp& __val) { return __equal_range(__first, __last, __val, __distance_type( __first ) ); } template pair<_ForwardIter, _ForwardIter> __equal_range(_ForwardIter __first, _ForwardIter __last, const _Tp& __val, _Compare __comp, _Distance*) { _Distance __len = 0; distance(__first, __last, __len); _Distance __half; _ForwardIter __middle, __left, __right; while (__len > 0) { __half = __len >> 1; __middle = __first; advance(__middle, __half); if (__comp(*__middle, __val)) { __first = __middle; ++__first; __len = __len - __half - 1; } else if (__comp(__val, *__middle)) __len = __half; else { __left = lower_bound(__first, __middle, __val, __comp); advance(__first, __len); __right = upper_bound(++__middle, __first, __val, __comp); return pair<_ForwardIter, _ForwardIter>(__left, __right); } } return pair<_ForwardIter, _ForwardIter>(__first, __first); } template inline pair<_ForwardIter, _ForwardIter> equal_range(_ForwardIter __first, _ForwardIter __last, const _Tp& __val, _Compare __comp) { return __equal_range(__first, __last, __val, __comp, __distance_type( __first ) ); } template bool binary_search(_ForwardIter __first, _ForwardIter __last, const _Tp& __val) { _ForwardIter __i = lower_bound(__first, __last, __val); return __i != __last && !(__val < *__i); } template bool binary_search(_ForwardIter __first, _ForwardIter __last, const _Tp& __val, _Compare __comp) { _ForwardIter __i = lower_bound(__first, __last, __val, __comp); return __i != __last && !__comp(__val, *__i); } template _OutputIter merge(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _OutputIter __result) { while (__first1 != __last1 && __first2 != __last2) { if (*__first2 < *__first1) { *__result = *__first2; ++__first2; } else { *__result = *__first1; ++__first1; } ++__result; } return copy(__first2, __last2, copy(__first1, __last1, __result)); } template _OutputIter merge(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _OutputIter __result, _Compare __comp) { while (__first1 != __last1 && __first2 != __last2) { if (__comp(*__first2, *__first1)) { *__result = *__first2; ++__first2; } else { *__result = *__first1; ++__first1; } ++__result; } return copy(__first2, __last2, copy(__first1, __last1, __result)); } template void __merge_without_buffer(_BidirectionalIter __first, _BidirectionalIter __middle, _BidirectionalIter __last, _Distance __len1, _Distance __len2) { if (__len1 == 0 || __len2 == 0) return; if (__len1 + __len2 == 2) { if (*__middle < *__first) iter_swap(__first, __middle); return; } _BidirectionalIter __first_cut = __first; _BidirectionalIter __second_cut = __middle; _Distance __len11 = 0; _Distance __len22 = 0; if (__len1 > __len2) { __len11 = __len1 / 2; advance(__first_cut, __len11); __second_cut = lower_bound(__middle, __last, *__first_cut); distance(__middle, __second_cut, __len22); } else { __len22 = __len2 / 2; advance(__second_cut, __len22); __first_cut = upper_bound(__first, __middle, *__second_cut); distance(__first, __first_cut, __len11); } _BidirectionalIter __new_middle = rotate(__first_cut, __middle, __second_cut); __merge_without_buffer(__first, __first_cut, __new_middle, __len11, __len22); __merge_without_buffer(__new_middle, __second_cut, __last, __len1 - __len11, __len2 - __len22); } template void __merge_without_buffer(_BidirectionalIter __first, _BidirectionalIter __middle, _BidirectionalIter __last, _Distance __len1, _Distance __len2, _Compare __comp) { if (__len1 == 0 || __len2 == 0) return; if (__len1 + __len2 == 2) { if (__comp(*__middle, *__first)) iter_swap(__first, __middle); return; } _BidirectionalIter __first_cut = __first; _BidirectionalIter __second_cut = __middle; _Distance __len11 = 0; _Distance __len22 = 0; if (__len1 > __len2) { __len11 = __len1 / 2; advance(__first_cut, __len11); __second_cut = lower_bound(__middle, __last, *__first_cut, __comp); distance(__middle, __second_cut, __len22); } else { __len22 = __len2 / 2; advance(__second_cut, __len22); __first_cut = upper_bound(__first, __middle, *__second_cut, __comp); distance(__first, __first_cut, __len11); } _BidirectionalIter __new_middle = rotate(__first_cut, __middle, __second_cut); __merge_without_buffer(__first, __first_cut, __new_middle, __len11, __len22, __comp); __merge_without_buffer(__new_middle, __second_cut, __last, __len1 - __len11, __len2 - __len22, __comp); } template _BidirectionalIter1 __rotate_adaptive(_BidirectionalIter1 __first, _BidirectionalIter1 __middle, _BidirectionalIter1 __last, _Distance __len1, _Distance __len2, _BidirectionalIter2 __buffer, _Distance __buffer_size) { _BidirectionalIter2 __buffer_end; if (__len1 > __len2 && __len2 <= __buffer_size) { __buffer_end = copy(__middle, __last, __buffer); copy_backward(__first, __middle, __last); return copy(__buffer, __buffer_end, __first); } else if (__len1 <= __buffer_size) { __buffer_end = copy(__first, __middle, __buffer); copy(__middle, __last, __first); return copy_backward(__buffer, __buffer_end, __last); } else return rotate(__first, __middle, __last); } template _BidirectionalIter3 __merge_backward(_BidirectionalIter1 __first1, _BidirectionalIter1 __last1, _BidirectionalIter2 __first2, _BidirectionalIter2 __last2, _BidirectionalIter3 __result) { if (__first1 == __last1) return copy_backward(__first2, __last2, __result); if (__first2 == __last2) return copy_backward(__first1, __last1, __result); --__last1; --__last2; while (true) { if (*__last2 < *__last1) { *--__result = *__last1; if (__first1 == __last1) return copy_backward(__first2, ++__last2, __result); --__last1; } else { *--__result = *__last2; if (__first2 == __last2) return copy_backward(__first1, ++__last1, __result); --__last2; } } } template _BidirectionalIter3 __merge_backward(_BidirectionalIter1 __first1, _BidirectionalIter1 __last1, _BidirectionalIter2 __first2, _BidirectionalIter2 __last2, _BidirectionalIter3 __result, _Compare __comp) { if (__first1 == __last1) return copy_backward(__first2, __last2, __result); if (__first2 == __last2) return copy_backward(__first1, __last1, __result); --__last1; --__last2; while (true) { if (__comp(*__last2, *__last1)) { *--__result = *__last1; if (__first1 == __last1) return copy_backward(__first2, ++__last2, __result); --__last1; } else { *--__result = *__last2; if (__first2 == __last2) return copy_backward(__first1, ++__last1, __result); --__last2; } } } template void __merge_adaptive(_BidirectionalIter __first, _BidirectionalIter __middle, _BidirectionalIter __last, _Distance __len1, _Distance __len2, _Pointer __buffer, _Distance __buffer_size) { if (__len1 <= __len2 && __len1 <= __buffer_size) { _Pointer __buffer_end = copy(__first, __middle, __buffer); merge(__buffer, __buffer_end, __middle, __last, __first); } else if (__len2 <= __buffer_size) { _Pointer __buffer_end = copy(__middle, __last, __buffer); __merge_backward(__first, __middle, __buffer, __buffer_end, __last); } else { _BidirectionalIter __first_cut = __first; _BidirectionalIter __second_cut = __middle; _Distance __len11 = 0; _Distance __len22 = 0; if (__len1 > __len2) { __len11 = __len1 / 2; advance(__first_cut, __len11); __second_cut = lower_bound(__middle, __last, *__first_cut); distance(__middle, __second_cut, __len22); } else { __len22 = __len2 / 2; advance(__second_cut, __len22); __first_cut = upper_bound(__first, __middle, *__second_cut); distance(__first, __first_cut, __len11); } _BidirectionalIter __new_middle = __rotate_adaptive(__first_cut, __middle, __second_cut, __len1 - __len11, __len22, __buffer, __buffer_size); __merge_adaptive(__first, __first_cut, __new_middle, __len11, __len22, __buffer, __buffer_size); __merge_adaptive(__new_middle, __second_cut, __last, __len1 - __len11, __len2 - __len22, __buffer, __buffer_size); } } template void __merge_adaptive(_BidirectionalIter __first, _BidirectionalIter __middle, _BidirectionalIter __last, _Distance __len1, _Distance __len2, _Pointer __buffer, _Distance __buffer_size, _Compare __comp) { if (__len1 <= __len2 && __len1 <= __buffer_size) { _Pointer __buffer_end = copy(__first, __middle, __buffer); merge(__buffer, __buffer_end, __middle, __last, __first, __comp); } else if (__len2 <= __buffer_size) { _Pointer __buffer_end = copy(__middle, __last, __buffer); __merge_backward(__first, __middle, __buffer, __buffer_end, __last, __comp); } else { _BidirectionalIter __first_cut = __first; _BidirectionalIter __second_cut = __middle; _Distance __len11 = 0; _Distance __len22 = 0; if (__len1 > __len2) { __len11 = __len1 / 2; advance(__first_cut, __len11); __second_cut = lower_bound(__middle, __last, *__first_cut, __comp); distance(__middle, __second_cut, __len22); } else { __len22 = __len2 / 2; advance(__second_cut, __len22); __first_cut = upper_bound(__first, __middle, *__second_cut, __comp); distance(__first, __first_cut, __len11); } _BidirectionalIter __new_middle = __rotate_adaptive(__first_cut, __middle, __second_cut, __len1 - __len11, __len22, __buffer, __buffer_size); __merge_adaptive(__first, __first_cut, __new_middle, __len11, __len22, __buffer, __buffer_size, __comp); __merge_adaptive(__new_middle, __second_cut, __last, __len1 - __len11, __len2 - __len22, __buffer, __buffer_size, __comp); } } template inline void __inplace_merge_aux(_BidirectionalIter __first, _BidirectionalIter __middle, _BidirectionalIter __last, _Tp*, _Distance*) { _Distance __len1 = 0; distance(__first, __middle, __len1); _Distance __len2 = 0; distance(__middle, __last, __len2); _Temporary_buffer<_BidirectionalIter, _Tp> __buf(__first, __last); if (__buf.begin() == 0) __merge_without_buffer(__first, __middle, __last, __len1, __len2); else __merge_adaptive(__first, __middle, __last, __len1, __len2, __buf.begin(), _Distance(__buf.size())); } template inline void __inplace_merge_aux(_BidirectionalIter __first, _BidirectionalIter __middle, _BidirectionalIter __last, _Tp*, _Distance*, _Compare __comp) { _Distance __len1 = 0; distance(__first, __middle, __len1); _Distance __len2 = 0; distance(__middle, __last, __len2); _Temporary_buffer<_BidirectionalIter, _Tp> __buf(__first, __last); if (__buf.begin() == 0) __merge_without_buffer(__first, __middle, __last, __len1, __len2, __comp); else __merge_adaptive(__first, __middle, __last, __len1, __len2, __buf.begin(), _Distance(__buf.size()), __comp); } template inline void inplace_merge(_BidirectionalIter __first, _BidirectionalIter __middle, _BidirectionalIter __last) { if (__first == __middle || __middle == __last) return; __inplace_merge_aux(__first, __middle, __last, __value_type( __first ) , __distance_type( __first ) ); } template inline void inplace_merge(_BidirectionalIter __first, _BidirectionalIter __middle, _BidirectionalIter __last, _Compare __comp) { if (__first == __middle || __middle == __last) return; __inplace_merge_aux(__first, __middle, __last, __value_type( __first ) , __distance_type( __first ) , __comp); } template bool includes(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2) { while (__first1 != __last1 && __first2 != __last2) if (*__first2 < *__first1) return false; else if(*__first1 < *__first2) ++__first1; else ++__first1, ++__first2; return __first2 == __last2; } template bool includes(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _Compare __comp) { while (__first1 != __last1 && __first2 != __last2) if (__comp(*__first2, *__first1)) return false; else if(__comp(*__first1, *__first2)) ++__first1; else ++__first1, ++__first2; return __first2 == __last2; } template _OutputIter set_union(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _OutputIter __result) { while (__first1 != __last1 && __first2 != __last2) { if (*__first1 < *__first2) { *__result = *__first1; ++__first1; } else if (*__first2 < *__first1) { *__result = *__first2; ++__first2; } else { *__result = *__first1; ++__first1; ++__first2; } ++__result; } return copy(__first2, __last2, copy(__first1, __last1, __result)); } template _OutputIter set_union(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _OutputIter __result, _Compare __comp) { while (__first1 != __last1 && __first2 != __last2) { if (__comp(*__first1, *__first2)) { *__result = *__first1; ++__first1; } else if (__comp(*__first2, *__first1)) { *__result = *__first2; ++__first2; } else { *__result = *__first1; ++__first1; ++__first2; } ++__result; } return copy(__first2, __last2, copy(__first1, __last1, __result)); } template _OutputIter set_intersection(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _OutputIter __result) { while (__first1 != __last1 && __first2 != __last2) if (*__first1 < *__first2) ++__first1; else if (*__first2 < *__first1) ++__first2; else { *__result = *__first1; ++__first1; ++__first2; ++__result; } return __result; } template _OutputIter set_intersection(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _OutputIter __result, _Compare __comp) { while (__first1 != __last1 && __first2 != __last2) if (__comp(*__first1, *__first2)) ++__first1; else if (__comp(*__first2, *__first1)) ++__first2; else { *__result = *__first1; ++__first1; ++__first2; ++__result; } return __result; } template _OutputIter set_difference(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _OutputIter __result) { while (__first1 != __last1 && __first2 != __last2) if (*__first1 < *__first2) { *__result = *__first1; ++__first1; ++__result; } else if (*__first2 < *__first1) ++__first2; else { ++__first1; ++__first2; } return copy(__first1, __last1, __result); } template _OutputIter set_difference(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _OutputIter __result, _Compare __comp) { while (__first1 != __last1 && __first2 != __last2) if (__comp(*__first1, *__first2)) { *__result = *__first1; ++__first1; ++__result; } else if (__comp(*__first2, *__first1)) ++__first2; else { ++__first1; ++__first2; } return copy(__first1, __last1, __result); } template _OutputIter set_symmetric_difference(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _OutputIter __result) { while (__first1 != __last1 && __first2 != __last2) if (*__first1 < *__first2) { *__result = *__first1; ++__first1; ++__result; } else if (*__first2 < *__first1) { *__result = *__first2; ++__first2; ++__result; } else { ++__first1; ++__first2; } return copy(__first2, __last2, copy(__first1, __last1, __result)); } template _OutputIter set_symmetric_difference(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _OutputIter __result, _Compare __comp) { while (__first1 != __last1 && __first2 != __last2) if (__comp(*__first1, *__first2)) { *__result = *__first1; ++__first1; ++__result; } else if (__comp(*__first2, *__first1)) { *__result = *__first2; ++__first2; ++__result; } else { ++__first1; ++__first2; } return copy(__first2, __last2, copy(__first1, __last1, __result)); } template _ForwardIter max_element(_ForwardIter __first, _ForwardIter __last) { if (__first == __last) return __first; _ForwardIter __result = __first; while (++__first != __last) if (*__result < *__first) __result = __first; return __result; } template _ForwardIter max_element(_ForwardIter __first, _ForwardIter __last, _Compare __comp) { if (__first == __last) return __first; _ForwardIter __result = __first; while (++__first != __last) if (__comp(*__result, *__first)) __result = __first; return __result; } template _ForwardIter min_element(_ForwardIter __first, _ForwardIter __last) { if (__first == __last) return __first; _ForwardIter __result = __first; while (++__first != __last) if (*__first < *__result) __result = __first; return __result; } template _ForwardIter min_element(_ForwardIter __first, _ForwardIter __last, _Compare __comp) { if (__first == __last) return __first; _ForwardIter __result = __first; while (++__first != __last) if (__comp(*__first, *__result)) __result = __first; return __result; } template bool next_permutation(_BidirectionalIter __first, _BidirectionalIter __last) { if (__first == __last) return false; _BidirectionalIter __i = __first; ++__i; if (__i == __last) return false; __i = __last; --__i; for(;;) { _BidirectionalIter __ii = __i; --__i; if (*__i < *__ii) { _BidirectionalIter __j = __last; while (!(*__i < *--__j)) {} iter_swap(__i, __j); reverse(__ii, __last); return true; } if (__i == __first) { reverse(__first, __last); return false; } } } template bool next_permutation(_BidirectionalIter __first, _BidirectionalIter __last, _Compare __comp) { if (__first == __last) return false; _BidirectionalIter __i = __first; ++__i; if (__i == __last) return false; __i = __last; --__i; for(;;) { _BidirectionalIter __ii = __i; --__i; if (__comp(*__i, *__ii)) { _BidirectionalIter __j = __last; while (!__comp(*__i, *--__j)) {} iter_swap(__i, __j); reverse(__ii, __last); return true; } if (__i == __first) { reverse(__first, __last); return false; } } } template bool prev_permutation(_BidirectionalIter __first, _BidirectionalIter __last) { if (__first == __last) return false; _BidirectionalIter __i = __first; ++__i; if (__i == __last) return false; __i = __last; --__i; for(;;) { _BidirectionalIter __ii = __i; --__i; if (*__ii < *__i) { _BidirectionalIter __j = __last; while (!(*--__j < *__i)) {} iter_swap(__i, __j); reverse(__ii, __last); return true; } if (__i == __first) { reverse(__first, __last); return false; } } } template bool prev_permutation(_BidirectionalIter __first, _BidirectionalIter __last, _Compare __comp) { if (__first == __last) return false; _BidirectionalIter __i = __first; ++__i; if (__i == __last) return false; __i = __last; --__i; for(;;) { _BidirectionalIter __ii = __i; --__i; if (__comp(*__ii, *__i)) { _BidirectionalIter __j = __last; while (!__comp(*--__j, *__i)) {} iter_swap(__i, __j); reverse(__ii, __last); return true; } if (__i == __first) { reverse(__first, __last); return false; } } } template _InputIter find_first_of(_InputIter __first1, _InputIter __last1, _ForwardIter __first2, _ForwardIter __last2) { for ( ; __first1 != __last1; ++__first1) for (_ForwardIter __iter = __first2; __iter != __last2; ++__iter) if (*__first1 == *__iter) return __first1; return __last1; } template _InputIter find_first_of(_InputIter __first1, _InputIter __last1, _ForwardIter __first2, _ForwardIter __last2, _BinaryPredicate __comp) { for ( ; __first1 != __last1; ++__first1) for (_ForwardIter __iter = __first2; __iter != __last2; ++__iter) if (__comp(*__first1, *__iter)) return __first1; return __last1; } template _ForwardIter1 __find_end(_ForwardIter1 __first1, _ForwardIter1 __last1, _ForwardIter2 __first2, _ForwardIter2 __last2, forward_iterator_tag, forward_iterator_tag) { if (__first2 == __last2) return __last1; else { _ForwardIter1 __result = __last1; while (1) { _ForwardIter1 __new_result = search(__first1, __last1, __first2, __last2); if (__new_result == __last1) return __result; else { __result = __new_result; __first1 = __new_result; ++__first1; } } } } template _ForwardIter1 __find_end(_ForwardIter1 __first1, _ForwardIter1 __last1, _ForwardIter2 __first2, _ForwardIter2 __last2, forward_iterator_tag, forward_iterator_tag, _BinaryPredicate __comp) { if (__first2 == __last2) return __last1; else { _ForwardIter1 __result = __last1; while (1) { _ForwardIter1 __new_result = search(__first1, __last1, __first2, __last2, __comp); if (__new_result == __last1) return __result; else { __result = __new_result; __first1 = __new_result; ++__first1; } } } } template _BidirectionalIter1 __find_end(_BidirectionalIter1 __first1, _BidirectionalIter1 __last1, _BidirectionalIter2 __first2, _BidirectionalIter2 __last2, bidirectional_iterator_tag, bidirectional_iterator_tag) { typedef reverse_iterator<_BidirectionalIter1> _RevIter1; typedef reverse_iterator<_BidirectionalIter2> _RevIter2; _RevIter1 __rlast1(__first1); _RevIter2 __rlast2(__first2); _RevIter1 __rresult = search(_RevIter1(__last1), __rlast1, _RevIter2(__last2), __rlast2); if (__rresult == __rlast1) return __last1; else { _BidirectionalIter1 __result = __rresult.base(); advance(__result, -distance(__first2, __last2)); return __result; } } template _BidirectionalIter1 __find_end(_BidirectionalIter1 __first1, _BidirectionalIter1 __last1, _BidirectionalIter2 __first2, _BidirectionalIter2 __last2, bidirectional_iterator_tag, bidirectional_iterator_tag, _BinaryPredicate __comp) { typedef reverse_iterator<_BidirectionalIter1> _RevIter1; typedef reverse_iterator<_BidirectionalIter2> _RevIter2; _RevIter1 __rlast1(__first1); _RevIter2 __rlast2(__first2); _RevIter1 __rresult = search(_RevIter1(__last1), __rlast1, _RevIter2(__last2), __rlast2, __comp); if (__rresult == __rlast1) return __last1; else { _BidirectionalIter1 __result = __rresult.base(); advance(__result, -distance(__first2, __last2)); return __result; } } template inline _ForwardIter1 find_end(_ForwardIter1 __first1, _ForwardIter1 __last1, _ForwardIter2 __first2, _ForwardIter2 __last2) { return __find_end(__first1, __last1, __first2, __last2, __iterator_category( __first1 ) , __iterator_category( __first2 ) ); } template inline _ForwardIter1 find_end(_ForwardIter1 __first1, _ForwardIter1 __last1, _ForwardIter2 __first2, _ForwardIter2 __last2, _BinaryPredicate __comp) { return __find_end(__first1, __last1, __first2, __last2, __iterator_category( __first1 ) , __iterator_category( __first2 ) , __comp); } template bool __is_heap(_RandomAccessIter __first, _Distance __n) { _Distance __parent = 0; for (_Distance __child = 1; __child < __n; ++__child) { if (__first[__parent] < __first[__child]) return false; if ((__child & 1) == 0) ++__parent; } return true; } template bool __is_heap(_RandomAccessIter __first, _StrictWeakOrdering __comp, _Distance __n) { _Distance __parent = 0; for (_Distance __child = 1; __child < __n; ++__child) { if (__comp(__first[__parent], __first[__child])) return false; if ((__child & 1) == 0) ++__parent; } return true; } template inline bool is_heap(_RandomAccessIter __first, _RandomAccessIter __last) { return __is_heap(__first, __last - __first); } template inline bool is_heap(_RandomAccessIter __first, _RandomAccessIter __last, _StrictWeakOrdering __comp) { return __is_heap(__first, __comp, __last - __first); } template bool is_sorted(_ForwardIter __first, _ForwardIter __last) { if (__first == __last) return true; _ForwardIter __next = __first; for (++__next; __next != __last; __first = __next, ++__next) { if (*__next < *__first) return false; } return true; } template bool is_sorted(_ForwardIter __first, _ForwardIter __last, _StrictWeakOrdering __comp) { if (__first == __last) return true; _ForwardIter __next = __first; for (++__next; __next != __last; __first = __next, ++__next) { if (__comp(*__next, *__first)) return false; } return true; } # 34 "/usr/include/g++-3/algorithm" 2 3 # 38 "/usr/include/boost/spirit/utility/impl/chset.ipp" 2 3 # 1 "/usr/include/g++-3/functional" 1 3 # 1 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/stddef.h" 1 3 # 345 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/stddef.h" 3 # 19 "/usr/include/g++-3/functional" 2 3 # 1 "/usr/include/g++-3/stl_function.h" 1 3 template struct unary_function { typedef _Arg argument_type; typedef _Result result_type; }; template struct binary_function { typedef _Arg1 first_argument_type; typedef _Arg2 second_argument_type; typedef _Result result_type; }; template struct plus : public binary_function<_Tp,_Tp,_Tp> { _Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x + __y; } }; template struct minus : public binary_function<_Tp,_Tp,_Tp> { _Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x - __y; } }; template struct multiplies : public binary_function<_Tp,_Tp,_Tp> { _Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x * __y; } }; template struct divides : public binary_function<_Tp,_Tp,_Tp> { _Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x / __y; } }; template inline _Tp identity_element(plus<_Tp>) { return _Tp(0); } template inline _Tp identity_element(multiplies<_Tp>) { return _Tp(1); } template struct modulus : public binary_function<_Tp,_Tp,_Tp> { _Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x % __y; } }; template struct negate : public unary_function<_Tp,_Tp> { _Tp operator()(const _Tp& __x) const { return -__x; } }; template struct equal_to : public binary_function<_Tp,_Tp,bool> { bool operator()(const _Tp& __x, const _Tp& __y) const { return __x == __y; } }; template struct not_equal_to : public binary_function<_Tp,_Tp,bool> { bool operator()(const _Tp& __x, const _Tp& __y) const { return __x != __y; } }; template struct greater : public binary_function<_Tp,_Tp,bool> { bool operator()(const _Tp& __x, const _Tp& __y) const { return __x > __y; } }; template struct less : public binary_function<_Tp,_Tp,bool> { bool operator()(const _Tp& __x, const _Tp& __y) const { return __x < __y; } }; template struct greater_equal : public binary_function<_Tp,_Tp,bool> { bool operator()(const _Tp& __x, const _Tp& __y) const { return __x >= __y; } }; template struct less_equal : public binary_function<_Tp,_Tp,bool> { bool operator()(const _Tp& __x, const _Tp& __y) const { return __x <= __y; } }; template struct logical_and : public binary_function<_Tp,_Tp,bool> { bool operator()(const _Tp& __x, const _Tp& __y) const { return __x && __y; } }; template struct logical_or : public binary_function<_Tp,_Tp,bool> { bool operator()(const _Tp& __x, const _Tp& __y) const { return __x || __y; } }; template struct logical_not : public unary_function<_Tp,bool> { bool operator()(const _Tp& __x) const { return !__x; } }; template class unary_negate : public unary_function { protected: _Predicate _M_pred; public: explicit unary_negate(const _Predicate& __x) : _M_pred(__x) {} bool operator()(const typename _Predicate::argument_type& __x) const { return !_M_pred(__x); } }; template inline unary_negate<_Predicate> not1(const _Predicate& __pred) { return unary_negate<_Predicate>(__pred); } template class binary_negate : public binary_function { protected: _Predicate _M_pred; public: explicit binary_negate(const _Predicate& __x) : _M_pred(__x) {} bool operator()(const typename _Predicate::first_argument_type& __x, const typename _Predicate::second_argument_type& __y) const { return !_M_pred(__x, __y); } }; template inline binary_negate<_Predicate> not2(const _Predicate& __pred) { return binary_negate<_Predicate>(__pred); } template class binder1st : public unary_function { protected: _Operation op; typename _Operation::first_argument_type value; public: binder1st(const _Operation& __x, const typename _Operation::first_argument_type& __y) : op(__x), value(__y) {} typename _Operation::result_type operator()(const typename _Operation::second_argument_type& __x) const { return op(value, __x); } }; template inline binder1st<_Operation> bind1st(const _Operation& __oper, const _Tp& __x) { typedef typename _Operation::first_argument_type _Arg1_type; return binder1st<_Operation>(__oper, _Arg1_type(__x)); } template class binder2nd : public unary_function { protected: _Operation op; typename _Operation::second_argument_type value; public: binder2nd(const _Operation& __x, const typename _Operation::second_argument_type& __y) : op(__x), value(__y) {} typename _Operation::result_type operator()(const typename _Operation::first_argument_type& __x) const { return op(__x, value); } }; template inline binder2nd<_Operation> bind2nd(const _Operation& __oper, const _Tp& __x) { typedef typename _Operation::second_argument_type _Arg2_type; return binder2nd<_Operation>(__oper, _Arg2_type(__x)); } template class unary_compose : public unary_function { protected: _Operation1 __op1; _Operation2 __op2; public: unary_compose(const _Operation1& __x, const _Operation2& __y) : __op1(__x), __op2(__y) {} typename _Operation1::result_type operator()(const typename _Operation2::argument_type& __x) const { return __op1(__op2(__x)); } }; template inline unary_compose<_Operation1,_Operation2> compose1(const _Operation1& __op1, const _Operation2& __op2) { return unary_compose<_Operation1,_Operation2>(__op1, __op2); } template class binary_compose : public unary_function { protected: _Operation1 _M_op1; _Operation2 _M_op2; _Operation3 _M_op3; public: binary_compose(const _Operation1& __x, const _Operation2& __y, const _Operation3& __z) : _M_op1(__x), _M_op2(__y), _M_op3(__z) { } typename _Operation1::result_type operator()(const typename _Operation2::argument_type& __x) const { return _M_op1(_M_op2(__x), _M_op3(__x)); } }; template inline binary_compose<_Operation1, _Operation2, _Operation3> compose2(const _Operation1& __op1, const _Operation2& __op2, const _Operation3& __op3) { return binary_compose<_Operation1,_Operation2,_Operation3> (__op1, __op2, __op3); } template class pointer_to_unary_function : public unary_function<_Arg, _Result> { protected: _Result (*_M_ptr)(_Arg); public: pointer_to_unary_function() {} explicit pointer_to_unary_function(_Result (*__x)(_Arg)) : _M_ptr(__x) {} _Result operator()(_Arg __x) const { return _M_ptr(__x); } }; template inline pointer_to_unary_function<_Arg, _Result> ptr_fun(_Result (*__x)(_Arg)) { return pointer_to_unary_function<_Arg, _Result>(__x); } template class pointer_to_binary_function : public binary_function<_Arg1,_Arg2,_Result> { protected: _Result (*_M_ptr)(_Arg1, _Arg2); public: pointer_to_binary_function() {} explicit pointer_to_binary_function(_Result (*__x)(_Arg1, _Arg2)) : _M_ptr(__x) {} _Result operator()(_Arg1 __x, _Arg2 __y) const { return _M_ptr(__x, __y); } }; template inline pointer_to_binary_function<_Arg1,_Arg2,_Result> ptr_fun(_Result (*__x)(_Arg1, _Arg2)) { return pointer_to_binary_function<_Arg1,_Arg2,_Result>(__x); } template struct _Identity : public unary_function<_Tp,_Tp> { const _Tp& operator()(const _Tp& __x) const { return __x; } }; template struct identity : public _Identity<_Tp> {}; template struct _Select1st : public unary_function<_Pair, typename _Pair::first_type> { const typename _Pair::first_type& operator()(const _Pair& __x) const { return __x.first; } }; template struct _Select2nd : public unary_function<_Pair, typename _Pair::second_type> { const typename _Pair::second_type& operator()(const _Pair& __x) const { return __x.second; } }; template struct select1st : public _Select1st<_Pair> {}; template struct select2nd : public _Select2nd<_Pair> {}; template struct _Project1st : public binary_function<_Arg1, _Arg2, _Arg1> { _Arg1 operator()(const _Arg1& __x, const _Arg2&) const { return __x; } }; template struct _Project2nd : public binary_function<_Arg1, _Arg2, _Arg2> { _Arg2 operator()(const _Arg1&, const _Arg2& __y) const { return __y; } }; template struct project1st : public _Project1st<_Arg1, _Arg2> {}; template struct project2nd : public _Project2nd<_Arg1, _Arg2> {}; template struct constant_void_fun { typedef _Result result_type; result_type __val; constant_void_fun(const result_type& __v) : __val(__v) {} const result_type& operator()() const { return __val; } }; template struct constant_unary_fun : public unary_function<_Argument, _Result> { _Result _M_val; constant_unary_fun(const _Result& __v) : _M_val(__v) {} const _Result& operator()(const _Argument&) const { return _M_val; } }; template struct constant_binary_fun : public binary_function<_Arg1, _Arg2, _Result> { _Result _M_val; constant_binary_fun(const _Result& __v) : _M_val(__v) {} const _Result& operator()(const _Arg1&, const _Arg2&) const { return _M_val; } }; template inline constant_void_fun<_Result> constant0(const _Result& __val) { return constant_void_fun<_Result>(__val); } template inline constant_unary_fun<_Result,_Result> constant1(const _Result& __val) { return constant_unary_fun<_Result,_Result>(__val); } template inline constant_binary_fun<_Result,_Result,_Result> constant2(const _Result& __val) { return constant_binary_fun<_Result,_Result,_Result>(__val); } class subtractive_rng : public unary_function { private: unsigned int _M_table[55]; size_t _M_index1; size_t _M_index2; public: unsigned int operator()(unsigned int __limit) { _M_index1 = (_M_index1 + 1) % 55; _M_index2 = (_M_index2 + 1) % 55; _M_table[_M_index1] = _M_table[_M_index1] - _M_table[_M_index2]; return _M_table[_M_index1] % __limit; } void _M_initialize(unsigned int __seed) { unsigned int __k = 1; _M_table[54] = __seed; size_t __i; for (__i = 0; __i < 54; __i++) { size_t __ii = (21 * (__i + 1) % 55) - 1; _M_table[__ii] = __k; __k = __seed - __k; __seed = _M_table[__ii]; } for (int __loop = 0; __loop < 4; __loop++) { for (__i = 0; __i < 55; __i++) _M_table[__i] = _M_table[__i] - _M_table[(1 + __i + 30) % 55]; } _M_index1 = 0; _M_index2 = 31; } subtractive_rng(unsigned int __seed) { _M_initialize(__seed); } subtractive_rng() { _M_initialize(161803398u); } }; template class mem_fun_t : public unary_function<_Tp*,_Ret> { public: explicit mem_fun_t(_Ret (_Tp::*__pf)()) : _M_f(__pf) {} _Ret operator()(_Tp* __p) const { return (__p->*_M_f)(); } private: _Ret (_Tp::*_M_f)(); }; template class const_mem_fun_t : public unary_function { public: explicit const_mem_fun_t(_Ret (_Tp::*__pf)() const) : _M_f(__pf) {} _Ret operator()(const _Tp* __p) const { return (__p->*_M_f)(); } private: _Ret (_Tp::*_M_f)() const; }; template class mem_fun_ref_t : public unary_function<_Tp,_Ret> { public: explicit mem_fun_ref_t(_Ret (_Tp::*__pf)()) : _M_f(__pf) {} _Ret operator()(_Tp& __r) const { return (__r.*_M_f)(); } private: _Ret (_Tp::*_M_f)(); }; template class const_mem_fun_ref_t : public unary_function<_Tp,_Ret> { public: explicit const_mem_fun_ref_t(_Ret (_Tp::*__pf)() const) : _M_f(__pf) {} _Ret operator()(const _Tp& __r) const { return (__r.*_M_f)(); } private: _Ret (_Tp::*_M_f)() const; }; template class mem_fun1_t : public binary_function<_Tp*,_Arg,_Ret> { public: explicit mem_fun1_t(_Ret (_Tp::*__pf)(_Arg)) : _M_f(__pf) {} _Ret operator()(_Tp* __p, _Arg __x) const { return (__p->*_M_f)(__x); } private: _Ret (_Tp::*_M_f)(_Arg); }; template class const_mem_fun1_t : public binary_function { public: explicit const_mem_fun1_t(_Ret (_Tp::*__pf)(_Arg) const) : _M_f(__pf) {} _Ret operator()(const _Tp* __p, _Arg __x) const { return (__p->*_M_f)(__x); } private: _Ret (_Tp::*_M_f)(_Arg) const; }; template class mem_fun1_ref_t : public binary_function<_Tp,_Arg,_Ret> { public: explicit mem_fun1_ref_t(_Ret (_Tp::*__pf)(_Arg)) : _M_f(__pf) {} _Ret operator()(_Tp& __r, _Arg __x) const { return (__r.*_M_f)(__x); } private: _Ret (_Tp::*_M_f)(_Arg); }; template class const_mem_fun1_ref_t : public binary_function<_Tp,_Arg,_Ret> { public: explicit const_mem_fun1_ref_t(_Ret (_Tp::*__pf)(_Arg) const) : _M_f(__pf) {} _Ret operator()(const _Tp& __r, _Arg __x) const { return (__r.*_M_f)(__x); } private: _Ret (_Tp::*_M_f)(_Arg) const; }; template class mem_fun_t : public unary_function<_Tp*,void> { public: explicit mem_fun_t(void (_Tp::*__pf)()) : _M_f(__pf) {} void operator()(_Tp* __p) const { (__p->*_M_f)(); } private: void (_Tp::*_M_f)(); }; template class const_mem_fun_t : public unary_function { public: explicit const_mem_fun_t(void (_Tp::*__pf)() const) : _M_f(__pf) {} void operator()(const _Tp* __p) const { (__p->*_M_f)(); } private: void (_Tp::*_M_f)() const; }; template class mem_fun_ref_t : public unary_function<_Tp,void> { public: explicit mem_fun_ref_t(void (_Tp::*__pf)()) : _M_f(__pf) {} void operator()(_Tp& __r) const { (__r.*_M_f)(); } private: void (_Tp::*_M_f)(); }; template class const_mem_fun_ref_t : public unary_function<_Tp,void> { public: explicit const_mem_fun_ref_t(void (_Tp::*__pf)() const) : _M_f(__pf) {} void operator()(const _Tp& __r) const { (__r.*_M_f)(); } private: void (_Tp::*_M_f)() const; }; template class mem_fun1_t : public binary_function<_Tp*,_Arg,void> { public: explicit mem_fun1_t(void (_Tp::*__pf)(_Arg)) : _M_f(__pf) {} void operator()(_Tp* __p, _Arg __x) const { (__p->*_M_f)(__x); } private: void (_Tp::*_M_f)(_Arg); }; template class const_mem_fun1_t : public binary_function { public: explicit const_mem_fun1_t(void (_Tp::*__pf)(_Arg) const) : _M_f(__pf) {} void operator()(const _Tp* __p, _Arg __x) const { (__p->*_M_f)(__x); } private: void (_Tp::*_M_f)(_Arg) const; }; template class mem_fun1_ref_t : public binary_function<_Tp,_Arg,void> { public: explicit mem_fun1_ref_t(void (_Tp::*__pf)(_Arg)) : _M_f(__pf) {} void operator()(_Tp& __r, _Arg __x) const { (__r.*_M_f)(__x); } private: void (_Tp::*_M_f)(_Arg); }; template class const_mem_fun1_ref_t : public binary_function<_Tp,_Arg,void> { public: explicit const_mem_fun1_ref_t(void (_Tp::*__pf)(_Arg) const) : _M_f(__pf) {} void operator()(const _Tp& __r, _Arg __x) const { (__r.*_M_f)(__x); } private: void (_Tp::*_M_f)(_Arg) const; }; template inline mem_fun_t<_Ret,_Tp> mem_fun(_Ret (_Tp::*__f)()) { return mem_fun_t<_Ret,_Tp>(__f); } template inline const_mem_fun_t<_Ret,_Tp> mem_fun(_Ret (_Tp::*__f)() const) { return const_mem_fun_t<_Ret,_Tp>(__f); } template inline mem_fun_ref_t<_Ret,_Tp> mem_fun_ref(_Ret (_Tp::*__f)()) { return mem_fun_ref_t<_Ret,_Tp>(__f); } template inline const_mem_fun_ref_t<_Ret,_Tp> mem_fun_ref(_Ret (_Tp::*__f)() const) { return const_mem_fun_ref_t<_Ret,_Tp>(__f); } template inline mem_fun1_t<_Ret,_Tp,_Arg> mem_fun(_Ret (_Tp::*__f)(_Arg)) { return mem_fun1_t<_Ret,_Tp,_Arg>(__f); } template inline const_mem_fun1_t<_Ret,_Tp,_Arg> mem_fun(_Ret (_Tp::*__f)(_Arg) const) { return const_mem_fun1_t<_Ret,_Tp,_Arg>(__f); } template inline mem_fun1_ref_t<_Ret,_Tp,_Arg> mem_fun_ref(_Ret (_Tp::*__f)(_Arg)) { return mem_fun1_ref_t<_Ret,_Tp,_Arg>(__f); } template inline const_mem_fun1_ref_t<_Ret,_Tp,_Arg> mem_fun_ref(_Ret (_Tp::*__f)(_Arg) const) { return const_mem_fun1_ref_t<_Ret,_Tp,_Arg>(__f); } template inline mem_fun1_t<_Ret,_Tp,_Arg> mem_fun1(_Ret (_Tp::*__f)(_Arg)) { return mem_fun1_t<_Ret,_Tp,_Arg>(__f); } template inline const_mem_fun1_t<_Ret,_Tp,_Arg> mem_fun1(_Ret (_Tp::*__f)(_Arg) const) { return const_mem_fun1_t<_Ret,_Tp,_Arg>(__f); } template inline mem_fun1_ref_t<_Ret,_Tp,_Arg> mem_fun1_ref(_Ret (_Tp::*__f)(_Arg)) { return mem_fun1_ref_t<_Ret,_Tp,_Arg>(__f); } template inline const_mem_fun1_ref_t<_Ret,_Tp,_Arg> mem_fun1_ref(_Ret (_Tp::*__f)(_Arg) const) { return const_mem_fun1_ref_t<_Ret,_Tp,_Arg>(__f); } # 20 "/usr/include/g++-3/functional" 2 3 # 39 "/usr/include/boost/spirit/utility/impl/chset.ipp" 2 3 # 1 "/usr/include/boost/limits.hpp" 1 3 # 1 "/usr/include/boost/detail/limits.hpp" 1 3 # 1 "/usr/include/g++-3/climits" 1 3 # 1 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/limits.h" 1 3 # 114 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/limits.h" 3 # 6 "/usr/include/g++-3/climits" 2 3 # 42 "/usr/include/boost/detail/limits.hpp" 2 3 # 1 "/usr/include/g++-3/cfloat" 1 3 # 1 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/float.h" 1 3 # 6 "/usr/include/g++-3/cfloat" 2 3 # 43 "/usr/include/boost/detail/limits.hpp" 2 3 namespace std { enum float_round_style { round_indeterminate = -1, round_toward_zero = 0, round_to_nearest = 1, round_toward_infinity = 2, round_toward_neg_infinity = 3 }; enum float_denorm_style { denorm_indeterminate = -1, denorm_absent = 0, denorm_present = 1 }; template class _Numeric_limits_base { public: static const bool is_specialized = false ; static __number min() throw() { return __number(); } static __number max() throw() { return __number(); } static const int digits = 0 ; static const int digits10 = 0 ; static const bool is_signed = false ; static const bool is_integer = false ; static const bool is_exact = false ; static const int radix = 0 ; static __number epsilon() throw() { return __number(); } static __number round_error() throw() { return __number(); } static const int min_exponent = 0 ; static const int min_exponent10 = 0 ; static const int max_exponent = 0 ; static const int max_exponent10 = 0 ; static const bool has_infinity = false ; static const bool has_quiet_NaN = false ; static const bool has_signaling_NaN = false ; static const float_denorm_style has_denorm = denorm_absent ; static const bool has_denorm_loss = false ; static __number infinity() throw() { return __number(); } static __number quiet_NaN() throw() { return __number(); } static __number signaling_NaN() throw() { return __number(); } static __number denorm_min() throw() { return __number(); } static const bool is_iec559 = false ; static const bool is_bounded = false ; static const bool is_modulo = false ; static const bool traps = false ; static const bool tinyness_before = false ; static const float_round_style round_style = round_toward_zero ; }; template class _Integer_limits : public _Numeric_limits_base<_Int> { public: static const bool is_specialized = true ; static _Int min() throw() { return __imin; } static _Int max() throw() { return __imax; } static const int digits = (__idigits < 0) ? (int)(sizeof(_Int) * 8 ) - (__imin == 0 ? 0 : 1) : __idigits ; static const int digits10 = (digits * 301) / 1000 ; static const bool is_signed = __imin != 0 ; static const bool is_integer = true ; static const bool is_exact = true ; static const int radix = 2 ; static const bool is_bounded = true ; static const bool is_modulo = true ; }; # 188 "/usr/include/boost/detail/limits.hpp" 3 template struct float_helper{ static Number get_word() throw() { const unsigned int _S_word[4] = { 0, 0, 0, Word }; return *reinterpret_cast( reinterpret_cast(&_S_word)+16- (sizeof(Number) == 12 ? 10 : sizeof(Number))); } }; template class _Floating_limits : public _Numeric_limits_base<__number> { public: static const bool is_specialized = true ; static const int digits = __Digits ; static const int digits10 = __Digits10 ; static const bool is_signed = true ; static const int radix = 2 ; static const int min_exponent = __MinExp ; static const int max_exponent = __MaxExp ; static const int min_exponent10 = __MinExp10 ; static const int max_exponent10 = __MaxExp10 ; static const bool has_infinity = true ; static const bool has_quiet_NaN = true ; static const bool has_signaling_NaN = true ; static const float_denorm_style has_denorm = denorm_indeterminate ; static const bool has_denorm_loss = false ; static __number infinity() throw() { return float_helper<__number, __InfinityWord>::get_word(); } static __number quiet_NaN() throw() { return float_helper<__number,__QNaNWord>::get_word(); } static __number signaling_NaN() throw() { return float_helper<__number,__SNaNWord>::get_word(); } static const bool is_iec559 = __IsIEC559 ; static const bool is_bounded = true ; static const bool traps = false ; static const bool tinyness_before = false ; static const float_round_style round_style = __RoundStyle ; }; template class numeric_limits : public _Numeric_limits_base {}; template<> class numeric_limits : public _Integer_limits {}; template<> class numeric_limits : public _Integer_limits {}; template<> class numeric_limits : public _Integer_limits {}; template<> class numeric_limits : public _Integer_limits {}; template<> class numeric_limits : public _Integer_limits {}; template<> class numeric_limits : public _Integer_limits {}; template<> class numeric_limits : public _Integer_limits {}; template<> class numeric_limits : public _Integer_limits {}; template<> class numeric_limits : public _Integer_limits {}; template<> class numeric_limits : public _Integer_limits {}; template<> class numeric_limits : public _Integer_limits {}; template<> class numeric_limits : public _Integer_limits {}; template<> class numeric_limits : public _Integer_limits {}; template<> class numeric_limits : public _Floating_limits { public: static float min() throw() { return 1.17549435e-38F ; } static float denorm_min() throw() { return 1.17549435e-38F ; } static float max() throw() { return 3.40282347e+38F ; } static float epsilon() throw() { return 1.19209290e-07F ; } static float round_error() throw() { return 0.5f; } }; template<> class numeric_limits : public _Floating_limits { public: static double min() throw() { return 2.2250738585072014e-308 ; } static double denorm_min() throw() { return 2.2250738585072014e-308 ; } static double max() throw() { return 1.7976931348623157e+308 ; } static double epsilon() throw() { return 2.2204460492503131e-16 ; } static double round_error() throw() { return 0.5; } }; template<> class numeric_limits : public _Floating_limits { public: static long double min() throw() { return 2.2250738585072014e-308L ; } static long double denorm_min() throw() { return 2.2250738585072014e-308L ; } static long double max() throw() { return 1.7976931348623157e+308L ; } static long double epsilon() throw() { return 2.2204460492503131e-16L ; } static long double round_error() throw() { return 4; } }; } # 15 "/usr/include/boost/limits.hpp" 2 3 # 40 "/usr/include/boost/spirit/utility/impl/chset.ipp" 2 3 namespace spirit { namespace impl { struct chset_converter; template struct range { range(CharT first, CharT last); bool is_valid() const; bool includes(CharT v) const; bool includes(range const& r) const; bool is_adjacent(range const& r) const; void merge(range const& r); bool operator<(range const& r) const; bool operator<(CharT v) const; CharT first, last; }; template class range_run { public: typedef typename std::vector >::iterator iterator; typedef typename std::vector >::const_iterator const_iterator; bool test(CharT v) const; void set(range const& r); void clear(range const& r); void clear(); const_iterator begin() const; const_iterator end() const; private: void merge(iterator iter, range const& r); friend class chset_converter; std::vector > run; }; template inline range::range(CharT first_, CharT last_) : first(first_), last(last_) {} template inline bool range::is_valid() const { return first <= last; } template inline bool range::includes(range const& r) const { return (first <= r.first) && (last >= r.last); } template inline bool range::includes(CharT v) const { return (first <= v) && (last >= v); } template inline bool range::is_adjacent(range const& r) const { CharT decr_first = first == std::numeric_limits::min() ? first : first-1; CharT incr_last = last == std::numeric_limits::max() ? last : last+1; return ((decr_first <= r.first) && (incr_last >= r.first)) || ((decr_first <= r.last) && (incr_last >= r.last)); } template inline void range::merge(range const& r) { first = std::min(first, r.first); last = std::max(last, r.last); } template inline bool range::operator < (range const& r) const { return first < r.first; } template inline bool range::operator < (CharT v) const { return first < v; } template struct range_char_compare : public std::binary_function,CharT,bool> { bool operator()(const range& x, const CharT y) const { return x.first < y; } }; template inline bool range_run::test(CharT v) const { if (!run.empty()) { const_iterator iter = std::lower_bound(run.begin(), run.end(), v, range_char_compare()); if (iter != run.end() && iter->includes(v)) return true; if (iter != run.begin()) return (--iter)->includes(v); } return false; } template void range_run::merge(iterator iter, range const& r) { iter->merge(r); iterator i = iter + 1; while (i != run.end() && iter->is_adjacent(*i)) iter->merge(*i++); run.erase(iter+1, i); } template void range_run::set(range const& r) { (( r.is_valid() ) ? (void)0 : __assert("/usr/include/boost/spirit/utility/impl/chset.ipp", 234, "r.is_valid()")) ; if (!run.empty()) { iterator iter = std::lower_bound(run.begin(), run.end(), r); if (iter != run.end() && iter->includes(r) || ((iter != run.begin()) && (iter - 1)->includes(r))) return; if (iter != run.begin() && (iter - 1)->is_adjacent(r)) merge(--iter, r); else if (iter != run.end() && iter->is_adjacent(r)) merge(iter, r); else run.insert(iter, r); } else { run.push_back(r); } } template void range_run::clear(range const& r) { (( r.is_valid() ) ? (void)0 : __assert("/usr/include/boost/spirit/utility/impl/chset.ipp", 262, "r.is_valid()")) ; if (!run.empty()) { iterator iter = std::lower_bound(run.begin(), run.end(), r); iterator left_iter; if ((iter != run.begin()) && (left_iter = (iter - 1))->includes(r.first)) if (left_iter->last > r.last) { CharT save_last = left_iter->last; left_iter->last = r.first-1; run.insert(iter, range(r.last+1, save_last)); return; } else { left_iter->last = r.first-1; } iterator i = iter; while (i != run.end() && r.includes(*i)) i++; if (i != run.end() && i->includes(r.last)) i->first = r.last+1; run.erase(iter, i); } } template void range_run::clear() { run.clear(); } template inline typename range_run::const_iterator range_run::begin() const { return run.begin(); } template inline typename range_run::const_iterator range_run::end() const { return run.end(); } template inline range const& full_range() { static range full(std::numeric_limits::min(), std::numeric_limits::max()); return full; } struct intrusive_ref_count { intrusive_ref_count() : uc(1) {} intrusive_ref_count(intrusive_ref_count const&) : uc(1) {} unsigned uc; template static T* ref(T* ptr); template static void deref(T* ptr); template static void detach(T*& ptr); template static void detach_clear(T*& ptr); }; template inline T* intrusive_ref_count::ref(T* ptr) { ptr->uc++; return ptr; } template inline void intrusive_ref_count::deref(T* ptr) { if (--ptr->uc == 0) delete ptr; } template inline void intrusive_ref_count::detach(T*& ptr) { if (ptr->uc > 1) { T* t = new T(*ptr); --ptr->uc; ptr = t; } } template inline void intrusive_ref_count::detach_clear(T*& ptr) { if (ptr->uc > 1) { T* t = new T; --ptr->uc; ptr = t; } else { ptr->clear(); } } template class base_chset_char_rep { public: base_chset_char_rep() { std::fill_n(char_set, sizeof(char_set), 0); } base_chset_char_rep(base_chset_char_rep const& arg) { std::copy_n(arg.char_set, sizeof(char_set), char_set); } bool test(CharT v) const { return char_set[(unsigned char)v]; } void set(range const& r) { for (int i = r.first; i <= r.last; ++i) { char_set[(unsigned char)i] = 1; } } void set(CharT c) { char_set[(unsigned char)c] = 1; } void clear(range const& r) { for (int i = r.first; i <= r.last; ++i) { char_set[(unsigned char)i] = 0; } } void clear(CharT c) { char_set[(unsigned char)c] = 0; } void clear() { std::fill_n(char_set, sizeof(char_set), 0); } base_chset_char_rep& operator-=(base_chset_char_rep const& x) { for (int i = std::numeric_limits::min(); i <= std::numeric_limits::max(); ++i) { if (x.test(i)) this->clear(i); } return *this; } base_chset_char_rep& operator|=(base_chset_char_rep const& x) { for (int i = std::numeric_limits::min(); i <= std::numeric_limits::max(); ++i) { if (x.test(i)) this->set(i); } return *this; } private: char char_set[255 +1]; }; template class chset_rep : public intrusive_ref_count { public: typedef typename std::vector >::iterator iterator; typedef typename std::vector >::const_iterator const_iterator; chset_rep(); chset_rep(chset_rep const& arg); bool test(CharT v) const; void set(range const& r); void clear(range const& r); void clear(); const_iterator begin() const; const_iterator end() const; chset_rep& operator-=(chset_rep const& x); chset_rep& operator|=(chset_rep const& x); private: range_run rr; }; template inline chset_rep::chset_rep() : intrusive_ref_count() { } template inline chset_rep::chset_rep(chset_rep const& arg) : intrusive_ref_count() , rr(arg.rr) { } template inline bool chset_rep::test(CharT v) const { return rr.test(v); } template inline void chset_rep::set(range const& r) { rr.set(r); } template inline void chset_rep::clear(range const& r) { rr.clear(r); } template inline void chset_rep::clear() { rr.clear(); } template inline typename chset_rep::const_iterator chset_rep::begin() const { return rr.begin(); } template inline typename chset_rep::const_iterator chset_rep::end() const { return rr.end(); } template inline chset_rep& chset_rep::operator-=(chset_rep const& x) { for (const_iterator iter = x.begin(); iter != x.end(); ++iter) this->clear(*iter); return *this; } template inline chset_rep& chset_rep::operator|=(chset_rep const& x) { for (const_iterator iter = x.begin(); iter != x.end(); ++iter) this->set(*iter); return *this; } template <> class chset_rep : public intrusive_ref_count, public base_chset_char_rep { public: typedef intrusive_ref_count base1_t; typedef base_chset_char_rep base2_t; chset_rep() : base1_t() , base2_t() {} chset_rep(chset_rep const& arg) : base1_t(arg) , base2_t(arg) {} }; template <> class chset_rep : public intrusive_ref_count, public base_chset_char_rep { public: typedef intrusive_ref_count base1_t; typedef base_chset_char_rep base2_t; chset_rep() : base1_t() , base2_t() {} chset_rep(chset_rep const& arg) : base1_t(arg) , base2_t(arg) {} }; template <> class chset_rep: public intrusive_ref_count, public base_chset_char_rep { public: typedef intrusive_ref_count base1_t; typedef base_chset_char_rep base2_t; chset_rep() : base1_t() , base2_t() {} chset_rep(chset_rep const& arg) : base1_t(arg) , base2_t(arg) {} }; } template inline chset::chset() : ptr(new impl::chset_rep) { } template inline chset::chset(chset const& arg) : char_parser >() , ptr(impl::chset_rep::ref(arg.ptr)) { } template inline chset::chset(CharT arg) : ptr(new impl::chset_rep) { ptr->set(impl::range(arg, arg)); } template inline chset::chset(anychar_) : ptr(new impl::chset_rep) { ptr->set(impl::full_range()); } template inline chset::chset(nothing_) : ptr(new impl::chset_rep) { } template inline chset::chset(chlit const& arg) : ptr(new impl::chset_rep) { ptr->set(impl::range(arg.ch, arg.ch)); } template inline chset::chset(range const& arg) : ptr(new impl::chset_rep) { ptr->set(impl::range(arg.first, arg.last)); } template template chset::chset(CharTB const* definition) : ptr(new impl::chset_rep) { CharTB ch = *definition++; while (ch) { CharTB next = *definition++; if (next == '-') { next = *definition++; if (next == 0) { ptr->set(impl::range(ch, ch)); ptr->set(impl::range('-', '-')); break; } ptr->set(impl::range(ch, next)); } else { ptr->set(impl::range(ch, ch)); } ch = next; } } template inline chset::~chset() { impl::chset_rep::deref(ptr); } template inline chset& chset::operator=(chset const& rhs) { if (this != &rhs) { impl::chset_rep* tp = impl::chset_rep::ref(rhs.ptr); impl::chset_rep::deref(ptr); ptr = tp; } return *this; } template inline chset& chset::operator=(CharT rhs) { impl::chset_rep::detach_clear(ptr); ptr->set(impl::range(rhs, rhs)); return *this; } template inline chset& chset::operator=(anychar_ ) { impl::chset_rep::detach_clear(ptr); ptr->set(impl::full_range()); return *this; } template inline chset& chset::operator=(nothing_ ) { impl::chset_rep::detach_clear(ptr); return *this; } template inline chset& chset::operator=(chlit const& rhs) { impl::chset_rep::detach_clear(ptr); ptr->set(impl::range(rhs.ch, rhs.ch)); return *this; } template inline chset& chset::operator=(range const& rhs) { impl::chset_rep::detach_clear(ptr); ptr->set(impl::range(rhs.first, rhs.last)); return *this; } template inline void chset::set(range const& arg) { impl::chset_rep::detach(ptr); ptr->set(impl::range(arg.first, arg.last)); } template inline void chset::add(CharT ch) { ptr->set(impl::range(ch, ch)); } template inline void chset::clear(range const& arg) { impl::chset_rep::detach(ptr); ptr->clear(impl::range(arg.first, arg.last)); } template inline bool chset::test(CharT ch) const { return ptr->test(ch); } namespace impl { struct chset_converter { template static void convert(chset& dest, chset const& src) { typedef typename std::vector > vector_a; typedef typename std::vector > const vector_b; typedef typename impl::chset_rep rep_a; typedef typename impl::chset_rep rep_b; typedef typename impl::range range; rep_b const* sp = src.ptr; vector_a& ss = dest.ptr->rr.run; for (typename vector_b::const_iterator iter = sp->begin(); iter != sp->end(); ++iter) ss.push_back(range(iter->first, iter->last)); } template static void convert_from_char_chset(chset& dest, chset const& src) { typedef typename impl::chset_rep rep_a; typedef typename impl::chset_rep rep_b; typedef typename impl::range range; rep_b const* sp = src.ptr; rep_a * ss = dest.ptr; for (int i = std::numeric_limits::min(); i <= std::numeric_limits::max(); ++i) { if (sp->test(i)) ss->set(i); } } template static void convert(chset& dest, chset const& src) { convert_from_char_chset(dest, src); } template static void convert_to_char_chset(chset& dest, chset const& src) { typedef typename impl::chset_rep rep_a; typedef typename impl::chset_rep rep_b; typedef typename impl::range range; rep_b const* sp = src.ptr; rep_a * ss = dest.ptr; for (typename rep_b::const_iterator iter = sp->begin(); iter != sp->end(); ++iter) ss->set(range(iter->first, iter->last)); } template static void convert(chset& dest, chset const& src) { convert_to_char_chset(dest, src); } template static void convert(chset& dest, chset const& src) { convert_from_char_chset(dest, src); } template static void convert(chset& dest, chset const& src) { convert_to_char_chset(dest, src); } template static void convert(chset& dest, chset const& src) { convert_from_char_chset(dest, src); } template static void convert(chset& dest, chset const& src) { convert_to_char_chset(dest, src); } }; } template template inline chset::chset(chset const& arg) : ptr(new impl::chset_rep) { impl::chset_converter::convert(*this, arg); } template template inline chset& chset::operator=(chset const& rhs) { impl::chset_rep::detach_clear(ptr); impl::chset_converter::convert(*this, rhs); return *this; } template inline chset operator|(chset const& a, chset const& b) { typedef typename impl::chset_rep rep; chset a_(a); rep*& ap = a_.ptr; rep const* bp = b.ptr; rep::detach(ap); (*ap)|= *bp; return a_; } template inline chset operator-(chset const& a, chset const& b) { typedef typename impl::chset_rep rep; chset a_(a); rep*& ap = a_.ptr; rep const* bp = b.ptr; rep::detach(ap); (*ap)-= *bp; return a_; } template inline chset operator~(chset const& a) { return chset(anychar_p) - a; } template inline chset operator&(chset const& a, chset const& b) { return a - ~b; } template inline chset operator^(chset const& a, chset const& b) { return a - b | b - a; } namespace impl { template inline CharT decr(CharT v) { return v == std::numeric_limits::min() ? v : v-1; } template inline CharT incr(CharT v) { return v == std::numeric_limits::max() ? v : v+1; } } template inline chset operator~(range const& a) { chset a_; a_.set(range(std::numeric_limits::min(), impl::decr(a.first))); a_.set(range(impl::incr(a.last), std::numeric_limits::max())); return a_; } template inline chset operator|(chset const& a, range const& b) { chset a_(a); a_.set(b); return a_; } template inline chset operator&(chset const& a, range const& b) { chset a_(a); a_.clear(range(std::numeric_limits::min(), impl::decr(b.first))); a_.clear(range(impl::incr(b.last), std::numeric_limits::max())); return a_; } template inline chset operator-(chset const& a, range const& b) { chset a_(a); a_.clear(b); return a_; } template inline chset operator^(chset const& a, range const& b) { return a ^ chset(b); } template inline chset operator|(range const& a, chset const& b) { chset b_(b); b_.set(a); return b_; } template inline chset operator&(range const& a, chset const& b) { chset b_(b); b_.clear(range(std::numeric_limits::min(), impl::decr(a.first))); b_.clear(range(impl::incr(a.last), std::numeric_limits::max())); return b_; } template inline chset operator-(range const& a, chset const& b) { return chset(a) - b; } template inline chset operator^(range const& a, chset const& b) { return chset(a) ^ b; } template inline chset operator|(chset const& a, CharT b) { return a | range(b, b); } template inline chset operator&(chset const& a, CharT b) { return a & range(b, b); } template inline chset operator-(chset const& a, CharT b) { return a - range(b, b); } template inline chset operator^(chset const& a, CharT b) { return a ^ range(b, b); } template inline chset operator|(CharT a, chset const& b) { return range(a, a) | b; } template inline chset operator&(CharT a, chset const& b) { return range(a, a) & b; } template inline chset operator-(CharT a, chset const& b) { return range(a, a) - b; } template inline chset operator^(CharT a, chset const& b) { return range(a, a) ^ b; } template inline chset operator~(chlit const& a) { return ~range(a.ch, a.ch); } template inline chset operator|(chset const& a, chlit const& b) { return a | b.ch; } template inline chset operator&(chset const& a, chlit const& b) { return a & b.ch; } template inline chset operator-(chset const& a, chlit const& b) { return a - b.ch; } template inline chset operator^(chset const& a, chlit const& b) { return a ^ b.ch; } template inline chset operator|(chlit const& a, chset const& b) { return a.ch | b; } template inline chset operator&(chlit const& a, chset const& b) { return a.ch & b; } template inline chset operator-(chlit const& a, chset const& b) { return a.ch - b; } template inline chset operator^(chlit const& a, chset const& b) { return a.ch ^ b; } namespace impl { template inline spirit::range const& full() { static spirit::range full_(std::numeric_limits::min(), std::numeric_limits::max()); return full_; } template inline spirit::range const& empty() { static spirit::range empty_; return empty_; } } inline nothing_ operator~(anychar_) { return nothing_p; } template inline chset operator|(chset const&, anychar_) { return chset(impl::full()); } template inline chset operator&(chset const& a, anychar_) { return a; } template inline chset operator-(chset const&, anychar_) { return chset(); } template inline chset operator^(chset const& a, anychar_) { return ~a; } template inline chset operator|(anychar_, chset const& ) { return chset(impl::full()); } template inline chset operator&(anychar_, chset const& b) { return b; } template inline chset operator-(anychar_, chset const& b) { return ~b; } template inline chset operator^(anychar_, chset const& b) { return ~b; } template inline chset operator|(chset const& a, nothing_) { return a; } template inline chset operator&(chset const& , nothing_) { return impl::empty(); } template inline chset operator-(chset const& a, nothing_) { return a; } template inline chset operator^(chset const& a, nothing_) { return a; } template inline chset operator|(nothing_, chset const& b) { return b; } template inline chset operator&(nothing_, chset const& ) { return impl::empty(); } template inline chset operator-(nothing_, chset const& ) { return impl::empty(); } template inline chset operator^(nothing_, chset const& b) { return b; } template inline chset chset_p(ParamT param) { return chset(param); } } # 489 "/usr/include/boost/spirit/utility/chset.hpp" 2 3 # 56 "/usr/include/boost/spirit/spirit_utility.hpp" 2 3 # 1 "/usr/include/boost/spirit/utility/static_parsers.hpp" 1 3 namespace spirit { namespace impl { template struct static_chlit : public chlit { static_chlit() : chlit(C) {} }; template struct static_chset : public chset { static_chset() : chset(C1) { if (0 != C2) add(C2); if (0 != C3) add(C3); if (0 != C4) add(C4); if (0 != C5) add(C5); if (0 != C6) add(C6); if (0 != C7) add(C7); if (0 != C8) add(C8); if (0 != C9) add(C9); if (0 != C10) add(C10); } }; template struct static_strlit : public strlit > { static_strlit() : strlit >(Lit) {} }; template struct static_operator_base { bool operator!=(int) { return isempty; } }; } template struct s_chlit : public impl::static_chlit, public impl::static_operator_base<> { }; template struct s_wchlit : public impl::static_chlit, public impl::static_operator_base<> { }; template struct s_chset : public impl::static_chset, public impl::static_operator_base<> { }; template struct s_wchset : public impl::static_chset, public impl::static_operator_base<> { }; template struct s_strlit : public impl::static_strlit, public impl::static_operator_base<> { }; template struct s_wstrlit : public impl::static_strlit, public impl::static_operator_base<> { }; struct s_anychar : public anychar_, public impl::static_operator_base<> { }; struct s_nothing : public nothing_, public impl::static_operator_base { }; struct s_epsilon : public epsilon_, public impl::static_operator_base { }; struct s_blank : public blank_, public impl::static_operator_base<> { }; struct s_alnum : public alnum_, public impl::static_operator_base<> { }; struct s_alpha : public alpha_, public impl::static_operator_base<> { }; struct s_cntrl : public cntrl_, public impl::static_operator_base<> { }; struct s_digit : public digit_, public impl::static_operator_base<> { }; struct s_graph : public graph_, public impl::static_operator_base<> { }; struct s_lower : public lower_, public impl::static_operator_base<> { }; struct s_print : public print_, public impl::static_operator_base<> { }; struct s_punct : public punct_, public impl::static_operator_base<> { }; struct s_space : public space_, public impl::static_operator_base<> { }; struct s_upper : public upper_, public impl::static_operator_base<> { }; struct s_xdigit : public xdigit_, public impl::static_operator_base<> { }; } # 57 "/usr/include/boost/spirit/spirit_utility.hpp" 2 3 # 1 "/usr/include/boost/spirit/utility/utilities.hpp" 1 3 namespace spirit { template struct escape_char_action : public base_action > { typedef CharT return_t; escape_char_action( ParserT const& subject, ActionT const& actor_); template attr_match do_parse(IteratorT& first, IteratorT const& last) const; }; struct escape_flags { static const unsigned long c_escapes = 1; static const unsigned long lex_escapes = c_escapes << 1; }; template class escape_char_parser : public parser > { public: template escape_char_action, ActionT, Flags, CharT> operator[](ActionT const& actor) const { return escape_char_action, ActionT, Flags, CharT>( *this, actor); } template typename ParsePolicyT::match_t do_parse(IteratorT& first, IteratorT const& last) const; }; const escape_char_parser lex_escape_ch_p = escape_char_parser(); const escape_char_parser c_escape_ch_p = escape_char_parser(); struct nested {}; struct non_nested {}; namespace impl { template struct parser_type { typedef T parser_t; static parser_t const& get(parser_t const& p) { return p; } }; template<> struct parser_type { typedef chlit parser_t; static parser_t get(char ch) { return parser_t(ch); } }; template<> struct parser_type { typedef chlit parser_t; static parser_t get(wchar_t ch) { return parser_t(ch); } }; template<> struct parser_type { typedef strlit > parser_t; static parser_t get(char const* str) { return parser_t(str); } }; template<> struct parser_type { typedef strlit > parser_t; static parser_t get(wchar_t const* str) { return parser_t(str); } }; template struct parser_type { typedef strlit > parser_t; static parser_t get(char const str[N]) { return parser_t(str); } }; template struct parser_type { typedef strlit > parser_t; static parser_t get(wchar_t const str[N]) { return parser_t(str); } }; template struct parser_type { typedef strlit > parser_t; static parser_t get(char const str[N]) { return parser_t(str); } }; template struct parser_type { typedef strlit > parser_t; static parser_t get(wchar_t const str[N]) { return parser_t(str); } }; } template < typename OpenT, typename ExprT, typename CloseT, typename NestedT = non_nested, typename CategoryT = typename impl::parser_type::parser_t::parser_category > struct confix_parser : public parser > { confix_parser(OpenT const &open_, ExprT const &expr_, CloseT const &close_); template typename ParsePolicyT::match_t do_parse(IteratorT& first, IteratorT const& last) const; private: typename embed_trait::type open; typename embed_trait::type expr; typename embed_trait::type close; }; template struct confix_parser_gen { template confix_parser< typename impl::parser_type::parser_t, typename impl::parser_type::parser_t, typename impl::parser_type::parser_t, NestedT, typename impl::parser_type::parser_t::parser_category > operator()( StartT const &start_, ExprT const &expr_, EndT const &end_) const; template confix_parser< typename impl::parser_type::parser_t, typename impl::parser_type::parser_t, typename impl::parser_type::parser_t, NestedT, plain_parser_category > direct( StartT const &start, ExprT const &expr, EndT const &end) const; }; const confix_parser_gen confix_p = confix_parser_gen(); const confix_parser_gen confix_nest_p = confix_parser_gen(); template struct comment_parser_gen { template confix_parser< typename impl::parser_type::parser_t, anychar_, typename impl::parser_type::parser_t, NestedT > operator() (StartT const &start_, EndT const &end_) const; }; const comment_parser_gen comment_p = comment_parser_gen(); const comment_parser_gen comment_nest_p = comment_parser_gen(); template struct list_action : public unary, public parser > { typedef action_parser_category parser_category; list_action(ParserT const& subject, ActionT const& actor_); template typename ParsePolicyT::match_t do_parse(IteratorT& first, IteratorT const& last) const; ActionT const &predicate() const { return actor; } private: typename embed_trait::type actor; }; template struct list_action_iterator { typedef std::input_iterator_tag iterator_category; typedef BaseT value_type; typedef ptrdiff_t difference_type; typedef BaseT * pointer; typedef BaseT & reference; list_action_iterator(); list_action_iterator( ParserT const *parser, IteratorT &first, IteratorT const &last); BaseT const &operator* () const; list_action_iterator &operator++ (); list_action_iterator operator++ (int); bool operator== ( list_action_iterator const &rhs) const; bool operator!= ( list_action_iterator const &rhs) const; IteratorT const &actposition() const; bool matched() const; void operator() ( typename std::iterator_traits::value_type const &match ) const; void operator() ( IteratorT const &begin_match, IteratorT const &end_match) const; ParserT const &subject() const; private: match read(bool firstread = false); ParserT const *parser; mutable BaseT value; IteratorT current; IteratorT const last; bool end_marker; bool saw_oneitem; }; template struct embed_trait > { typedef list_action_iterator const& type; }; template < typename ItemT, typename DelimT, typename StringT = std::string, typename CategoryT = typename impl::parser_type::parser_t::parser_category > struct list_parser : public parser > { typedef StringT string_t; typedef CategoryT parser_category; list_parser(ItemT const &item_, DelimT const &delim_); template typename ParsePolicyT::match_t do_parse(IteratorT& first, IteratorT const& last) const; template list_action, ActionT> operator[](ActionT const& actor) const { return list_action(*this, actor); } ItemT const &item_p() const { return item; } DelimT const &delim_p() const { return delim; } epsilon_ const &end_p() const { return epsilon_p; } private: typename embed_trait::type item; typename embed_trait::type delim; }; template < typename ItemT, typename DelimT, typename EndT, typename StringT = std::string, typename CategoryT = typename impl::parser_type::parser_t::parser_category > struct list_parser_ex : public parser > { typedef StringT string_t; typedef CategoryT parser_category; list_parser_ex( ItemT const &item_, DelimT const &delim_, EndT const &end_); template typename ParsePolicyT::match_t do_parse(IteratorT& first, IteratorT const& last) const; template list_action, ActionT> operator[](ActionT const& actor) const { return list_action(*this, actor); } ItemT const &item_p() const { return item; } DelimT const &delim_p() const { return delim; } EndT const &end_p() const { return end; } private: typename embed_trait::type item; typename embed_trait::type delim; typename embed_trait::type end; }; template struct list_parser_gen : public list_parser, StringT> { typedef typename StringT::value_type CharT; list_parser_gen() : list_parser, StringT>(anychar_p, chlit(',')) { } template list_action, StringT>, ActionT> operator[](ActionT const& actor) const { typedef list_action, StringT>, ActionT> return_t; return return_t(*this, actor); } template list_parser< anychar_, typename impl::parser_type::parser_t, StringT, plain_parser_category > operator()(DelimT const &delim_) const; template list_parser< typename impl::parser_type::parser_t, typename impl::parser_type::parser_t, StringT > operator()(ItemT const &item_, DelimT const &delim_) const; template list_parser_ex< typename impl::parser_type::parser_t, typename impl::parser_type::parser_t, typename impl::parser_type::parser_t, StringT > operator()( ItemT const &item_, DelimT const &delim_, EndT const &end_) const; template list_parser< typename impl::parser_type::parser_t, typename impl::parser_type::parser_t, StringT, plain_parser_category > direct(ItemT const &item_, DelimT const &delim_) const; template list_parser_ex< typename impl::parser_type::parser_t, typename impl::parser_type::parser_t, typename impl::parser_type::parser_t, StringT, plain_parser_category > direct( ItemT const &item_, DelimT const &delim_, EndT const &end_) const; }; const list_parser_gen<> list_p = list_parser_gen<>(); } # 1 "/usr/include/boost/spirit/utility/impl/utilities.ipp" 1 3 namespace spirit { template inline escape_char_action::escape_char_action( ParserT const& subject, ActionT const& actor_) : base_action > (subject, actor_) { } template template inline attr_match< typename escape_char_action::return_t, typename ParsePolicyT::match_t > escape_char_action:: do_parse(IteratorT& first, IteratorT const& last) const { typedef CharT char_t; typedef attr_match attr_match_t; if (first != last) { IteratorT s = first; if (typename ParsePolicyT::match_t hit = this->subject().template do_parse(s, last)) { char_t unescaped; if (*first == '\\') { ++first; switch (*first) { case 'b': unescaped = '\b'; ++first; break; case 't': unescaped = '\t'; ++first; break; case 'n': unescaped = '\n'; ++first; break; case 'f': unescaped = '\f'; ++first; break; case 'r': unescaped = '\r'; ++first; break; case '"': unescaped = '"'; ++first; break; case '\'': unescaped = '\''; ++first; break; case '\\': unescaped = '\\'; ++first; break; case 'x': case 'X': { char_t hex = 0; ++first; char_t const lim = std::numeric_limits::max() >> 4; while (first != last) { char_t c = *first; if (hex > lim && isxdigit(c)) { return attr_match_t(ParsePolicyT::no_match()); } if (isdigit(c)) { hex <<= 4; hex |= c - '0'; ++first; } else if (isxdigit(c)) { hex <<= 4; c = toupper(c); hex |= c - 'A' + 0xA; ++first; } else { break; } } unescaped = hex; } break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': { char_t hex = 0; char_t const lim = std::numeric_limits::max() >> 3; while (first != last) { char_t c = *first; if (hex > lim && (c >= '0' && c <= '7')) { return attr_match_t(ParsePolicyT::no_match()); } if (c >= '0' && c <= '7') { hex <<= 3; hex |= c - '0'; ++first; } else { break; } } unescaped = hex; } break; default: if (Flags & escape_flags::c_escapes) { return attr_match_t(ParsePolicyT::no_match()); } else { unescaped = *first; ++first; } break; } } else { unescaped = *first; ++first; } this->actor(unescaped); return attr_match_t(hit, unescaped); } } return attr_match_t(ParsePolicyT::no_match()); } template template inline typename ParsePolicyT::match_t escape_char_parser::do_parse(IteratorT& first, IteratorT const& last) const { static range<> octal('0','7'); static rule escape = +octal | nocase_d['x'] >> +xdigit_p | (anychar_p - nocase_d['x'] - octal); return ((anychar_p - '\\') | ('\\' >> escape)).template do_parse(first, last); } namespace impl { template struct confix_parser_type; template <> struct confix_parser_type { template < typename IteratorT, typename ParsePolicyT, typename ThisT, typename OpenT, typename ExprT, typename CloseT > static typename ParsePolicyT::match_t do_parse( IteratorT& first, IteratorT const& last, ThisT const& this_, OpenT const& open, ExprT const& expr, CloseT const& close) { return (open >> *(this_ | expr - close) >> close).template do_parse( first, last); } }; template <> struct confix_parser_type { template < typename IteratorT, typename ParsePolicyT, typename ThisT, typename OpenT, typename ExprT, typename CloseT > static typename ParsePolicyT::match_t do_parse( IteratorT& first, IteratorT const& last, ThisT const& , OpenT const& open, ExprT const& expr, CloseT const& close) { return (open >> *(expr - close) >> close).template do_parse( first, last); } }; template <> struct confix_parser_type { template < typename IteratorT, typename ParsePolicyT, typename ThisT, typename OpenT, typename ExprT, typename CloseT > static typename ParsePolicyT::match_t do_parse( IteratorT& first, IteratorT const& last, ThisT const& this_, OpenT const& open, ExprT const& expr, CloseT const& close) { return ( open >> (*(this_ | expr.subject() - close))[expr.predicate()] >> close ).template do_parse(first, last); } }; template <> struct confix_parser_type { template < typename IteratorT, typename ParsePolicyT, typename ThisT, typename OpenT, typename ExprT, typename CloseT > static typename ParsePolicyT::match_t do_parse( IteratorT& first, IteratorT const& last, ThisT const& , OpenT const& open, ExprT const& expr, CloseT const& close) { return ( open >> (*(expr.subject() - close))[expr.predicate()] >> close ).template do_parse(first, last); } }; } template < typename OpenT, typename ExprT, typename CloseT, typename NestedT, typename CategoryT > inline confix_parser::confix_parser( OpenT const &open_, ExprT const &expr_, CloseT const &close_) : open(open_), expr(expr_), close(close_) { } template < typename OpenT, typename ExprT, typename CloseT, typename NestedT, typename CategoryT > template inline typename ParsePolicyT::match_t confix_parser ::do_parse(IteratorT& first, IteratorT const& last) const { return impl::confix_parser_type:: template do_parse(first, last, *this, open, expr, close); } template template inline confix_parser< typename impl::parser_type::parser_t, typename impl::parser_type::parser_t, typename impl::parser_type::parser_t, NestedT, typename impl::parser_type::parser_t::parser_category > confix_parser_gen::operator()( StartT const &start_, ExprT const &expr_, EndT const &end_) const { typedef typename impl::parser_type::parser_t start_t; typedef typename impl::parser_type::parser_t expr_t; typedef typename impl::parser_type::parser_t end_t; typedef typename impl::parser_type::parser_t::parser_category parser_category; typedef confix_parser return_t; return return_t( impl::parser_type::get(start_), impl::parser_type::get(expr_), impl::parser_type::get(end_) ); } template template inline confix_parser< typename impl::parser_type::parser_t, typename impl::parser_type::parser_t, typename impl::parser_type::parser_t, NestedT, plain_parser_category > confix_parser_gen::direct( StartT const &start_, ExprT const &expr_, EndT const &end_) const { typedef typename impl::parser_type::parser_t start_t; typedef typename impl::parser_type::parser_t expr_t; typedef typename impl::parser_type::parser_t end_t; typedef plain_parser_category parser_category; typedef confix_parser return_t; return return_t( impl::parser_type::get(start_), impl::parser_type::get(expr_), impl::parser_type::get(end_) ); } template template inline confix_parser< typename impl::parser_type::parser_t, anychar_, typename impl::parser_type::parser_t, NestedT > comment_parser_gen::operator()( StartT const &start_, EndT const &end_) const { typedef typename impl::parser_type::parser_t start_t; typedef typename impl::parser_type::parser_t end_t; typedef confix_parser return_t; return return_t( impl::parser_type::get(start_), anychar_p, impl::parser_type::get(end_) ); } template inline list_action::list_action( ParserT const& subject, ActionT const& actor_) : unary(subject), actor(actor_) { } template template inline typename ParsePolicyT::match_t list_action::do_parse( IteratorT& first, IteratorT const& last) const { typedef impl::strip_scanner strip_scanner; typedef list_action_iterator iterator_t; typename strip_scanner::iterator_type begin = strip_scanner::get(first); IteratorT savedfirst(first); iterator_t list_it (&this->subject(), first, last); actor(list_it, iterator_t()); if (list_it.matched()) { first = list_it.actposition(); return ParsePolicyT::create_match( std::distance(begin, strip_scanner::get(first)), savedfirst, first); } return ParsePolicyT::no_match(); } template inline list_action_iterator::list_action_iterator() : parser(0), current(0), last(0), end_marker(true), saw_oneitem(false) { } template inline list_action_iterator::list_action_iterator( ParserT const *parser_, IteratorT &first_, IteratorT const &last_) : parser(parser_), current(first_), last(last_), end_marker(true), saw_oneitem(false) { end_marker = !read(true); } template inline BaseT const & list_action_iterator::operator* () const { return value; } template inline list_action_iterator & list_action_iterator::operator++() { read(); return *this; } template inline list_action_iterator list_action_iterator::operator++ (int) { list_action_iterator tmp = *this; read(); return tmp; } template inline bool list_action_iterator::operator== ( list_action_iterator const &rhs) const { return (current == rhs.current && last == rhs.last && end_marker == rhs.end_marker) || (end_marker && rhs.end_marker); } template inline bool list_action_iterator::operator!= ( list_action_iterator const &rhs) const { return !(*this == rhs); } template inline IteratorT const & list_action_iterator::actposition() const { return current; } template inline bool list_action_iterator::matched() const { return saw_oneitem; } template inline void list_action_iterator::operator() ( IteratorT const &begin_match, IteratorT const &end_match) const { value = BaseT(begin_match, end_match-begin_match); } template inline void list_action_iterator::operator() ( typename std::iterator_traits::value_type const &match_) const { value += match_; } template inline ParserT const & list_action_iterator::subject() const { (( 0 != parser ) ? (void)0 : __assert("/usr/include/boost/spirit/utility/impl/utilities.ipp", 599, "0 != parser")) ; return *parser; } namespace impl { template struct list_action_parser_type; template <> struct list_action_parser_type { template static match read_item ( ActionIterT const &list_action_it, ParserT const &subject, IteratorT ¤t, IteratorT const &last) { return ( *(subject.item_p() - (subject.delim_p() | subject.end_p())) )[list_action_it].template do_parse(current, last); } }; template <> struct list_action_parser_type { template static match read_item ( ActionIterT const &list_action_it, ParserT const &subject, IteratorT ¤t, IteratorT const &last) { return ( (*(subject.item_p().subject() - (subject.delim_p() | subject.end_p()) ) )[subject.item_p().predicate()] )[list_action_it].template do_parse(current, last); } }; } template inline match list_action_iterator::read (bool firstread) { match hit; if (!firstread) { hit = subject().delim_p().template do_parse(current, last); if (!hit) { end_marker = true; return subject().end_p().template do_parse(current, last); } } value.empty(); hit = impl::list_action_parser_type ::read_item (*this, subject(), current, last); if (!saw_oneitem) saw_oneitem = hit; end_marker = !hit; return hit; } namespace impl { template struct list_parser_type; template <> struct list_parser_type { template static typename ParsePolicyT::match_t do_parse(IteratorT& first, IteratorT const& last, ItemT const &item, DelimT const &delim) { return ( (item - delim) >> *(delim >> (item - delim)) ).template do_parse(first, last); } template < typename IteratorT, typename ParsePolicyT, typename ItemT, typename DelimT, typename EndT > static typename ParsePolicyT::match_t do_parse(IteratorT& first, IteratorT const& last, ItemT const &item, DelimT const &delim, EndT const &end) { return ( (item - (delim | end)) >> *(delim >> (item - (delim | end))) >> !end ).template do_parse(first, last); } }; template <> struct list_parser_type { template static typename ParsePolicyT::match_t do_parse(IteratorT& first, IteratorT const& last, ItemT const &item, DelimT const &delim) { return ( (item.subject() - delim)[item.predicate()] >> *(delim >> (item.subject() - delim)[item.predicate()]) ).template do_parse(first, last); } template < typename IteratorT, typename ParsePolicyT, typename ItemT, typename DelimT, typename EndT > static typename ParsePolicyT::match_t do_parse(IteratorT& first, IteratorT const& last, ItemT const &item, DelimT const &delim, EndT const &end) { return ( (item.subject() - (delim | end))[item.predicate()] >> *(delim >> (item.subject() - (delim | end)) [item.predicate()] ) >> !end ).template do_parse(first, last); } }; } template < typename ItemT, typename DelimT, typename StringT, typename CategoryT > inline list_parser ::list_parser(ItemT const &item_, DelimT const &delim_) : item(item_), delim(delim_) { } template < typename ItemT, typename DelimT, typename StringT, typename CategoryT > template inline typename ParsePolicyT::match_t list_parser ::do_parse(IteratorT& first, IteratorT const& last) const { return impl::list_parser_type ::template do_parse(first, last, item, delim); } template < typename ItemT, typename DelimT, typename EndT, typename StringT, typename CategoryT > inline list_parser_ex ::list_parser_ex(ItemT const &item_, DelimT const &delim_, EndT const &end_) : item(item_), delim(delim_), end(end_) { } template < typename ItemT, typename DelimT, typename EndT, typename StringT, typename CategoryT > template inline typename ParsePolicyT::match_t list_parser_ex ::do_parse(IteratorT& first, IteratorT const& last) const { return impl::list_parser_type ::template do_parse(first, last, item, delim, end); } template template inline list_parser< anychar_, typename impl::parser_type::parser_t, StringT, plain_parser_category > list_parser_gen::operator()(DelimT const &delim_) const { typedef typename impl::parser_type::parser_t delim_t; typedef list_parser return_t; return return_t( anychar_p, impl::parser_type::get(delim_) ); } template template inline list_parser< typename impl::parser_type::parser_t, typename impl::parser_type::parser_t, StringT > list_parser_gen::operator()(ItemT const &item_, DelimT const &delim_) const { typedef typename impl::parser_type::parser_t item_t; typedef typename impl::parser_type::parser_t delim_t; typedef list_parser return_t; return return_t( impl::parser_type::get(item_), impl::parser_type::get(delim_) ); } template template inline list_parser_ex< typename impl::parser_type::parser_t, typename impl::parser_type::parser_t, typename impl::parser_type::parser_t, StringT > list_parser_gen::operator()( ItemT const &item_, DelimT const &delim_, EndT const &end_) const { typedef typename impl::parser_type::parser_t item_t; typedef typename impl::parser_type::parser_t delim_t; typedef typename impl::parser_type::parser_t end_t; typedef list_parser_ex return_t; return return_t( impl::parser_type::get(item_), impl::parser_type::get(delim_), impl::parser_type::get(end_) ); } template template inline list_parser< typename impl::parser_type::parser_t, typename impl::parser_type::parser_t, StringT, plain_parser_category > list_parser_gen::direct(ItemT const &item_, DelimT const &delim_) const { typedef typename impl::parser_type::parser_t item_t; typedef typename impl::parser_type::parser_t delim_t; typedef list_parser return_t; return return_t( impl::parser_type::get(item_), impl::parser_type::get(delim_) ); } template template inline list_parser_ex< typename impl::parser_type::parser_t, typename impl::parser_type::parser_t, typename impl::parser_type::parser_t, StringT, plain_parser_category > list_parser_gen::direct( ItemT const &item_, DelimT const &delim_, EndT const &end_) const { typedef typename impl::parser_type::parser_t item_t; typedef typename impl::parser_type::parser_t delim_t; typedef typename impl::parser_type::parser_t end_t; typedef list_parser_ex return_t; return return_t( impl::parser_type::get(item_), impl::parser_type::get(delim_), impl::parser_type::get(end_) ); } } # 722 "/usr/include/boost/spirit/utility/utilities.hpp" 2 3 # 58 "/usr/include/boost/spirit/spirit_utility.hpp" 2 3 # 57 "/usr/include/boost/spirit/spirit.hpp" 2 3 # 1 "/usr/include/boost/spirit/spirit_tree.hpp" 1 3 # 1 "/usr/include/boost/spirit/tree/parse_tree.hpp" 1 3 # 1 "/usr/include/boost/spirit/spirit_tree_fwd.hpp" 1 3 namespace spirit { template class parse_tree_val_node_factory; template > class parse_tree_match_policy; template > class ast_match_policy; template > class parse_tree_match; } # 35 "/usr/include/boost/spirit/tree/parse_tree.hpp" 2 3 # 1 "/usr/include/g++-3/stack" 1 3 # 1 "/usr/include/g++-3/stl_deque.h" 1 3 inline size_t __deque_buf_size(size_t __n, size_t __size) { return __n != 0 ? __n : (__size < 512 ? size_t(512 / __size) : size_t(1)); } template struct _Deque_iterator { typedef _Deque_iterator<_Tp,_Tp&,_Tp*,__bufsiz> iterator; typedef _Deque_iterator<_Tp,const _Tp&,const _Tp*,__bufsiz> const_iterator; static size_t _S_buffer_size() { return __deque_buf_size(__bufsiz, sizeof(_Tp)); } typedef random_access_iterator_tag iterator_category; typedef _Tp value_type; typedef _Ptr pointer; typedef _Ref reference; typedef size_t size_type; typedef ptrdiff_t difference_type; typedef _Tp** _Map_pointer; typedef _Deque_iterator _Self; _Tp* _M_cur; _Tp* _M_first; _Tp* _M_last; _Map_pointer _M_node; _Deque_iterator(_Tp* __x, _Map_pointer __y) : _M_cur(__x), _M_first(*__y), _M_last(*__y + _S_buffer_size()), _M_node(__y) {} _Deque_iterator() : _M_cur(0), _M_first(0), _M_last(0), _M_node(0) {} _Deque_iterator(const iterator& __x) : _M_cur(__x._M_cur), _M_first(__x._M_first), _M_last(__x._M_last), _M_node(__x._M_node) {} reference operator*() const { return *_M_cur; } pointer operator->() const { return _M_cur; } difference_type operator-(const _Self& __x) const { return difference_type(_S_buffer_size()) * (_M_node - __x._M_node - 1) + (_M_cur - _M_first) + (__x._M_last - __x._M_cur); } _Self& operator++() { ++_M_cur; if (_M_cur == _M_last) { _M_set_node(_M_node + 1); _M_cur = _M_first; } return *this; } _Self operator++(int) { _Self __tmp = *this; ++*this; return __tmp; } _Self& operator--() { if (_M_cur == _M_first) { _M_set_node(_M_node - 1); _M_cur = _M_last; } --_M_cur; return *this; } _Self operator--(int) { _Self __tmp = *this; --*this; return __tmp; } _Self& operator+=(difference_type __n) { difference_type __offset = __n + (_M_cur - _M_first); if (__offset >= 0 && __offset < difference_type(_S_buffer_size())) _M_cur += __n; else { difference_type __node_offset = __offset > 0 ? __offset / difference_type(_S_buffer_size()) : -difference_type((-__offset - 1) / _S_buffer_size()) - 1; _M_set_node(_M_node + __node_offset); _M_cur = _M_first + (__offset - __node_offset * difference_type(_S_buffer_size())); } return *this; } _Self operator+(difference_type __n) const { _Self __tmp = *this; return __tmp += __n; } _Self& operator-=(difference_type __n) { return *this += -__n; } _Self operator-(difference_type __n) const { _Self __tmp = *this; return __tmp -= __n; } reference operator[](difference_type __n) const { return *(*this + __n); } bool operator==(const _Self& __x) const { return _M_cur == __x._M_cur; } bool operator!=(const _Self& __x) const { return !(*this == __x); } bool operator<(const _Self& __x) const { return (_M_node == __x._M_node) ? (_M_cur < __x._M_cur) : (_M_node < __x._M_node); } void _M_set_node(_Map_pointer __new_node) { _M_node = __new_node; _M_first = *__new_node; _M_last = _M_first + difference_type(_S_buffer_size()); } }; # 262 "/usr/include/g++-3/stl_deque.h" 3 template class _Deque_alloc_base { public: typedef typename _Alloc_traits<_Tp,_Alloc>::allocator_type allocator_type; allocator_type get_allocator() const { return node_allocator; } _Deque_alloc_base(const allocator_type& __a) : node_allocator(__a), map_allocator(__a), _M_map(0), _M_map_size(0) {} protected: typedef typename _Alloc_traits<_Tp*, _Alloc>::allocator_type map_allocator_type; allocator_type node_allocator; map_allocator_type map_allocator; _Tp* _M_allocate_node() { return node_allocator.allocate(__deque_buf_size(__bufsiz,sizeof(_Tp))); } void _M_deallocate_node(_Tp* __p) { node_allocator.deallocate(__p, __deque_buf_size(__bufsiz,sizeof(_Tp))); } _Tp** _M_allocate_map(size_t __n) { return map_allocator.allocate(__n); } void _M_deallocate_map(_Tp** __p, size_t __n) { map_allocator.deallocate(__p, __n); } _Tp** _M_map; size_t _M_map_size; }; template class _Deque_alloc_base<_Tp, _Alloc, __bufsiz, true> { public: typedef typename _Alloc_traits<_Tp,_Alloc>::allocator_type allocator_type; allocator_type get_allocator() const { return allocator_type(); } _Deque_alloc_base(const allocator_type&) : _M_map(0), _M_map_size(0) {} protected: typedef typename _Alloc_traits<_Tp, _Alloc>::_Alloc_type _Node_alloc_type; typedef typename _Alloc_traits<_Tp*, _Alloc>::_Alloc_type _Map_alloc_type; _Tp* _M_allocate_node() { return _Node_alloc_type::allocate(__deque_buf_size(__bufsiz, sizeof(_Tp))); } void _M_deallocate_node(_Tp* __p) { _Node_alloc_type::deallocate(__p, __deque_buf_size(__bufsiz, sizeof(_Tp))); } _Tp** _M_allocate_map(size_t __n) { return _Map_alloc_type::allocate(__n); } void _M_deallocate_map(_Tp** __p, size_t __n) { _Map_alloc_type::deallocate(__p, __n); } _Tp** _M_map; size_t _M_map_size; }; template class _Deque_base : public _Deque_alloc_base<_Tp,_Alloc,__bufsiz, _Alloc_traits<_Tp, _Alloc>::_S_instanceless> { public: typedef _Deque_alloc_base<_Tp,_Alloc,__bufsiz, _Alloc_traits<_Tp, _Alloc>::_S_instanceless> _Base; typedef typename _Base::allocator_type allocator_type; typedef _Deque_iterator<_Tp,_Tp&,_Tp*,__bufsiz> iterator; typedef _Deque_iterator<_Tp,const _Tp&,const _Tp*, __bufsiz> const_iterator; _Deque_base(const allocator_type& __a, size_t __num_elements) : _Base(__a), _M_start(), _M_finish() { _M_initialize_map(__num_elements); } _Deque_base(const allocator_type& __a) : _Base(__a), _M_start(), _M_finish() {} ~_Deque_base(); protected: void _M_initialize_map(size_t); void _M_create_nodes(_Tp** __nstart, _Tp** __nfinish); void _M_destroy_nodes(_Tp** __nstart, _Tp** __nfinish); enum { _S_initial_map_size = 8 }; protected: iterator _M_start; iterator _M_finish; }; # 416 "/usr/include/g++-3/stl_deque.h" 3 template _Deque_base<_Tp,_Alloc,__bufsiz>::~_Deque_base() { if (_M_map) { _M_destroy_nodes(_M_start._M_node, _M_finish._M_node + 1); _M_deallocate_map(_M_map, _M_map_size); } } template void _Deque_base<_Tp,_Alloc,__bufsiz>::_M_initialize_map(size_t __num_elements) { size_t __num_nodes = __num_elements / __deque_buf_size(__bufsiz, sizeof(_Tp)) + 1; _M_map_size = max((size_t) _S_initial_map_size, __num_nodes + 2); _M_map = _M_allocate_map(_M_map_size); _Tp** __nstart = _M_map + (_M_map_size - __num_nodes) / 2; _Tp** __nfinish = __nstart + __num_nodes; try { _M_create_nodes(__nstart, __nfinish); } catch(...) { (_M_deallocate_map(_M_map, _M_map_size), _M_map = 0, _M_map_size = 0) ; throw; } ; _M_start._M_set_node(__nstart); _M_finish._M_set_node(__nfinish - 1); _M_start._M_cur = _M_start._M_first; _M_finish._M_cur = _M_finish._M_first + __num_elements % __deque_buf_size(__bufsiz, sizeof(_Tp)); } template void _Deque_base<_Tp,_Alloc,__bufsiz>::_M_create_nodes(_Tp** __nstart, _Tp** __nfinish) { _Tp** __cur; try { for (__cur = __nstart; __cur < __nfinish; ++__cur) *__cur = _M_allocate_node(); } catch(...) { _M_destroy_nodes(__nstart, __cur) ; throw; } ; } template void _Deque_base<_Tp,_Alloc,__bufsiz>::_M_destroy_nodes(_Tp** __nstart, _Tp** __nfinish) { for (_Tp** __n = __nstart; __n < __nfinish; ++__n) _M_deallocate_node(*__n); } template , size_t __bufsiz = 0> class deque : protected _Deque_base<_Tp, _Alloc, __bufsiz> { typedef _Deque_base<_Tp, _Alloc, __bufsiz> _Base; public: typedef _Tp value_type; typedef value_type* pointer; typedef const value_type* const_pointer; typedef value_type& reference; typedef const value_type& const_reference; typedef size_t size_type; typedef ptrdiff_t difference_type; typedef typename _Base::allocator_type allocator_type; allocator_type get_allocator() const { return _Base::get_allocator(); } public: typedef typename _Base::iterator iterator; typedef typename _Base::const_iterator const_iterator; typedef reverse_iterator const_reverse_iterator; typedef reverse_iterator reverse_iterator; protected: typedef pointer* _Map_pointer; static size_t _S_buffer_size() { return __deque_buf_size(__bufsiz, sizeof(_Tp)); } protected: # 528 "/usr/include/g++-3/stl_deque.h" 3 public: iterator begin() { return _M_start; } iterator end() { return _M_finish; } const_iterator begin() const { return _M_start; } const_iterator end() const { return _M_finish; } reverse_iterator rbegin() { return reverse_iterator(_M_finish); } reverse_iterator rend() { return reverse_iterator(_M_start); } const_reverse_iterator rbegin() const { return const_reverse_iterator(_M_finish); } const_reverse_iterator rend() const { return const_reverse_iterator(_M_start); } reference operator[](size_type __n) { return _M_start[difference_type(__n)]; } const_reference operator[](size_type __n) const { return _M_start[difference_type(__n)]; } reference front() { return *_M_start; } reference back() { iterator __tmp = _M_finish; --__tmp; return *__tmp; } const_reference front() const { return *_M_start; } const_reference back() const { const_iterator __tmp = _M_finish; --__tmp; return *__tmp; } size_type size() const { return _M_finish - _M_start;; } size_type max_size() const { return size_type(-1); } bool empty() const { return _M_finish == _M_start; } public: explicit deque(const allocator_type& __a = allocator_type()) : _Base(__a, 0) {} deque(const deque& __x) : _Base(__x.get_allocator(), __x.size()) { uninitialized_copy(__x.begin(), __x.end(), _M_start); } deque(size_type __n, const value_type& __value, const allocator_type& __a = allocator_type()) : _Base(__a, __n) { _M_fill_initialize(__value); } explicit deque(size_type __n) : _Base(allocator_type(), __n) { _M_fill_initialize(value_type()); } template deque(_InputIterator __first, _InputIterator __last, const allocator_type& __a = allocator_type()) : _Base(__a) { typedef typename _Is_integer<_InputIterator>::_Integral _Integral; _M_initialize_dispatch(__first, __last, _Integral()); } template void _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type) { _M_initialize_map(__n); _M_fill_initialize(__x); } template void _M_initialize_dispatch(_InputIter __first, _InputIter __last, __false_type) { _M_range_initialize(__first, __last, __iterator_category( __first ) ); } # 609 "/usr/include/g++-3/stl_deque.h" 3 ~deque() { destroy(_M_start, _M_finish); } deque& operator= (const deque& __x) { const size_type __len = size(); if (&__x != this) { if (__len >= __x.size()) erase(copy(__x.begin(), __x.end(), _M_start), _M_finish); else { const_iterator __mid = __x.begin() + difference_type(__len); copy(__x.begin(), __mid, _M_start); insert(_M_finish, __mid, __x.end()); } } return *this; } void swap(deque& __x) { ::swap(_M_start, __x._M_start); ::swap(_M_finish, __x._M_finish); ::swap(_M_map, __x._M_map); ::swap(_M_map_size, __x._M_map_size); } public: void assign(size_type __n, const _Tp& __val) { if (__n > size()) { fill(begin(), end(), __val); insert(end(), __n - size(), __val); } else { erase(begin() + __n, end()); fill(begin(), end(), __val); } } template void assign(_InputIterator __first, _InputIterator __last) { typedef typename _Is_integer<_InputIterator>::_Integral _Integral; _M_assign_dispatch(__first, __last, _Integral()); } private: template void _M_assign_dispatch(_Integer __n, _Integer __val, __true_type) { assign((size_type) __n, (_Tp) __val); } template void _M_assign_dispatch(_InputIterator __first, _InputIterator __last, __false_type) { _M_assign_aux(__first, __last, __iterator_category( __first ) ); } template void _M_assign_aux(_InputIterator __first, _InputIterator __last, input_iterator_tag); template void _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last, forward_iterator_tag) { size_type __len = 0; distance(__first, __last, __len); if (__len > size()) { _ForwardIterator __mid = __first; advance(__mid, size()); copy(__first, __mid, begin()); insert(end(), __mid, __last); } else erase(copy(__first, __last, begin()), end()); } public: void push_back(const value_type& __t) { if (_M_finish._M_cur != _M_finish._M_last - 1) { construct(_M_finish._M_cur, __t); ++_M_finish._M_cur; } else _M_push_back_aux(__t); } void push_back() { if (_M_finish._M_cur != _M_finish._M_last - 1) { construct(_M_finish._M_cur); ++_M_finish._M_cur; } else _M_push_back_aux(); } void push_front(const value_type& __t) { if (_M_start._M_cur != _M_start._M_first) { construct(_M_start._M_cur - 1, __t); --_M_start._M_cur; } else _M_push_front_aux(__t); } void push_front() { if (_M_start._M_cur != _M_start._M_first) { construct(_M_start._M_cur - 1); --_M_start._M_cur; } else _M_push_front_aux(); } void pop_back() { if (_M_finish._M_cur != _M_finish._M_first) { --_M_finish._M_cur; destroy(_M_finish._M_cur); } else _M_pop_back_aux(); } void pop_front() { if (_M_start._M_cur != _M_start._M_last - 1) { destroy(_M_start._M_cur); ++_M_start._M_cur; } else _M_pop_front_aux(); } public: iterator insert(iterator position, const value_type& __x) { if (position._M_cur == _M_start._M_cur) { push_front(__x); return _M_start; } else if (position._M_cur == _M_finish._M_cur) { push_back(__x); iterator __tmp = _M_finish; --__tmp; return __tmp; } else { return _M_insert_aux(position, __x); } } iterator insert(iterator __position) { return insert(__position, value_type()); } void insert(iterator __pos, size_type __n, const value_type& __x); template void insert(iterator __pos, _InputIterator __first, _InputIterator __last) { typedef typename _Is_integer<_InputIterator>::_Integral _Integral; _M_insert_dispatch(__pos, __first, __last, _Integral()); } template void _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __x, __true_type) { insert(__pos, (size_type) __n, (value_type) __x); } template void _M_insert_dispatch(iterator __pos, _InputIterator __first, _InputIterator __last, __false_type) { insert(__pos, __first, __last, __iterator_category( __first ) ); } void resize(size_type __new_size, const value_type& __x) { const size_type __len = size(); if (__new_size < __len) erase(_M_start + __new_size, _M_finish); else insert(_M_finish, __new_size - __len, __x); } void resize(size_type new_size) { resize(new_size, value_type()); } public: iterator erase(iterator __pos) { iterator __next = __pos; ++__next; difference_type __index = __pos - _M_start; if (static_cast(__index) < (size() >> 1)) { copy_backward(_M_start, __pos, __next); pop_front(); } else { copy(__next, _M_finish, __pos); pop_back(); } return _M_start + __index; } iterator erase(iterator __first, iterator __last); void clear(); protected: void _M_fill_initialize(const value_type& __value); template void _M_range_initialize(_InputIterator __first, _InputIterator __last, input_iterator_tag); template void _M_range_initialize(_ForwardIterator __first, _ForwardIterator __last, forward_iterator_tag); protected: void _M_push_back_aux(const value_type&); void _M_push_back_aux(); void _M_push_front_aux(const value_type&); void _M_push_front_aux(); void _M_pop_back_aux(); void _M_pop_front_aux(); protected: template void insert(iterator __pos, _InputIterator __first, _InputIterator __last, input_iterator_tag); template void insert(iterator __pos, _ForwardIterator __first, _ForwardIterator __last, forward_iterator_tag); iterator _M_insert_aux(iterator __pos, const value_type& __x); iterator _M_insert_aux(iterator __pos); void _M_insert_aux(iterator __pos, size_type __n, const value_type& __x); template void _M_insert_aux(iterator __pos, _ForwardIterator __first, _ForwardIterator __last, size_type __n); # 893 "/usr/include/g++-3/stl_deque.h" 3 iterator _M_reserve_elements_at_front(size_type __n) { size_type __vacancies = _M_start._M_cur - _M_start._M_first; if (__n > __vacancies) _M_new_elements_at_front(__n - __vacancies); return _M_start - difference_type(__n); } iterator _M_reserve_elements_at_back(size_type __n) { size_type __vacancies = (_M_finish._M_last - _M_finish._M_cur) - 1; if (__n > __vacancies) _M_new_elements_at_back(__n - __vacancies); return _M_finish + difference_type(__n); } void _M_new_elements_at_front(size_type __new_elements); void _M_new_elements_at_back(size_type __new_elements); protected: void _M_reserve_map_at_back (size_type __nodes_to_add = 1) { if (__nodes_to_add + 1 > _M_map_size - (_M_finish._M_node - _M_map)) _M_reallocate_map(__nodes_to_add, false); } void _M_reserve_map_at_front (size_type __nodes_to_add = 1) { if (__nodes_to_add > size_type(_M_start._M_node - _M_map)) _M_reallocate_map(__nodes_to_add, true); } void _M_reallocate_map(size_type __nodes_to_add, bool __add_at_front); # 941 "/usr/include/g++-3/stl_deque.h" 3 }; template template void deque<_Tp, _Alloc, __bufsize> ::_M_assign_aux(_InputIter __first, _InputIter __last, input_iterator_tag) { iterator __cur = begin(); for ( ; __first != __last && __cur != end(); ++__cur, ++__first) *__cur = *__first; if (__first == __last) erase(__cur, end()); else insert(end(), __first, __last); } template void deque<_Tp, _Alloc, __bufsize>::insert(iterator __pos, size_type __n, const value_type& __x) { if (__pos._M_cur == _M_start._M_cur) { iterator __new_start = _M_reserve_elements_at_front(__n); uninitialized_fill(__new_start, _M_start, __x); _M_start = __new_start; } else if (__pos._M_cur == _M_finish._M_cur) { iterator __new_finish = _M_reserve_elements_at_back(__n); uninitialized_fill(_M_finish, __new_finish, __x); _M_finish = __new_finish; } else _M_insert_aux(__pos, __n, __x); } # 1038 "/usr/include/g++-3/stl_deque.h" 3 template deque<_Tp,_Alloc,__bufsize>::iterator deque<_Tp,_Alloc,__bufsize>::erase(iterator __first, iterator __last) { if (__first == _M_start && __last == _M_finish) { clear(); return _M_finish; } else { difference_type __n = __last - __first; difference_type __elems_before = __first - _M_start; if (static_cast(__elems_before) < (size() - __n) / 2) { copy_backward(_M_start, __first, __last); iterator __new_start = _M_start + __n; destroy(_M_start, __new_start); _M_destroy_nodes(__new_start._M_node, _M_start._M_node); _M_start = __new_start; } else { copy(__last, _M_finish, __first); iterator __new_finish = _M_finish - __n; destroy(__new_finish, _M_finish); _M_destroy_nodes(__new_finish._M_node + 1, _M_finish._M_node + 1); _M_finish = __new_finish; } return _M_start + __elems_before; } } template void deque<_Tp,_Alloc,__bufsize>::clear() { for (_Map_pointer __node = _M_start._M_node + 1; __node < _M_finish._M_node; ++__node) { destroy(*__node, *__node + _S_buffer_size()); _M_deallocate_node(*__node); } if (_M_start._M_node != _M_finish._M_node) { destroy(_M_start._M_cur, _M_start._M_last); destroy(_M_finish._M_first, _M_finish._M_cur); _M_deallocate_node(_M_finish._M_first); } else destroy(_M_start._M_cur, _M_finish._M_cur); _M_finish = _M_start; } template void deque<_Tp,_Alloc,__bufsize>::_M_fill_initialize(const value_type& __value) { _Map_pointer __cur; try { for (__cur = _M_start._M_node; __cur < _M_finish._M_node; ++__cur) uninitialized_fill(*__cur, *__cur + _S_buffer_size(), __value); uninitialized_fill(_M_finish._M_first, _M_finish._M_cur, __value); } catch(...) { destroy(_M_start, iterator(*__cur, __cur)) ; throw; } ; } template template void deque<_Tp,_Alloc,__bufsize>::_M_range_initialize(_InputIterator __first, _InputIterator __last, input_iterator_tag) { _M_initialize_map(0); for ( ; __first != __last; ++__first) push_back(*__first); } template template void deque<_Tp,_Alloc,__bufsize>::_M_range_initialize(_ForwardIterator __first, _ForwardIterator __last, forward_iterator_tag) { size_type __n = 0; distance(__first, __last, __n); _M_initialize_map(__n); _Map_pointer __cur_node; try { for (__cur_node = _M_start._M_node; __cur_node < _M_finish._M_node; ++__cur_node) { _ForwardIterator __mid = __first; advance(__mid, _S_buffer_size()); uninitialized_copy(__first, __mid, *__cur_node); __first = __mid; } uninitialized_copy(__first, __last, _M_finish._M_first); } catch(...) { destroy(_M_start, iterator(*__cur_node, __cur_node)) ; throw; } ; } template void deque<_Tp,_Alloc,__bufsize>::_M_push_back_aux(const value_type& __t) { value_type __t_copy = __t; _M_reserve_map_at_back(); *(_M_finish._M_node + 1) = _M_allocate_node(); try { construct(_M_finish._M_cur, __t_copy); _M_finish._M_set_node(_M_finish._M_node + 1); _M_finish._M_cur = _M_finish._M_first; } catch(...) { _M_deallocate_node(*(_M_finish._M_node + 1)) ; throw; } ; } template void deque<_Tp,_Alloc,__bufsize>::_M_push_back_aux() { _M_reserve_map_at_back(); *(_M_finish._M_node + 1) = _M_allocate_node(); try { construct(_M_finish._M_cur); _M_finish._M_set_node(_M_finish._M_node + 1); _M_finish._M_cur = _M_finish._M_first; } catch(...) { _M_deallocate_node(*(_M_finish._M_node + 1)) ; throw; } ; } template void deque<_Tp,_Alloc,__bufsize>::_M_push_front_aux(const value_type& __t) { value_type __t_copy = __t; _M_reserve_map_at_front(); *(_M_start._M_node - 1) = _M_allocate_node(); try { _M_start._M_set_node(_M_start._M_node - 1); _M_start._M_cur = _M_start._M_last - 1; construct(_M_start._M_cur, __t_copy); } catch(...) { (++_M_start, _M_deallocate_node(*(_M_start._M_node - 1))) ; throw; } ; } template void deque<_Tp,_Alloc,__bufsize>::_M_push_front_aux() { _M_reserve_map_at_front(); *(_M_start._M_node - 1) = _M_allocate_node(); try { _M_start._M_set_node(_M_start._M_node - 1); _M_start._M_cur = _M_start._M_last - 1; construct(_M_start._M_cur); } catch(...) { (++_M_start, _M_deallocate_node(*(_M_start._M_node - 1))) ; throw; } ; } template void deque<_Tp,_Alloc,__bufsize>::_M_pop_back_aux() { _M_deallocate_node(_M_finish._M_first); _M_finish._M_set_node(_M_finish._M_node - 1); _M_finish._M_cur = _M_finish._M_last - 1; destroy(_M_finish._M_cur); } template void deque<_Tp,_Alloc,__bufsize>::_M_pop_front_aux() { destroy(_M_start._M_cur); _M_deallocate_node(_M_start._M_first); _M_start._M_set_node(_M_start._M_node + 1); _M_start._M_cur = _M_start._M_first; } template template void deque<_Tp,_Alloc,__bufsize>::insert(iterator __pos, _InputIterator __first, _InputIterator __last, input_iterator_tag) { copy(__first, __last, inserter(*this, __pos)); } template template void deque<_Tp,_Alloc,__bufsize>::insert(iterator __pos, _ForwardIterator __first, _ForwardIterator __last, forward_iterator_tag) { size_type __n = 0; distance(__first, __last, __n); if (__pos._M_cur == _M_start._M_cur) { iterator __new_start = _M_reserve_elements_at_front(__n); try { uninitialized_copy(__first, __last, __new_start); _M_start = __new_start; } catch(...) { _M_destroy_nodes(__new_start._M_node, _M_start._M_node) ; throw; } ; } else if (__pos._M_cur == _M_finish._M_cur) { iterator __new_finish = _M_reserve_elements_at_back(__n); try { uninitialized_copy(__first, __last, _M_finish); _M_finish = __new_finish; } catch(...) { _M_destroy_nodes(_M_finish._M_node + 1, __new_finish._M_node + 1) ; throw; } ; } else _M_insert_aux(__pos, __first, __last, __n); } template typename deque<_Tp, _Alloc, __bufsize>::iterator deque<_Tp,_Alloc,__bufsize>::_M_insert_aux(iterator __pos, const value_type& __x) { difference_type __index = __pos - _M_start; value_type __x_copy = __x; if (static_cast(__index) < size() / 2) { push_front(front()); iterator __front1 = _M_start; ++__front1; iterator __front2 = __front1; ++__front2; __pos = _M_start + __index; iterator __pos1 = __pos; ++__pos1; copy(__front2, __pos1, __front1); } else { push_back(back()); iterator __back1 = _M_finish; --__back1; iterator __back2 = __back1; --__back2; __pos = _M_start + __index; copy_backward(__pos, __back2, __back1); } *__pos = __x_copy; return __pos; } template typename deque<_Tp,_Alloc,__bufsize>::iterator deque<_Tp,_Alloc,__bufsize>::_M_insert_aux(iterator __pos) { difference_type __index = __pos - _M_start; if (static_cast(__index) < size() / 2) { push_front(front()); iterator __front1 = _M_start; ++__front1; iterator __front2 = __front1; ++__front2; __pos = _M_start + __index; iterator __pos1 = __pos; ++__pos1; copy(__front2, __pos1, __front1); } else { push_back(back()); iterator __back1 = _M_finish; --__back1; iterator __back2 = __back1; --__back2; __pos = _M_start + __index; copy_backward(__pos, __back2, __back1); } *__pos = value_type(); return __pos; } template void deque<_Tp,_Alloc,__bufsize>::_M_insert_aux(iterator __pos, size_type __n, const value_type& __x) { const difference_type __elems_before = __pos - _M_start; size_type __length = size(); value_type __x_copy = __x; if (static_cast(__elems_before) < __length / 2) { iterator __new_start = _M_reserve_elements_at_front(__n); iterator __old_start = _M_start; __pos = _M_start + __elems_before; try { if (__elems_before >= difference_type(__n)) { iterator __start_n = _M_start + difference_type(__n); uninitialized_copy(_M_start, __start_n, __new_start); _M_start = __new_start; copy(__start_n, __pos, __old_start); fill(__pos - difference_type(__n), __pos, __x_copy); } else { __uninitialized_copy_fill(_M_start, __pos, __new_start, _M_start, __x_copy); _M_start = __new_start; fill(__old_start, __pos, __x_copy); } } catch(...) { _M_destroy_nodes(__new_start._M_node, _M_start._M_node) ; throw; } ; } else { iterator __new_finish = _M_reserve_elements_at_back(__n); iterator __old_finish = _M_finish; const difference_type __elems_after = difference_type(__length) - __elems_before; __pos = _M_finish - __elems_after; try { if (__elems_after > difference_type(__n)) { iterator __finish_n = _M_finish - difference_type(__n); uninitialized_copy(__finish_n, _M_finish, _M_finish); _M_finish = __new_finish; copy_backward(__pos, __finish_n, __old_finish); fill(__pos, __pos + difference_type(__n), __x_copy); } else { __uninitialized_fill_copy(_M_finish, __pos + difference_type(__n), __x_copy, __pos, _M_finish); _M_finish = __new_finish; fill(__pos, __old_finish, __x_copy); } } catch(...) { _M_destroy_nodes(_M_finish._M_node + 1, __new_finish._M_node + 1) ; throw; } ; } } template template void deque<_Tp,_Alloc,__bufsize>::_M_insert_aux(iterator __pos, _ForwardIterator __first, _ForwardIterator __last, size_type __n) { const difference_type __elemsbefore = __pos - _M_start; size_type __length = size(); if (static_cast(__elemsbefore) < __length / 2) { iterator __new_start = _M_reserve_elements_at_front(__n); iterator __old_start = _M_start; __pos = _M_start + __elemsbefore; try { if (__elemsbefore >= difference_type(__n)) { iterator __start_n = _M_start + difference_type(__n); uninitialized_copy(_M_start, __start_n, __new_start); _M_start = __new_start; copy(__start_n, __pos, __old_start); copy(__first, __last, __pos - difference_type(__n)); } else { _ForwardIterator __mid = __first; advance(__mid, difference_type(__n) - __elemsbefore); __uninitialized_copy_copy(_M_start, __pos, __first, __mid, __new_start); _M_start = __new_start; copy(__mid, __last, __old_start); } } catch(...) { _M_destroy_nodes(__new_start._M_node, _M_start._M_node) ; throw; } ; } else { iterator __new_finish = _M_reserve_elements_at_back(__n); iterator __old_finish = _M_finish; const difference_type __elemsafter = difference_type(__length) - __elemsbefore; __pos = _M_finish - __elemsafter; try { if (__elemsafter > difference_type(__n)) { iterator __finish_n = _M_finish - difference_type(__n); uninitialized_copy(__finish_n, _M_finish, _M_finish); _M_finish = __new_finish; copy_backward(__pos, __finish_n, __old_finish); copy(__first, __last, __pos); } else { _ForwardIterator __mid = __first; advance(__mid, __elemsafter); __uninitialized_copy_copy(__mid, __last, __pos, _M_finish, _M_finish); _M_finish = __new_finish; copy(__first, __mid, __pos); } } catch(...) { _M_destroy_nodes(_M_finish._M_node + 1, __new_finish._M_node + 1) ; throw; } ; } } # 1572 "/usr/include/g++-3/stl_deque.h" 3 template void deque<_Tp,_Alloc,__bufsize>::_M_new_elements_at_front(size_type __new_elems) { size_type __new_nodes = (__new_elems + _S_buffer_size() - 1) / _S_buffer_size(); _M_reserve_map_at_front(__new_nodes); size_type __i; try { for (__i = 1; __i <= __new_nodes; ++__i) *(_M_start._M_node - __i) = _M_allocate_node(); } catch(...) { for (size_type __j = 1; __j < __i; ++__j) _M_deallocate_node(*(_M_start._M_node - __j)); throw; } } template void deque<_Tp,_Alloc,__bufsize>::_M_new_elements_at_back(size_type __new_elems) { size_type __new_nodes = (__new_elems + _S_buffer_size() - 1) / _S_buffer_size(); _M_reserve_map_at_back(__new_nodes); size_type __i; try { for (__i = 1; __i <= __new_nodes; ++__i) *(_M_finish._M_node + __i) = _M_allocate_node(); } catch(...) { for (size_type __j = 1; __j < __i; ++__j) _M_deallocate_node(*(_M_finish._M_node + __j)); throw; } } template void deque<_Tp,_Alloc,__bufsize>::_M_reallocate_map(size_type __nodes_to_add, bool __add_at_front) { size_type __old_num_nodes = _M_finish._M_node - _M_start._M_node + 1; size_type __new_num_nodes = __old_num_nodes + __nodes_to_add; _Map_pointer __new_nstart; if (_M_map_size > 2 * __new_num_nodes) { __new_nstart = _M_map + (_M_map_size - __new_num_nodes) / 2 + (__add_at_front ? __nodes_to_add : 0); if (__new_nstart < _M_start._M_node) copy(_M_start._M_node, _M_finish._M_node + 1, __new_nstart); else copy_backward(_M_start._M_node, _M_finish._M_node + 1, __new_nstart + __old_num_nodes); } else { size_type __new_map_size = _M_map_size + max(_M_map_size, __nodes_to_add) + 2; _Map_pointer __new_map = _M_allocate_map(__new_map_size); __new_nstart = __new_map + (__new_map_size - __new_num_nodes) / 2 + (__add_at_front ? __nodes_to_add : 0); copy(_M_start._M_node, _M_finish._M_node + 1, __new_nstart); _M_deallocate_map(_M_map, _M_map_size); _M_map = __new_map; _M_map_size = __new_map_size; } _M_start._M_set_node(__new_nstart); _M_finish._M_set_node(__new_nstart + __old_num_nodes - 1); } template bool operator==(const deque<_Tp, _Alloc, __bufsiz>& __x, const deque<_Tp, _Alloc, __bufsiz>& __y) { return __x.size() == __y.size() && equal(__x.begin(), __x.end(), __y.begin()); } template bool operator<(const deque<_Tp, _Alloc, __bufsiz>& __x, const deque<_Tp, _Alloc, __bufsiz>& __y) { return lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end()); } template inline void swap(deque<_Tp,_Alloc,__bufsiz>& __x, deque<_Tp,_Alloc,__bufsiz>& __y) { __x.swap(__y); } # 34 "/usr/include/g++-3/stack" 2 3 # 1 "/usr/include/g++-3/stl_stack.h" 1 3 template > class stack { friend bool operator== <> (const stack&, const stack&); friend bool operator< <> (const stack&, const stack&); public: typedef typename _Sequence::value_type value_type; typedef typename _Sequence::size_type size_type; typedef _Sequence container_type; typedef typename _Sequence::reference reference; typedef typename _Sequence::const_reference const_reference; protected: _Sequence _M_c; public: stack() : _M_c() {} explicit stack(const _Sequence& __s) : _M_c(__s) {} bool empty() const { return _M_c.empty(); } size_type size() const { return _M_c.size(); } reference top() { return _M_c.back(); } const_reference top() const { return _M_c.back(); } void push(const value_type& __x) { _M_c.push_back(__x); } void pop() { _M_c.pop_back(); } }; template bool operator==(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y) { return __x._M_c == __y._M_c; } template bool operator<(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y) { return __x._M_c < __y._M_c; } template bool operator!=(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y) { return !(__x == __y); } template bool operator>(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y) { return __y < __x; } template bool operator<=(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y) { return !(__y < __x); } template bool operator>=(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y) { return !(__x < __y); } # 35 "/usr/include/g++-3/stack" 2 3 # 37 "/usr/include/boost/spirit/tree/parse_tree.hpp" 2 3 namespace spirit { template struct tree_node { typedef T parse_node_t; typedef std::vector > children_t; typedef typename children_t::iterator tree_iterator; typedef typename children_t::const_iterator const_tree_iterator; T value; children_t children; tree_node() : value() , children() {} explicit tree_node(T const& v) : value(v) , children() {} tree_node(T const& v, children_t const& c) : value(v) , children(c) {} void swap(tree_node& x) { std::swap(value, x.value); std::swap(children, x.children); } tree_node &operator= (tree_node const &rhs) { tree_node(rhs).swap(*this); return *this; } }; # 110 "/usr/include/boost/spirit/tree/parse_tree.hpp" 3 template struct parse_tree_iter_node { typedef IteratorT iterator_t; typedef IteratorT const const_iterator_t; parse_tree_iter_node() : first(), last(), is_root_(false), rule_id_(), value_() {} parse_tree_iter_node(IteratorT const& _first, IteratorT const& _last) : first(_first), last(_last), is_root_(false), rule_id_(), value_() {} void swap(parse_tree_iter_node& x) { std::swap(first, x.first); std::swap(last, x.last); std::swap(rule_id_, x.rule_id_); std::swap(is_root_, x.is_root_); std::swap(value_, x.value_); } IteratorT begin() { return first; } IteratorT const& begin() const { return first; } IteratorT end() { return last; } IteratorT const& end() const { return last; } bool is_root() const { return is_root_; } void is_root(bool b) { is_root_ = b; } rule_id id() const { return rule_id_; } void id(rule_id r) { rule_id_ = r; } ValueT const& value() const { return value_; } void value(ValueT const& v) { value_ = v; } private: IteratorT first, last; bool is_root_; rule_id rule_id_; ValueT value_; public: }; # 221 "/usr/include/boost/spirit/tree/parse_tree.hpp" 3 template struct parse_tree_val_node { typedef typename std::iterator_traits::value_type value_type; typedef std::vector container_t; typedef typename container_t::iterator iterator_t; typedef typename container_t::const_iterator const_iterator_t; parse_tree_val_node() : text(), is_root_(false), rule_id_(), value_() {} parse_tree_val_node(IteratorT const& _first, IteratorT const& _last) : text(_first, _last), is_root_(false), rule_id_(), value_() {} template parse_tree_val_node(IteratorT2 const& _first, IteratorT2 const& _last) : text(_first, _last), is_root_(false), rule_id_(), value_() {} void swap(parse_tree_val_node& x) { std::swap(text, x.text); std::swap(is_root_, x.is_root_); std::swap(rule_id_, x.rule_id_); std::swap(value_, x.value_); } typename container_t::iterator begin() { return text.begin(); } typename container_t::const_iterator begin() const { return text.begin(); } typename container_t::iterator end() { return text.end(); } typename container_t::const_iterator end() const { return text.end(); } bool is_root() const { return is_root_; } void is_root(bool b) { is_root_ = b; } rule_id id() const { return rule_id_; } void id(rule_id r) { rule_id_ = r; } ValueT const& value() const { return value_; } void value(ValueT const& v) { value_ = v; } private: container_t text; bool is_root_; rule_id rule_id_; ValueT value_; }; # 323 "/usr/include/boost/spirit/tree/parse_tree.hpp" 3 } namespace std { template void swap(::spirit::tree_node& a, ::spirit::tree_node& b) { a.swap(b); } template void swap(::spirit::parse_tree_iter_node& a, ::spirit::parse_tree_iter_node& b) { a.swap(b); } } namespace spirit { template class parse_tree_iter_node_factory; template class parse_tree_iter_node_factory { public: template class factory { public: typedef parse_tree_iter_node node_t; static node_t create_node(IteratorT const& first, IteratorT const& last, bool ) { return node_t(first, last); } template static node_t group_nodes(ContainerT const& nodes) { return node_t(nodes.begin()->value.begin(), nodes.back().value.end()); } }; }; template class parse_tree_val_node_factory { public: template class factory { public: typedef parse_tree_val_node node_t; static node_t create_node(IteratorT const& first, IteratorT const& last, bool is_leaf_node) { if (is_leaf_node) return node_t(first, last); else return node_t(); } template static node_t group_nodes(ContainerT const& nodes) { typename node_t::container_t c; for (typename ContainerT::const_iterator i = nodes.begin(); i != nodes.end(); ++i) { c.insert(c.end(), i->value.begin(), i->value.end()); } return node_t(c.begin(), c.end()); } }; }; template class parse_tree_all_val_node_factory; template class parse_tree_all_val_node_factory { public: template class factory { public: typedef parse_tree_val_node node_t; static node_t create_node(IteratorT const& first, IteratorT const& last, bool ) { return node_t(first, last); } template static node_t group_nodes(ContainerT const& nodes) { typename node_t::container_t c; for (typename ContainerT::const_iterator i = nodes.begin(); i != nodes.end(); ++i) { c.insert(c.end(), i->value.begin(), i->value.end()); } return node_t(c.begin(), c.end()); } }; }; template struct parse_tree_match { typedef typename NodeFactoryT::template factory node_factory_t; typedef typename node_factory_t::node_t parse_node_t; typedef tree_node node_t; typedef typename node_t::children_t container_t; typedef typename container_t::iterator tree_iterator; typedef typename container_t::const_iterator const_tree_iterator; parse_tree_match(); parse_tree_match(unsigned length, parse_node_t const& n) : data(length) , trees() { trees.push_back(node_t(n)); } parse_tree_match(parse_tree_match const& x) : data(x.data) , trees() { std::swap(trees, x.trees); } explicit parse_tree_match(match const& x) : data(x.length()) , trees() {} parse_tree_match& operator=(parse_tree_match const& x) { parse_tree_match tmp(x); this->swap(tmp); return *this; } void swap(parse_tree_match& x) { std::swap(data, x.data); std::swap(trees, x.trees); } operator bool() const; int length() const; int data; mutable container_t trees; }; template struct common_tree_match_policy { typedef parse_tree_match match_t; static const match_t no_match(); static const match_t empty_match(); template static match_t create_match(int length, Iterator1T const& first, Iterator2T const& last); static void concat(match_t& l, match_t const& r); }; template struct parse_tree_match_policy : public common_tree_match_policy, IteratorT, NodeFactoryT> { }; template struct ast_match_policy : public common_tree_match_policy, IteratorT, NodeFactoryT> { }; template struct common_tree_tree_policy { typedef typename common_tree_match_policy, IteratorT, NodeFactoryT>::match_t match_t; typedef typename NodeFactoryT::template factory factory_t; typedef typename factory_t::node_t node_t; template static node_t create_node(int length, Iterator1T const& first, Iterator2T const& last, bool leaf_node); template static void apply_op_to_match(FunctorT const& op, match_t& m); }; template struct tree_policy > : public common_tree_tree_policy { static void concat(match_t& l, match_t const& r); template static void set_id_and_group(match_t& m, rule_id id, Iterator1T& first, Iterator2T const& last); }; template struct tree_policy > : public common_tree_tree_policy { static void concat(match_t& l, match_t const& r); template static void set_id_and_group(match_t& m, rule_id id, Iterator1T& first, Iterator2T const& last); }; template struct no_tree_gen_node_parser : public unary, public parser > { no_tree_gen_node_parser(T const& a); template typename ParsePolicyT::match_t do_parse(IteratorT& first, IteratorT const& last) const; }; struct no_tree_gen_node_parser_gen { template no_tree_gen_node_parser operator[](parser const& s) const { return no_tree_gen_node_parser(s.derived()); } }; const no_tree_gen_node_parser_gen no_node_d = no_tree_gen_node_parser_gen(); template struct gen_ast_node_parser : public unary, public parser > { gen_ast_node_parser(T const& a); template typename ParsePolicyT::match_t do_parse(IteratorT& first, IteratorT const& last) const; }; struct gen_ast_node_parser_gen { template gen_ast_node_parser operator[](parser const& s) const { return gen_ast_node_parser(s.derived()); } }; const gen_ast_node_parser_gen gen_ast_node_d = gen_ast_node_parser_gen(); template struct gen_pt_node_parser : public unary, public parser > { gen_pt_node_parser(T const& a); template typename ParsePolicyT::match_t do_parse(IteratorT& first, IteratorT const& last) const; }; struct gen_pt_node_parser_gen { template gen_pt_node_parser operator[](parser const& s) const { return gen_pt_node_parser(s.derived()); } }; const gen_pt_node_parser_gen gen_pt_node_d = gen_pt_node_parser_gen(); template struct node_parser : public unary, public parser > { node_parser(T const& a); template typename ParsePolicyT::match_t do_parse(IteratorT& first, IteratorT const& last) const; }; template struct node_parser_gen { template node_parser operator[](parser const& s) const { return node_parser(s.derived()); } }; class root_node_op; const node_parser_gen root_node_d = node_parser_gen(); class discard_node_op; const node_parser_gen discard_node_d = node_parser_gen(); class leaf_node_op; const node_parser_gen leaf_node_d = node_parser_gen(); const node_parser_gen token_node_d = node_parser_gen(); class infix_node_op; const node_parser_gen infix_node_d = node_parser_gen(); class discard_first_node_op; const node_parser_gen discard_first_node_d = node_parser_gen(); class discard_last_node_op; const node_parser_gen discard_last_node_d = node_parser_gen(); class inner_node_op; const node_parser_gen inner_node_d = node_parser_gen(); template struct action_directive_parser : public unary, public parser > { action_directive_parser(T const& a) : unary(a) {} template typename ParsePolicyT::match_t do_parse(IteratorT& first, IteratorT const& last) const { return this->subject().template do_parse(first, last); } template typename ActionParserT::template action, ActionT> operator[](ActionT const& actor) const { typename ActionParserT::template action action_t; return action_t(*this, actor); } }; template struct action_directive_parser_gen { template action_directive_parser operator[](parser const& s) const { return action_directive_parser(s.derived()); } }; struct access_match_action { template struct action : public unary , public parser > { typedef action_parser_category parser_category; action( ParserT const& subject, ActionT const& actor_); template typename ParsePolicyT::match_t do_parse(IteratorT& first, IteratorT const& last) const; ActionT const &predicate() const; private: typename embed_trait::type actor; }; }; template access_match_action::action::action( ParserT const& subject, ActionT const& actor_) : unary(subject) , actor(actor_) {} template template typename ParsePolicyT::match_t access_match_action::action:: do_parse(IteratorT& first, IteratorT const& last) const { if (first != last) { typename ParsePolicyT::match_t hit = this->subject().template do_parse(first, last); actor(hit, first, last); return hit; } return ParsePolicyT::no_match(); } template ActionT const &access_match_action::action::predicate() const { return actor; } const action_directive_parser_gen access_match = action_directive_parser_gen(); struct access_node_action { template struct action : public unary , public parser > { typedef action_parser_category parser_category; action( ParserT const& subject, ActionT const& actor_); template typename ParsePolicyT::match_t do_parse(IteratorT& first, IteratorT const& last) const; ActionT const &predicate() const; private: typename embed_trait::type actor; }; }; template access_node_action::action::action( ParserT const& subject, ActionT const& actor_) : unary(subject) , actor(actor_) {} template template typename ParsePolicyT::match_t access_node_action::action:: do_parse(IteratorT& first, IteratorT const& last) const { if (first != last) { typename ParsePolicyT::match_t hit = this->subject().template do_parse(first, last); if (hit && hit.trees.size() > 0) actor(*hit.trees.begin(), first, last); return hit; } return ParsePolicyT::no_match(); } template ActionT const &access_node_action::action::predicate() const { return actor; } const action_directive_parser_gen access_node = action_directive_parser_gen(); template class parse_tree_iterator { public: typedef ParseTreeMatchT parse_tree_match_t; typedef typename parse_tree_match_t::container_t tree_t; typedef typename parse_tree_match_t::parse_node_t parse_node_t; typedef typename parse_tree_match_t::tree_iterator tree_iterator_t; typedef typename parse_tree_match_t::const_tree_iterator const_tree_iterator_t; typedef typename parse_node_t::const_iterator_t const_iterator_t; typedef std::iterator_traits iterator_traits; typedef typename iterator_traits::value_type value_type; typedef typename iterator_traits::pointer pointer; typedef typename iterator_traits::reference reference; typedef typename iterator_traits::difference_type difference_type; typedef std::forward_iterator_tag iterator_category; private: class node_stack : public std::stack > { typedef std::stack > base_t; public: void push (tree_t const &target, const_tree_iterator_t iter); void adjust_forward(); void go_up(); void go_down(); const_tree_iterator_t &act_iter(); const_tree_iterator_t act_const_iter() const; const_tree_iterator_t node_end() const; }; public: parse_tree_iterator(); parse_tree_iterator(tree_t const &target_, const_tree_iterator_t iter_); reference operator*() const; pointer operator->() const; parse_tree_iterator& operator++(); parse_tree_iterator operator++(int); bool operator==(tree_iterator_t const &rhs) const; bool operator!=(tree_iterator_t const &rhs) const; bool operator==(parse_tree_iterator const &rhs) const; bool operator!=(parse_tree_iterator const &rhs) const; private: node_stack nodes; }; template typename impl::parser_return >::match_t tree_parse( IteratorT const& first_, IteratorT const& last_, parser const& parser, SkipT const& skip_); template typename impl::parser_return >::match_t tree_parse( IteratorT const& first_, IteratorT const& last, parser const& parser); template typename impl::parser_return >::match_t tree_parse( CharT const* str, parser const& parser, SkipT const& skip); template typename impl::parser_return >::match_t tree_parse( CharT const* str, parser const& parser); template typename impl::parser_return >::match_t ast_parse( IteratorT const& first_, IteratorT const& last_, parser const& parser, SkipT const& skip_); template typename impl::parser_return >::match_t ast_parse( IteratorT const& first_, IteratorT const& last, parser const& parser); template typename impl::parser_return >::match_t ast_parse( CharT const* str, parser const& parser, SkipT const& skip); template typename impl::parser_return >::match_t ast_parse( CharT const* str, parser const& parser); } # 1 "/usr/include/boost/spirit/tree/impl/parse_tree.ipp" 1 3 namespace spirit { template inline parse_tree_match::parse_tree_match() : data(-1) , trees() {} template inline parse_tree_match::operator bool() const { return data >= 0; } template inline int parse_tree_match::length() const { return data; } # 92 "/usr/include/boost/spirit/tree/impl/parse_tree.ipp" 3 template inline const common_tree_match_policy::match_t common_tree_match_policy::no_match() { return match_t(); } template inline const common_tree_match_policy::match_t common_tree_match_policy::empty_match() { typedef typename NodeFactoryT::template factory factory_t; return common_tree_match_policy::match_t( 0, tree_policy::create_node(0, IteratorT(), IteratorT(), false)); } template template inline common_tree_match_policy::match_t common_tree_match_policy::create_match( int length, Iterator1T const& first, Iterator2T const& last) { return match_t(length, tree_policy::create_node(length, first, last, true)); } template template inline common_tree_tree_policy::node_t common_tree_tree_policy::create_node( int , Iterator1T const& first, Iterator2T const& last, bool leaf_node) { typedef typename NodeFactoryT::template factory factory_t; typedef typename impl::strip_scanner strip_scanner1; typedef typename impl::strip_scanner strip_scanner2; typedef typename impl::strip_nocase strip_nocase1; typedef typename impl::strip_nocase strip_nocase2; # 159 "/usr/include/boost/spirit/tree/impl/parse_tree.ipp" 3 return factory_t::create_node(strip_nocase1::get(strip_scanner1::get(first)), strip_nocase2::get(strip_scanner2::get(last)), leaf_node); } template template inline void common_tree_tree_policy::apply_op_to_match(FunctorT const& op, match_t& m) { op(m); } template inline void common_tree_match_policy::concat( match_t& a, match_t const& b) { (( a && b ) ? (void)0 : __assert("/usr/include/boost/spirit/tree/impl/parse_tree.ipp", 181, "a && b")) ; if (a.length() == 0) { a = b; return; } else if (b.length() == 0) { return; } a.data += b.data; tree_policy::concat(a, b); return; } template inline void tree_policy >::concat( match_t& a, match_t const& b) { (( a && b ) ? (void)0 : __assert("/usr/include/boost/spirit/tree/impl/parse_tree.ipp", 208, "a && b")) ; if (0 != b.trees.size() && b.trees.begin()->value.is_root()) { (( b.trees.size() == 1 ) ? (void)0 : __assert("/usr/include/boost/spirit/tree/impl/parse_tree.ipp", 219, "b.trees.size() == 1")) ; typedef typename parse_tree_match::container_t container_t; container_t tmp; swap(a.trees, tmp); swap(b.trees, a.trees); container_t* pnon_root_trees = &a.trees; while (pnon_root_trees->size() > 0 && pnon_root_trees->begin()->value.is_root()) { pnon_root_trees = & pnon_root_trees->begin()->children; } pnon_root_trees->insert(pnon_root_trees->begin(), tmp.begin(), tmp.end()); } else if (0 != a.trees.size() && a.trees.begin()->value.is_root()) { (( a.trees.size() == 1 ) ? (void)0 : __assert("/usr/include/boost/spirit/tree/impl/parse_tree.ipp", 236, "a.trees.size() == 1")) ; copy(b.trees.begin(), b.trees.end(), std::back_insert_iterator::container_t>( a.trees.begin()->children)); } else { copy(b.trees.begin(), b.trees.end(), std::back_insert_iterator::container_t>(a.trees)); } return; } template template inline void tree_policy >::set_id_and_group( match_t& m, rule_id id, Iterator1T& first, Iterator2T const& last) { if (!m) return; typedef typename impl::strip_scanner strip_scanner1; typedef typename impl::strip_scanner strip_scanner2; typedef typename impl::strip_nocase strip_nocase1; typedef typename impl::strip_nocase strip_nocase2; typedef typename parse_tree_match::container_t container_t; typedef typename container_t::iterator iterator_t; typedef typename NodeFactoryT::template factory factory_t; if (m.trees.size() == 1) { container_t* punset_id = &m.trees; while (punset_id->size() > 0 && punset_id->begin()->value.id() == 0) { punset_id->begin()->value.id(id); punset_id = &punset_id->begin()->children; } m.trees.begin()->value.is_root(false); } else { match_t newmatch(m.data, factory_t::create_node(strip_nocase1::get(strip_scanner1::get(first)), strip_nocase2::get(strip_scanner2::get(last)), false)); swap(newmatch.trees.begin()->children, m.trees); newmatch.trees.begin()->value.id(id); for (iterator_t i = newmatch.trees.begin(); i != newmatch.trees.end(); ++i) { if (i->value.id() == 0) i->value.id(id); } m = newmatch; } } template inline void tree_policy >::concat( match_t& a, match_t const& b) { (( a && b ) ? (void)0 : __assert("/usr/include/boost/spirit/tree/impl/parse_tree.ipp", 329, "a && b")) ; copy(b.trees.begin(), b.trees.end(), std::back_insert_iterator::container_t>(a.trees)); return; } template template inline void tree_policy >::set_id_and_group( match_t& m, rule_id id, Iterator1T& first, Iterator2T const& last) { if (!m) return; typedef typename impl::strip_scanner strip_scanner1; typedef typename impl::strip_scanner strip_scanner2; typedef typename impl::strip_nocase strip_nocase1; typedef typename impl::strip_nocase strip_nocase2; typedef typename NodeFactoryT::template factory factory_t; match_t newmatch(m.data, factory_t::create_node(strip_nocase1::get(strip_scanner1::get(first)), strip_nocase2::get(strip_scanner2::get(last)), false)); swap(newmatch.trees.begin()->children, m.trees); newmatch.trees.begin()->value.id(id); m = newmatch; } template inline no_tree_gen_node_parser::no_tree_gen_node_parser(T const& a) : unary(a) {} template template inline typename ParsePolicyT::match_t no_tree_gen_node_parser::do_parse(IteratorT& first, IteratorT const& last) const { match hit = this->subject().template do_parse(first, last); return typename ParsePolicyT::match_t(hit); } template inline gen_ast_node_parser::gen_ast_node_parser(T const& a) : unary(a) {} template template inline typename ParsePolicyT::match_t gen_ast_node_parser::do_parse(IteratorT& first, IteratorT const& last) const { match hit = this->subject().template do_parse(first, last); return typename ParsePolicyT::match_t(hit); } template inline gen_pt_node_parser::gen_pt_node_parser(T const& a) : unary(a) {} template template inline typename ParsePolicyT::match_t gen_pt_node_parser::do_parse(IteratorT& first, IteratorT const& last) const { match hit = this->subject().template do_parse(first, last); return typename ParsePolicyT::match_t(hit); } template inline node_parser::node_parser(T const& a) : unary(a) {} template template inline typename ParsePolicyT::match_t node_parser::do_parse( IteratorT& first, IteratorT const& last) const { typename ParsePolicyT::match_t hit = this->subject().template do_parse(first, last); if (hit) tree_policy::apply_op_to_match( NodeParserT(), hit); return hit; } struct root_node_op { template void operator()(MatchT& m) const { (( m.trees.size() > 0 ) ? (void)0 : __assert("/usr/include/boost/spirit/tree/impl/parse_tree.ipp", 461, "m.trees.size() > 0")) ; m.trees.begin()->value.is_root(true); } }; struct discard_node_op { template void operator()(MatchT& m) const { m.trees.clear(); } }; struct leaf_node_op { template void operator()(MatchT& m) const { if (m.trees.size() == 1) { m.trees.begin()->children.clear(); } else if (m.trees.size() > 1) { typedef typename MatchT::node_factory_t node_factory_t; m = MatchT(m.data, node_factory_t::group_nodes(m.trees)); } } }; struct infix_node_op { template void operator()(MatchT& m) const { typedef typename MatchT::container_t container_t; typedef typename MatchT::container_t::iterator iter_t; typedef typename MatchT::container_t::value_type value_t; bool keep = true; container_t new_children; for (iter_t i = m.trees.begin(); i != m.trees.end(); ++i) { if (keep) { new_children.push_back(value_t()); std::swap(new_children.back(), *i); keep = false; } else { keep = true; } } std::swap(m.trees, new_children); } }; struct discard_first_node_op { template void operator()(MatchT& m) const { typedef typename MatchT::container_t container_t; typedef typename MatchT::container_t::iterator iter_t; typedef typename MatchT::container_t::value_type value_t; container_t new_children; iter_t i = m.trees.begin(); for (++i; i != m.trees.end(); ++i) { new_children.push_back(value_t()); std::swap(new_children.back(), *i); } std::swap(m.trees, new_children); } }; struct discard_last_node_op { template void operator()(MatchT& m) const { m.trees.pop_back(); } }; struct inner_node_op { template void operator()(MatchT& m) const { typedef typename MatchT::container_t container_t; typedef typename MatchT::container_t::iterator iter_t; typedef typename MatchT::container_t::value_type value_t; container_t new_children; m.trees.pop_back(); iter_t i = m.trees.begin(); for (++i; i != m.trees.end(); ++i) { new_children.push_back(value_t()); std::swap(new_children.back(), *i); } std::swap(m.trees, new_children); } }; template inline void parse_tree_iterator::node_stack::push ( tree_t const &target, const_tree_iterator_t iter) { base_t::push (typename node_stack::value_type(&target, iter)); } template inline void parse_tree_iterator::node_stack::adjust_forward() { if (++act_iter() != node_end()) go_down(); else go_up(); } template inline void parse_tree_iterator::node_stack::go_up() { if (base_t::size() > 1) { base_t::pop(); adjust_forward(); } } template inline void parse_tree_iterator::node_stack::go_down() { (( 0 != base_t::size() ) ? (void)0 : __assert("/usr/include/boost/spirit/tree/impl/parse_tree.ipp", 634, "0 != base_t::size()")) ; (( act_iter() != node_end() ) ? (void)0 : __assert("/usr/include/boost/spirit/tree/impl/parse_tree.ipp", 635, "act_iter() != node_end()")) ; while (0 != (*act_iter()).children.size()) { const_tree_iterator_t &it = act_iter(); push ((*it).children, (*it).children.begin()); } } template inline typename ParseTreeMatchT::const_tree_iterator & parse_tree_iterator::node_stack::act_iter() { (( 0 != base_t::size() ) ? (void)0 : __assert("/usr/include/boost/spirit/tree/impl/parse_tree.ipp", 649, "0 != base_t::size()")) ; return base_t::top().second; } template inline typename ParseTreeMatchT::const_tree_iterator parse_tree_iterator::node_stack::act_const_iter() const { if (0 != base_t::size()) return base_t::top().second; return const_tree_iterator_t(); } template inline typename ParseTreeMatchT::const_tree_iterator parse_tree_iterator::node_stack::node_end() const { if (0 != base_t::size()) return (*base_t::top().first).end(); return const_tree_iterator_t(); } template inline parse_tree_iterator::parse_tree_iterator() { } template inline parse_tree_iterator::parse_tree_iterator( tree_t const &target_, const_tree_iterator_t iter_) { node_stack nodes_tmp; nodes_tmp.push (target_, iter_); if (iter_ != target_.end()) nodes_tmp.go_down(); swap (nodes, nodes_tmp); } template inline typename parse_tree_iterator::reference parse_tree_iterator::operator*() const { return *(*nodes.act_const_iter()).value.begin(); } template inline typename parse_tree_iterator::pointer parse_tree_iterator::operator->() const { return &*(*nodes.act_const_iter()).value.begin(); } template inline parse_tree_iterator & parse_tree_iterator::operator++() { nodes.adjust_forward(); return *this; } template inline parse_tree_iterator parse_tree_iterator::operator++(int) { parse_tree_iterator it(*this); nodes.adjust_forward(); return it; } template inline bool parse_tree_iterator::operator==( tree_iterator_t const &rhs) const { return nodes.act_const_iter() == rhs; } template inline bool parse_tree_iterator::operator!=( tree_iterator_t const &rhs) const { return !(*this == rhs); } template inline bool parse_tree_iterator::operator==( parse_tree_iterator const &rhs) const { return 0 == nodes.size() && 0 == rhs.nodes.size() || nodes.act_const_iter() == rhs.nodes.act_const_iter(); } template inline bool parse_tree_iterator::operator!=( parse_tree_iterator const &rhs) const { return !(*this == rhs); } template typename impl::parser_return >::match_t tree_parse( IteratorT const& first_, IteratorT const& last_, parser const& parser, SkipT const& skip_) { skipper skip(skip_, last_); scanner first(first_, &skip); scanner last(last_, &skip); return parser.derived().template do_parse, parse_tree_match_policy >(first, last); } template typename impl::parser_return >::match_t tree_parse( IteratorT const& first_, IteratorT const& last, parser const& parser) { IteratorT first = first_; return parser.derived().template do_parse >(first, last); } template typename impl::parser_return >::match_t tree_parse( CharT const* str, parser const& parser, SkipT const& skip) { CharT const* last = str; while (*last) last++; return tree_parse(str, last, parser, skip); } template typename impl::parser_return >::match_t tree_parse( CharT const* str, parser const& parser) { CharT const* last = str; while (*last) last++; return tree_parse(str, last, parser); } template typename impl::parser_return >::match_t ast_parse( IteratorT const& first_, IteratorT const& last_, parser const& parser, SkipT const& skip_) { skipper skip(skip_, last_); scanner first(first_, &skip); scanner const last(last_, &skip); return parser.derived().template do_parse, ast_match_policy >(first, last); } template typename impl::parser_return >::match_t ast_parse( IteratorT const& first_, IteratorT const& last, parser const& parser) { IteratorT first = first_; return parser.derived().template do_parse >(first, last); } template typename impl::parser_return >::match_t ast_parse( CharT const* str, parser const& parser, SkipT const& skip) { CharT const* last = str; while (*last) last++; return ast_parse(str, last, parser, skip); } template typename impl::parser_return >::match_t ast_parse( CharT const* str, parser const& parser) { CharT const* last = str; while (*last) last++; return ast_parse(str, last, parser); } } # 1058 "/usr/include/boost/spirit/tree/parse_tree.hpp" 2 3 # 54 "/usr/include/boost/spirit/spirit_tree.hpp" 2 3 # 58 "/usr/include/boost/spirit/spirit.hpp" 2 3 # 41 "c_grammar.cpp" 2 using namespace spirit; using namespace std; template < class Grammar > static void parse(char const* filename) { ifstream in(filename); if (!in) { cerr << "Could not open file: " << filename << endl; return; } in.unsetf(ios::skipws); rule cpp_directive_begin = "#" >> *space_p; rule cpp_directive_end = *(anychar_p - '\n') >> '\n'; rule comment = "//" >> *(anychar_p - '\n') >> '\n' | "/*" >> *(anychar_p - "*/") >> "*/" | cpp_directive_begin >> (strlit<> ( "line") | "pragma" | "define" | "undef" | "include" | "if" | "ifdef" | "ifndef" | "else" | "elif" | "endif" | "message" | "warning" | "error" | "comment" ) >> cpp_directive_end ; vector vec = vector(istream_iterator(in),istream_iterator()); vector const& cvec = vec; Grammar grammar; parse_info result = parse(&*cvec.begin(), &*cvec.end(), grammar, space_p | comment); if (result.full) cerr << filename << " Parses OK" << endl; else { cerr << filename << " Fails Parsing" << endl; for (int i = 0; i < 50; i++) { if (result.stop == &*cvec.end()) break; cerr << *result.stop++; } cerr << endl; } } template < class IteratorT > struct c_grammar_base { typedef spirit::symbols<> symbols; typedef spirit::strlit <> strlit; typedef spirit::chlit <> chlit; typedef spirit::range <> range; typedef spirit::rule rule; }; template struct c_predefined { typedef rule no_tree_rule_t; typedef rule rule_t; symbols<> keywords; c_predefined() { } }; struct c_grammar: grammar { template struct definition: c_predefined { typedef rule no_tree_rule_t; typedef rule rule_t; strlit<> const ELLIPSIS; strlit<> const RIGHT_ASSIGN; strlit<> const LEFT_ASSIGN; strlit<> const ADD_ASSIGN; strlit<> const SUB_ASSIGN; strlit<> const MUL_ASSIGN; strlit<> const DIV_ASSIGN; strlit<> const MOD_ASSIGN; strlit<> const AND_ASSIGN; strlit<> const XOR_ASSIGN; strlit<> const OR_ASSIGN; strlit<> const RIGHT_OP; strlit<> const LEFT_OP; strlit<> const INC_OP; strlit<> const DEC_OP; strlit<> const PTR_OP; strlit<> const AND_OP; strlit<> const OR_OP; strlit<> const LE_OP; strlit<> const GE_OP; strlit<> const EQ_OP; strlit<> const NE_OP; chlit<> const SEMICOLON; rule_t const LEFT_BRACE; rule_t const RIGHT_BRACE; chlit<> const COMMA; chlit<> const COLON; chlit<> const ASSIGN; chlit<> const LEFT_PAREN; chlit<> const RIGHT_PAREN; rule_t const LEFT_BRACKET; rule_t const RIGHT_BRACKET; chlit<> const DOT; chlit<> const ADDROF; chlit<> const BANG; chlit<> const TILDE; chlit<> const MINUS; chlit<> const PLUS; chlit<> const STAR; chlit<> const SLASH; chlit<> const PERCENT; chlit<> const LT_OP; chlit<> const GT_OP; chlit<> const XOR; chlit<> const OR; chlit<> const QUEST; rule_t const AUTO; rule_t const BREAK; rule_t const CASE; rule_t const CHAR; rule_t const CONST; rule_t const CONTINUE; rule_t const DEFAULT; rule_t const DO; rule_t const DOUBLE; rule_t const ELSE; rule_t const ENUM; rule_t const EXTERN; rule_t const FOR; rule_t const FLOAT; rule_t const GOTO; rule_t const IF; rule_t const INT; rule_t const LONG; rule_t const REGISTER; rule_t const RETURN; rule_t const SHORT; rule_t const SIGNED; rule_t const SIZEOF; rule_t const STATIC; rule_t const STRUCT; rule_t const SWITCH; rule_t const TYPEDEF; rule_t const UNION; rule_t const UNSIGNED; rule_t const VOID; rule_t const VOLATILE; rule_t const WHILE; rule_t const IDENTIFIER; rule_t const STRING_LITERAL_PART; rule_t const STRING_LITERAL; rule_t const INT_CONSTANT_HEX; rule_t const INT_CONSTANT_OCT; rule_t const INT_CONSTANT_DEC; rule_t const INT_CONSTANT_CHAR; rule_t const INT_CONSTANT; rule_t const FLOAT_CONSTANT_1; rule_t const FLOAT_CONSTANT_2; rule_t const FLOAT_CONSTANT_3; rule_t const FLOAT_CONSTANT; rule_t const CONSTANT; rule_t primary_expression; rule_t postfix_expression; rule_t postfix_expression_helper; rule_t argument_expression_list; rule_t unary_expression; rule_t unary_operator; rule_t cast_expression; rule_t multiplicative_expression; rule_t multiplicative_expression_helper; rule_t additive_expression; rule_t additive_expression_helper; rule_t shift_expression; rule_t shift_expression_helper; rule_t relational_expression; rule_t relational_expression_helper; rule_t equality_expression; rule_t equality_expression_helper; rule_t and_expression; rule_t and_expression_helper; rule_t exclusive_or_expression; rule_t exclusive_or_expression_helper; rule_t inclusive_or_expression; rule_t inclusive_or_expression_helper; rule_t logical_and_expression; rule_t logical_and_expression_helper; rule_t logical_or_expression; rule_t logical_or_expression_helper; rule_t conditional_expression; rule_t conditional_expression_helper; rule_t assignment_expression; rule_t assignment_operator; rule_t expression; rule_t expression_helper; rule_t constant_expression; rule_t declaration; rule_t declaration_specifiers; rule_t init_declarator_list; rule_t init_declarator; rule_t storage_class_specifier; rule_t type_specifier; rule_t struct_or_union_specifier; rule_t struct_or_union; rule_t struct_declaration_list; rule_t struct_declaration; rule_t specifier_qualifier_list; rule_t struct_declarator_list; rule_t struct_declarator; rule_t enum_specifier; rule_t enumerator_list; rule_t enumerator; rule_t type_qualifier; rule_t declarator; rule_t direct_declarator; rule_t direct_declarator_helper; rule_t pointer; rule_t type_qualifier_list; rule_t parameter_type_list; rule_t parameter_list; rule_t parameter_declaration; rule_t identifier_list; rule_t type_name; rule_t abstract_declarator; rule_t direct_abstract_declarator; rule_t direct_abstract_declarator_helper; rule_t initializer; rule_t initializer_list; rule_t statement; rule_t labeled_statement; rule_t compound_statement; rule_t declaration_list; rule_t statement_list; rule_t expression_statement; rule_t selection_statement; rule_t iteration_statement; rule_t jump_statement; rule_t translation_unit; rule_t external_declaration; rule_t function_definition; definition(): ELLIPSIS ("..."), RIGHT_ASSIGN (">>="), LEFT_ASSIGN ("<<="), ADD_ASSIGN ("+="), SUB_ASSIGN ("-="), MUL_ASSIGN ("*="), DIV_ASSIGN ("/="), MOD_ASSIGN ("%="), AND_ASSIGN ("&="), XOR_ASSIGN ("^="), OR_ASSIGN ("|="), RIGHT_OP (">>"), LEFT_OP ("<<"), INC_OP ("++"), DEC_OP ("--"), PTR_OP ("->"), AND_OP ("&&"), OR_OP ("||"), LE_OP ("<="), GE_OP (">="), EQ_OP ("=="), NE_OP ("!="), SEMICOLON (';'), LEFT_BRACE (chlit<>('{') | strlit<>("<%")), RIGHT_BRACE (chlit<>('}') | strlit<>("%>")), COMMA (','), COLON (':'), ASSIGN ('='), LEFT_PAREN ('('), RIGHT_PAREN (')'), LEFT_BRACKET (chlit<>('[') | strlit<>("<:")), RIGHT_BRACKET (chlit<>(']') | strlit<>(":>")), DOT ('.'), ADDROF ('&'), BANG ('!'), TILDE ('~'), MINUS ('-'), PLUS ('+'), STAR ('*'), SLASH ('/'), PERCENT ('%'), LT_OP ('<'), GT_OP ('>'), XOR ('^'), OR ('|'), QUEST ('?'), AUTO (strlit<>("auto")), BREAK (strlit<>("break")), CASE (strlit<>("case")), CHAR (strlit<>("char")), CONST (strlit<>("const")), CONTINUE(strlit<>("continue")), DEFAULT (strlit<>("default")), DO (strlit<>("do")), DOUBLE (strlit<>("double")), ELSE (strlit<>("else")), ENUM (strlit<>("enum")), EXTERN (strlit<>("extern")), FOR (strlit<>("for")), FLOAT (strlit<>("float")), GOTO (strlit<>("goto")), IF (strlit<>("if")), INT (strlit<>("int")), LONG (strlit<>("long")), REGISTER(strlit<>("register")), RETURN (strlit<>("return")), SHORT (strlit<>("short")), SIGNED (strlit<>("signed")), SIZEOF (strlit<>("sizeof")), STATIC (strlit<>("static")), STRUCT (strlit<>("struct")), SWITCH (strlit<>("switch")), TYPEDEF (strlit<>("typedef")), UNION (strlit<>("union")), UNSIGNED(strlit<>("unsigned")), VOID (strlit<>("void")), VOLATILE(strlit<>("volatile")), WHILE (strlit<>("while")), IDENTIFIER( lexeme_d[ ((alpha_p | '_' | '$') >> *(alnum_p | '_' | '$')) - (keywords >> anychar_p - (alnum_p | '_' | '$')) ]), STRING_LITERAL_PART( lexeme_d[ !chlit<>('L') >> chlit<>('\"') >> *( strlit<>("\"\"") | anychar_p - chlit<>('\"') ) >> chlit<>('\"') ]), STRING_LITERAL(+STRING_LITERAL_PART), INT_CONSTANT_HEX( lexeme_d[ chlit<>('0') >> nocase_d[chlit<>('x')] >> +xdigit_p >> !nocase_d[chlit<>('l') | chlit<>('u')] ]), INT_CONSTANT_OCT( lexeme_d[ chlit<>('0') >> +range<>('0', '7') >> !nocase_d[chlit<>('l') | chlit<>('u')] ]), INT_CONSTANT_DEC( lexeme_d[ +digit_p >> !nocase_d[chlit<>('l') | chlit<>('u')] ]), INT_CONSTANT_CHAR( lexeme_d[ !chlit<>('L') >> chlit<>('\'') >> longest_d[ anychar_p | (chlit<>('\\') >> chlit<>('0') >> range<>('0', '7').repeat(0, 2)) | (chlit<>('\\') >> anychar_p) ] >> chlit<>('\'') ]), INT_CONSTANT(INT_CONSTANT_HEX | INT_CONSTANT_OCT | INT_CONSTANT_DEC | INT_CONSTANT_CHAR), FLOAT_CONSTANT_1( lexeme_d[ +digit_p >> (chlit<>('e') | chlit<>('E')) >> !(chlit<>('+') | chlit<>('-')) >> +digit_p >> !nocase_d[chlit<>('l') | chlit<>('f')] ]), FLOAT_CONSTANT_2( lexeme_d[ *digit_p >> chlit<>('.') >> +digit_p >> !((chlit<>('e') | chlit<>('E')) >> !(chlit<>('+') | chlit<>('-')) >> +digit_p) >> !nocase_d[chlit<>('l') | chlit<>('f')] ]), FLOAT_CONSTANT_3( lexeme_d[ +digit_p >> chlit<>('.') >> *digit_p >> !((chlit<>('e') | chlit<>('E')) >> !(chlit<>('+') | chlit<>('-')) >> +digit_p) >> !nocase_d[chlit<>('l') | chlit<>('f')] ]), FLOAT_CONSTANT(FLOAT_CONSTANT_1 | FLOAT_CONSTANT_2 | FLOAT_CONSTANT_3), CONSTANT(longest_d[FLOAT_CONSTANT | INT_CONSTANT]) { keywords = "auto", "break", "case", "char", "const", "continue", "default", "do", "double", "else", "enum", "extern", "float", "for", "goto", "if", "int", "long", "register", "return", "short", "signed", "sizeof", "static", "struct", "switch", "typedef", "union", "unsigned", "void", "volatile", "while"; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; primary_expression = IDENTIFIER | CONSTANT | STRING_LITERAL | LEFT_PAREN >> expression >> RIGHT_PAREN ; postfix_expression = primary_expression >> postfix_expression_helper ; postfix_expression_helper = ( LEFT_BRACKET >> expression >> RIGHT_BRACKET | LEFT_PAREN >> !argument_expression_list >> RIGHT_PAREN | DOT >> IDENTIFIER | PTR_OP >> IDENTIFIER | INC_OP | DEC_OP ) >> postfix_expression_helper | epsilon_p ; argument_expression_list = assignment_expression >> *(COMMA >> assignment_expression) ; unary_expression = postfix_expression | INC_OP >> unary_expression | DEC_OP >> unary_expression | unary_operator >> cast_expression | SIZEOF >> ( unary_expression | LEFT_PAREN >> type_name >> RIGHT_PAREN ) ; unary_operator = ADDROF | STAR | PLUS | MINUS | TILDE | BANG ; cast_expression = LEFT_PAREN >> type_name >> RIGHT_PAREN >> cast_expression | unary_expression ; multiplicative_expression = cast_expression >> multiplicative_expression_helper ; multiplicative_expression_helper = ( STAR >> cast_expression | SLASH >> cast_expression | PERCENT >> cast_expression ) >> multiplicative_expression_helper | epsilon_p ; additive_expression = multiplicative_expression >> additive_expression_helper ; additive_expression_helper = ( PLUS >> multiplicative_expression | MINUS >> multiplicative_expression ) >> additive_expression_helper | epsilon_p ; shift_expression = additive_expression >> shift_expression_helper ; shift_expression_helper = ( LEFT_OP >> additive_expression | RIGHT_OP >> additive_expression ) >> shift_expression_helper | epsilon_p ; relational_expression = shift_expression >> relational_expression_helper ; relational_expression_helper = ( LT_OP >> shift_expression | GT_OP >> shift_expression | LE_OP >> shift_expression | GE_OP >> shift_expression ) >> relational_expression_helper | epsilon_p ; equality_expression = relational_expression >> equality_expression_helper ; equality_expression_helper = ( EQ_OP >> relational_expression | NE_OP >> relational_expression ) >> equality_expression_helper | epsilon_p ; and_expression = equality_expression >> and_expression_helper ; and_expression_helper = ADDROF >> equality_expression >> and_expression_helper | epsilon_p ; exclusive_or_expression = and_expression >> exclusive_or_expression_helper ; exclusive_or_expression_helper = XOR >> and_expression >> exclusive_or_expression_helper | epsilon_p ; inclusive_or_expression = exclusive_or_expression >> inclusive_or_expression_helper ; inclusive_or_expression_helper = OR >> exclusive_or_expression >> inclusive_or_expression_helper | epsilon_p ; logical_and_expression = inclusive_or_expression >> logical_and_expression_helper ; logical_and_expression_helper = AND_OP >> inclusive_or_expression >> logical_and_expression_helper | epsilon_p ; logical_or_expression = logical_and_expression >> logical_or_expression_helper ; logical_or_expression_helper = OR_OP >> logical_and_expression >> logical_or_expression_helper | epsilon_p ; conditional_expression = logical_or_expression >> conditional_expression_helper ; conditional_expression_helper = QUEST >> expression >> COLON >> conditional_expression >> conditional_expression_helper | epsilon_p ; assignment_expression = unary_expression >> assignment_operator >> assignment_expression | conditional_expression ; assignment_operator = ASSIGN | MUL_ASSIGN | DIV_ASSIGN | MOD_ASSIGN | ADD_ASSIGN | SUB_ASSIGN | LEFT_ASSIGN | RIGHT_ASSIGN | AND_ASSIGN | XOR_ASSIGN | OR_ASSIGN ; expression = assignment_expression >> expression_helper ; expression_helper = COMMA >> assignment_expression >> expression_helper | epsilon_p ; constant_expression = conditional_expression ; declaration = declaration_specifiers >> !init_declarator_list >> SEMICOLON ; declaration_specifiers = ( storage_class_specifier | type_specifier | type_qualifier ) >> !declaration_specifiers ; init_declarator_list = init_declarator >> *(COMMA >> init_declarator) ; init_declarator = declarator >> !(ASSIGN >> initializer) ; storage_class_specifier = TYPEDEF | EXTERN | STATIC | AUTO | REGISTER ; type_specifier = VOID | CHAR | SHORT | INT | LONG | FLOAT | DOUBLE | SIGNED | UNSIGNED | struct_or_union_specifier | enum_specifier ; struct_or_union_specifier = struct_or_union >> ( IDENTIFIER >> !(LEFT_BRACE >> struct_declaration_list >> RIGHT_BRACE) | LEFT_BRACE >> struct_declaration_list >> RIGHT_BRACE ) ; struct_or_union = STRUCT | UNION ; struct_declaration_list = +struct_declaration ; struct_declaration = specifier_qualifier_list >> struct_declarator_list >> SEMICOLON ; specifier_qualifier_list = ( type_specifier | type_qualifier ) >> !specifier_qualifier_list ; struct_declarator_list = struct_declarator >> *(COMMA >> struct_declarator) ; struct_declarator = declarator || (COLON >> constant_expression) ; enum_specifier = ENUM >> !IDENTIFIER >> LEFT_BRACE >> enumerator_list >> RIGHT_BRACE ; enumerator_list = enumerator >> *(COMMA >> enumerator) ; enumerator = IDENTIFIER >> !(ASSIGN >> constant_expression) ; type_qualifier = CONST | VOLATILE ; declarator = !pointer >> direct_declarator ; direct_declarator = ( IDENTIFIER | LEFT_PAREN >> declarator >> RIGHT_PAREN ) >> direct_declarator_helper ; direct_declarator_helper = ( LEFT_BRACKET >> !constant_expression >> RIGHT_BRACKET | LEFT_PAREN >> !( parameter_type_list | identifier_list ) >> RIGHT_PAREN ) >> direct_declarator_helper | epsilon_p ; pointer = STAR >> !(type_qualifier_list || pointer) ; type_qualifier_list = +type_qualifier ; parameter_type_list = parameter_list >> !(COMMA >> ELLIPSIS) ; parameter_list = parameter_declaration >> *(COMMA >> parameter_declaration) ; parameter_declaration = declaration_specifiers >> !( declarator | abstract_declarator ) ; identifier_list = IDENTIFIER >> *(COMMA >> IDENTIFIER) ; type_name = specifier_qualifier_list >> !abstract_declarator ; abstract_declarator = pointer || direct_abstract_declarator ; direct_abstract_declarator = ( LEFT_PAREN >> ( abstract_declarator >> RIGHT_PAREN | !parameter_type_list >> RIGHT_PAREN ) | LEFT_BRACKET >> !constant_expression >> RIGHT_BRACKET ) >> direct_abstract_declarator_helper ; direct_abstract_declarator_helper = ( LEFT_BRACKET >> !constant_expression >> RIGHT_BRACKET | LEFT_PAREN >> !parameter_type_list >> RIGHT_PAREN ) >> direct_abstract_declarator_helper | epsilon_p ; initializer = assignment_expression | LEFT_BRACE >> initializer_list >> !COMMA >> RIGHT_BRACE ; initializer_list = initializer >> *(COMMA >> initializer) ; statement = labeled_statement | compound_statement | expression_statement | selection_statement | iteration_statement | jump_statement ; labeled_statement = IDENTIFIER >> COLON >> statement | CASE >> constant_expression >> COLON >> statement | DEFAULT >> COLON >> statement ; compound_statement = LEFT_BRACE >> !(declaration_list || statement_list) >> RIGHT_BRACE ; declaration_list = +declaration ; statement_list = +statement ; expression_statement = !expression >> SEMICOLON ; selection_statement = IF >> LEFT_PAREN >> expression >> RIGHT_PAREN >> statement >> !(ELSE >> statement) | SWITCH >> LEFT_PAREN >> expression >> RIGHT_PAREN >> statement ; iteration_statement = WHILE >> LEFT_PAREN >> expression >> RIGHT_PAREN >> statement | DO >> statement >> WHILE >> LEFT_PAREN >> expression >> RIGHT_PAREN >> SEMICOLON | FOR >> LEFT_PAREN >> expression_statement >> expression_statement >> !expression >> RIGHT_PAREN >> statement ; jump_statement = GOTO >> IDENTIFIER >> SEMICOLON | CONTINUE >> SEMICOLON | BREAK >> SEMICOLON | RETURN >> !expression >> SEMICOLON ; translation_unit = *external_declaration ; external_declaration = function_definition | declaration ; function_definition = !declaration_specifiers >> declarator >> !declaration_list >> compound_statement ; } rule_t const& start() const { return translation_unit; } }; }; int main(int argc, char* argv[]) { cerr << "C Grammar checker implemented with Spirit ..." << endl; if (2 == argc) { parse(argv[1]); } else { cerr << "No filename given" << endl; } return 0; } ----gnatsweb-attachment---- Content-Type: text/plain; name="c_grammar.ii" Content-Disposition: inline; filename="c_grammar.ii" # 1 "c_grammar.cpp" # 1 "/usr/include/g++-3/iostream" 1 3 # 1 "/usr/include/g++-3/iostream.h" 1 3 #pragma interface # 1 "/usr/include/g++-3/streambuf.h" 1 3 #pragma interface extern "C" { # 1 "/usr/include/g++-3/libio.h" 1 3 # 1 "/usr/include/_G_config.h" 1 3 typedef int _G_int8_t __attribute__((__mode__(__QI__))); typedef unsigned int _G_uint8_t __attribute__((__mode__(__QI__))); typedef int _G_int16_t __attribute__((__mode__(__HI__))); typedef unsigned int _G_uint16_t __attribute__((__mode__(__HI__))); typedef int _G_int32_t __attribute__((__mode__(__SI__))); typedef unsigned int _G_uint32_t __attribute__((__mode__(__SI__))); typedef int _G_int64_t __attribute__((__mode__(__DI__))); typedef unsigned int _G_uint64_t __attribute__((__mode__(__DI__))); __extension__ typedef long long _G_llong; __extension__ typedef unsigned long long _G_ullong; typedef unsigned long _G_clock_t; typedef short _G_dev_t; typedef long _G_fpos_t; typedef unsigned short _G_gid_t; typedef unsigned long _G_ino_t; typedef int _G_mode_t; typedef unsigned short _G_nlink_t; typedef long _G_off_t; typedef int _G_pid_t; typedef int _G_ptrdiff_t; typedef unsigned long _G_sigset_t; typedef unsigned int _G_size_t; typedef long _G_time_t; typedef unsigned short _G_uid_t; typedef short unsigned int _G_wchar_t; typedef long _G_ssize_t; typedef unsigned int _G_wint_t; typedef void * _G_va_list; # 1 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/stddef.h" 1 3 # 21 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/stddef.h" 3 # 63 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/stddef.h" 3 # 133 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/stddef.h" 3 # 192 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/stddef.h" 3 # 273 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/stddef.h" 3 # 285 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/stddef.h" 3 # 319 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/stddef.h" 3 # 86 "/usr/include/_G_config.h" 2 3 # 30 "/usr/include/g++-3/libio.h" 2 3 # 55 "/usr/include/g++-3/libio.h" 3 # 1 "/usr/include/sys/cdefs.h" 1 3 # 59 "/usr/include/g++-3/libio.h" 2 3 # 104 "/usr/include/g++-3/libio.h" 3 struct _IO_jump_t; struct _IO_FILE; # 175 "/usr/include/g++-3/libio.h" 3 typedef void _IO_lock_t; struct _IO_marker { struct _IO_marker *_next; struct _IO_FILE *_sbuf; int _pos; # 208 "/usr/include/g++-3/libio.h" 3 }; struct _IO_FILE { int _flags; char* _IO_read_ptr; char* _IO_read_end; char* _IO_read_base; char* _IO_write_base; char* _IO_write_ptr; char* _IO_write_end; char* _IO_buf_base; char* _IO_buf_end; char *_IO_save_base; char *_IO_backup_base; char *_IO_save_end; struct _IO_marker *_markers; struct _IO_FILE *_chain; int _fileno; int _blksize; _G_off_t _offset; unsigned short _cur_column; char _unused; char _shortbuf[1]; }; struct _IO_FILE_plus; extern struct _IO_FILE_plus _IO_stdin_, _IO_stdout_, _IO_stderr_; typedef struct { _G_ssize_t (*read) (struct _IO_FILE *, void *, _G_ssize_t ) ; _G_ssize_t (*write) (struct _IO_FILE *, const void *, _G_ssize_t ) ; _G_off_t (*seek) (struct _IO_FILE *, _G_off_t , int) ; int (*close) (struct _IO_FILE *) ; } _IO_cookie_io_functions_t; struct _IO_cookie_file { struct _IO_FILE file; const void *vtable; void *cookie; _IO_cookie_io_functions_t io_functions; }; extern "C" { extern int __underflow (_IO_FILE *) ; extern int __uflow (_IO_FILE *) ; extern int __overflow (_IO_FILE *, int) ; extern int _IO_getc (_IO_FILE *__fp) ; extern int _IO_putc (int __c, _IO_FILE *__fp) ; extern int _IO_feof (_IO_FILE *__fp) ; extern int _IO_ferror (_IO_FILE *__fp) ; extern int _IO_peekc_locked (_IO_FILE *__fp) ; extern void _IO_flockfile (_IO_FILE *) ; extern void _IO_funlockfile (_IO_FILE *) ; extern int _IO_ftrylockfile (_IO_FILE *) ; extern int _IO_vfscanf (_IO_FILE *, const char *, _G_va_list , int *) ; extern int _IO_vfprintf (_IO_FILE *, const char *, _G_va_list ) ; extern _G_ssize_t _IO_padn (_IO_FILE *, int, _G_ssize_t ) ; extern _G_size_t _IO_sgetn (_IO_FILE *, void *, _G_size_t ) ; extern _G_off_t _IO_seekoff (_IO_FILE *, _G_off_t , int, int) ; extern _G_off_t _IO_seekpos (_IO_FILE *, _G_off_t , int) ; extern void _IO_free_backup_area (_IO_FILE *) ; } # 36 "/usr/include/g++-3/streambuf.h" 2 3 } extern "C++" { class istream; class ostream; class streambuf; typedef _G_off_t streamoff; typedef _G_off_t streampos; typedef _G_ssize_t streamsize; typedef unsigned long __fmtflags; typedef unsigned char __iostate; struct _ios_fields { streambuf *_strbuf; ostream* _tie; int _width; __fmtflags _flags; short _fill; __iostate _state; __iostate _exceptions; int _precision; void *_arrays; }; # 124 "/usr/include/g++-3/streambuf.h" 3 class ios : public _ios_fields { ios& operator=(ios&); ios (const ios&); public: typedef __fmtflags fmtflags; typedef int iostate; typedef int openmode; typedef _G_ssize_t streamsize; enum io_state { goodbit = 0 , eofbit = 1 , failbit = 2 , badbit = 4 }; enum open_mode { in = 1 , out = 2 , ate = 4 , app = 8 , trunc = 16 , nocreate = 32 , noreplace = 64 , bin = 128 , binary = 128 }; enum seek_dir { beg, cur, end}; typedef enum seek_dir seekdir; enum { skipws= 01 , left= 02 , right= 04 , internal= 010 , dec= 020 , oct= 040 , hex= 0100 , showbase= 0200 , showpoint= 0400 , uppercase= 01000 , showpos= 02000 , scientific= 04000 , fixed= 010000 , unitbuf= 020000 , stdio= 040000 }; enum { basefield=dec+oct+hex, floatfield = scientific+fixed, adjustfield = left+right+internal }; # 177 "/usr/include/g++-3/streambuf.h" 3 ostream* tie() const { return _tie; } ostream* tie(ostream* val) { ostream* save=_tie; _tie=val; return save; } short fill() const { return _fill; } short fill(short newf) {short oldf = _fill; _fill = newf; return oldf;} fmtflags flags() const { return _flags; } fmtflags flags(fmtflags new_val) { fmtflags old_val = _flags; _flags = new_val; return old_val; } int precision() const { return _precision; } int precision(int newp) { unsigned short oldp = _precision; _precision = (unsigned short)newp; return oldp; } fmtflags setf(fmtflags val) { fmtflags oldbits = _flags; _flags |= val; return oldbits; } fmtflags setf(fmtflags val, fmtflags mask) { fmtflags oldbits = _flags; _flags = (_flags & ~mask) | (val & mask); return oldbits; } fmtflags unsetf(fmtflags mask) { fmtflags oldbits = _flags; _flags &= ~mask; return oldbits; } int width() const { return _width; } int width(int val) { int save = _width; _width = val; return save; } void _throw_failure() const { } void clear(iostate state = 0) { _state = _strbuf ? state : state|badbit; if (_state & _exceptions) _throw_failure(); } void set(iostate flag) { _state |= flag; if (_state & _exceptions) _throw_failure(); } void setstate(iostate flag) { _state |= flag; if (_state & _exceptions) _throw_failure(); } int good() const { return _state == 0; } int eof() const { return _state & ios::eofbit; } int fail() const { return _state & (ios::badbit|ios::failbit); } int bad() const { return _state & ios::badbit; } iostate rdstate() const { return _state; } operator void*() const { return fail() ? (void*)0 : (void*)(-1); } int operator!() const { return fail(); } iostate exceptions() const { return _exceptions; } void exceptions(iostate enable) { _exceptions = enable; if (_state & _exceptions) _throw_failure(); } streambuf* rdbuf() const { return _strbuf; } streambuf* rdbuf(streambuf *_s) { streambuf *_old = _strbuf; _strbuf = _s; clear (); return _old; } static int sync_with_stdio(int on); static void sync_with_stdio() { sync_with_stdio(1); } static fmtflags bitalloc(); static int xalloc(); void*& pword(int); void* pword(int) const; long& iword(int); long iword(int) const; class Init { public: Init () { } }; protected: inline ios(streambuf* sb = 0, ostream* tie_to = 0); inline virtual ~ios(); inline void init(streambuf* sb, ostream* tie = 0); }; typedef ios::seek_dir _seek_dir; class streammarker : private _IO_marker { friend class streambuf; void set_offset(int offset) { _pos = offset; } public: streammarker(streambuf *sb); ~streammarker(); int saving() { return 1; } int delta(streammarker&); int delta(); }; struct streambuf : public _IO_FILE { friend class ios; friend class istream; friend class ostream; friend class streammarker; const void *&_vtable() { return *(const void**)((_IO_FILE*)this + 1); } protected: static streambuf* _list_all; _IO_FILE*& xchain() { return _chain; } void _un_link(); void _link_in(); char* gptr() const { return _flags & 0x100 ? _IO_save_base : _IO_read_ptr; } char* pptr() const { return _IO_write_ptr; } char* egptr() const { return _flags & 0x100 ? _IO_save_end : _IO_read_end; } char* epptr() const { return _IO_write_end; } char* pbase() const { return _IO_write_base; } char* eback() const { return _flags & 0x100 ? _IO_save_base : _IO_read_base;} char* base() const { return _IO_buf_base; } char* ebuf() const { return _IO_buf_end; } int blen() const { return _IO_buf_end - _IO_buf_base; } void xput_char(char c) { *_IO_write_ptr++ = c; } int xflags() { return _flags ; } int xflags(int f) {int fl = _flags ; _flags = f; return fl;} void xsetflags(int f) { _flags |= f; } void xsetflags(int f, int mask) { _flags = (_flags & ~mask) | (f & mask); } void gbump(int n) { _flags & 0x100 ? (_IO_save_base+=n):(_IO_read_ptr+=n);} void pbump(int n) { _IO_write_ptr += n; } void setb(char* b, char* eb, int a=0); void setp(char* p, char* ep) { _IO_write_base=_IO_write_ptr=p; _IO_write_end=ep; } void setg(char* eb, char* g, char *eg) { if (_flags & 0x100 ) _IO_free_backup_area(this); _IO_read_base = eb; _IO_read_ptr = g; _IO_read_end = eg; } char *shortbuf() { return _shortbuf; } int in_backup() { return _flags & 0x100 ; } char *Gbase() { return in_backup() ? _IO_save_base : _IO_read_base; } char *eGptr() { return in_backup() ? _IO_save_end : _IO_read_end; } char *Bbase() { return in_backup() ? _IO_read_base : _IO_save_base; } char *Bptr() { return _IO_backup_base; } char *eBptr() { return in_backup() ? _IO_read_end : _IO_save_end; } char *Nbase() { return _IO_save_base; } char *eNptr() { return _IO_save_end; } int have_backup() { return _IO_save_base != __null ; } int have_markers() { return _markers != __null ; } void free_backup_area(); void unsave_markers(); int put_mode() { return _flags & 0x800 ; } int switch_to_get_mode(); streambuf(int flags=0); public: static int flush_all(); static void flush_all_linebuffered(); virtual ~streambuf(); virtual int overflow(int c = (-1) ); virtual int underflow(); virtual int uflow(); virtual int pbackfail(int c); virtual streamsize xsputn(const char* s, streamsize n); virtual streamsize xsgetn(char* s, streamsize n); virtual streampos seekoff(streamoff, _seek_dir, int mode=ios::in|ios::out); virtual streampos seekpos(streampos pos, int mode = ios::in|ios::out); streampos pubseekoff(streamoff o, _seek_dir d, int mode=ios::in|ios::out) { return _IO_seekoff (this, o, d, mode); } streampos pubseekpos(streampos pos, int mode = ios::in|ios::out) { return _IO_seekpos (this, pos, mode); } streampos sseekoff(streamoff, _seek_dir, int mode=ios::in|ios::out); streampos sseekpos(streampos pos, int mode = ios::in|ios::out); virtual streambuf* setbuf(char* p, int len); virtual int sync(); virtual int doallocate(); int seekmark(streammarker& mark, int delta = 0); int sputbackc(char c); int sungetc(); int unbuffered() { return _flags & 2 ? 1 : 0; } int linebuffered() { return _flags & 0x200 ? 1 : 0; } void unbuffered(int i) { if (i) _flags |= 2 ; else _flags &= ~2 ; } void linebuffered(int i) { if (i) _flags |= 0x200 ; else _flags &= ~0x200 ; } int allocate() { if (base() || unbuffered()) return 0; else return doallocate(); } void allocbuf() { if (base() == __null ) doallocbuf(); } void doallocbuf(); int in_avail() { return _IO_read_end - _IO_read_ptr; } int out_waiting() { return _IO_write_ptr - _IO_write_base; } streamsize sputn(const char* s, streamsize n) { return xsputn(s, n); } streamsize padn(char pad, streamsize n) { return _IO_padn(this, pad, n); } streamsize sgetn(char* s, streamsize n) { return _IO_sgetn(this, s, n); } int ignore(int); int get_column(); int set_column(int); long sgetline(char* buf, _G_size_t n, char delim, int putback_delim); int sputc(int c) { return _IO_putc(c, this); } int sbumpc() { return _IO_getc(this); } int sgetc() { return (( this )->_IO_read_ptr >= ( this )->_IO_read_end && __underflow ( this ) == (-1) ? (-1) : *(unsigned char *) ( this )->_IO_read_ptr) ; } int snextc() { if (_IO_read_ptr >= _IO_read_end && __underflow(this) == (-1) ) return (-1) ; else return _IO_read_ptr++, sgetc(); } void stossc() { if (_IO_read_ptr < _IO_read_end) _IO_read_ptr++; } int vscan(char const *fmt0, _G_va_list ap, ios* stream = __null ); int scan(char const *fmt0 ...); int vform(char const *fmt0, _G_va_list ap); int form(char const *fmt0 ...); virtual streamsize sys_read(char* buf, streamsize size); virtual streamsize sys_write(const char*, streamsize); virtual streampos sys_seek(streamoff, _seek_dir); virtual int sys_close(); virtual int sys_stat(void*); }; class filebuf : public streambuf { protected: void init(); public: static const int openprot; filebuf(); filebuf(int fd); filebuf(int fd, char* p, int len); ~filebuf(); filebuf* attach(int fd); filebuf* open(const char *filename, const char *mode); filebuf* open(const char *filename, ios::openmode mode, int prot = 0664); virtual int underflow(); virtual int overflow(int c = (-1) ); int is_open() const { return _fileno >= 0; } int fd() const { return is_open() ? _fileno : (-1) ; } filebuf* close(); virtual int doallocate(); virtual streampos seekoff(streamoff, _seek_dir, int mode=ios::in|ios::out); virtual streambuf* setbuf(char* p, int len); streamsize xsputn(const char* s, streamsize n); streamsize xsgetn(char* s, streamsize n); virtual int sync(); protected: int is_reading() { return eback() != egptr(); } char* cur_ptr() { return is_reading() ? gptr() : pptr(); } char* file_ptr() { return eGptr(); } virtual streamsize sys_read(char* buf, streamsize size); virtual streampos sys_seek(streamoff, _seek_dir); virtual streamsize sys_write(const char*, streamsize); virtual int sys_stat(void*); virtual int sys_close(); }; inline void ios::init(streambuf* sb, ostream* tie_to) { _state = sb ? ios::goodbit : ios::badbit; _exceptions=0; _strbuf=sb; _tie = tie_to; _width=0; _fill=' '; _flags=ios::skipws|ios::dec; _precision=6; _arrays = 0; } inline ios::ios(streambuf* sb, ostream* tie_to) { init(sb, tie_to); } inline ios::~ios() { operator delete[] (_arrays); } } # 31 "/usr/include/g++-3/iostream.h" 2 3 extern "C++" { class istream; class ostream; typedef ios& (*__manip)(ios&); typedef istream& (*__imanip)(istream&); typedef ostream& (*__omanip)(ostream&); extern istream& ws(istream& ins); extern ostream& flush(ostream& outs); extern ostream& endl(ostream& outs); extern ostream& ends(ostream& outs); class ostream : virtual public ios { void do_osfx(); public: ostream() { } ostream(streambuf* sb, ostream* tied= __null ); int opfx() { if (!good()) return 0; else { if (_tie) _tie->flush(); ; return 1;} } void osfx() { ; if (flags() & (ios::unitbuf|ios::stdio)) do_osfx(); } ostream& flush(); ostream& put(char c) { _strbuf->sputc(c); return *this; } ostream& write(const char *s, streamsize n); ostream& write(const unsigned char *s, streamsize n) { return write((const char*)s, n);} ostream& write(const signed char *s, streamsize n) { return write((const char*)s, n);} ostream& write(const void *s, streamsize n) { return write((const char*)s, n);} ostream& seekp(streampos); ostream& seekp(streamoff, _seek_dir); streampos tellp(); ostream& form(const char *format ...); ostream& vform(const char *format, _G_va_list args); ostream& operator<<(char c); ostream& operator<<(unsigned char c) { return (*this) << (char)c; } ostream& operator<<(signed char c) { return (*this) << (char)c; } ostream& operator<<(const char *s); ostream& operator<<(const unsigned char *s) { return (*this) << (const char*)s; } ostream& operator<<(const signed char *s) { return (*this) << (const char*)s; } ostream& operator<<(const void *p); ostream& operator<<(int n); ostream& operator<<(unsigned int n); ostream& operator<<(long n); ostream& operator<<(unsigned long n); __extension__ ostream& operator<<(long long n); __extension__ ostream& operator<<(unsigned long long n); ostream& operator<<(short n) {return operator<<((int)n);} ostream& operator<<(unsigned short n) {return operator<<((unsigned int)n);} ostream& operator<<(bool b) { return operator<<((int)b); } ostream& operator<<(double n); ostream& operator<<(float n) { return operator<<((double)n); } ostream& operator<<(long double n) { return operator<<((double)n); } ostream& operator<<(__omanip func) { return (*func)(*this); } ostream& operator<<(__manip func) {(*func)(*this); return *this;} ostream& operator<<(streambuf*); }; class istream : virtual public ios { protected: _G_size_t _gcount; int _skip_ws(); public: istream(): _gcount (0) { } istream(streambuf* sb, ostream*tied= __null ); istream& get(char* ptr, int len, char delim = '\n'); istream& get(unsigned char* ptr, int len, char delim = '\n') { return get((char*)ptr, len, delim); } istream& get(char& c); istream& get(unsigned char& c) { return get((char&)c); } istream& getline(char* ptr, int len, char delim = '\n'); istream& getline(unsigned char* ptr, int len, char delim = '\n') { return getline((char*)ptr, len, delim); } istream& get(signed char& c) { return get((char&)c); } istream& get(signed char* ptr, int len, char delim = '\n') { return get((char*)ptr, len, delim); } istream& getline(signed char* ptr, int len, char delim = '\n') { return getline((char*)ptr, len, delim); } istream& read(char *ptr, streamsize n); istream& read(unsigned char *ptr, streamsize n) { return read((char*)ptr, n); } istream& read(signed char *ptr, streamsize n) { return read((char*)ptr, n); } istream& read(void *ptr, streamsize n) { return read((char*)ptr, n); } istream& get(streambuf& sb, char delim = '\n'); istream& gets(char **s, char delim = '\n'); int ipfx(int need = 0) { if (!good()) { set(ios::failbit); return 0; } else { ; if (_tie && (need == 0 || rdbuf()->in_avail() < need)) _tie->flush(); if (!need && (flags() & ios::skipws)) return _skip_ws(); else return 1; } } int ipfx0() { if (!good()) { set(ios::failbit); return 0; } else { ; if (_tie) _tie->flush(); if (flags() & ios::skipws) return _skip_ws(); else return 1; } } int ipfx1() { if (!good()) { set(ios::failbit); return 0; } else { ; if (_tie && rdbuf()->in_avail() == 0) _tie->flush(); return 1; } } void isfx() { ; } int get() { if (!ipfx1()) return (-1) ; else { int ch = _strbuf->sbumpc(); if (ch == (-1) ) set(ios::eofbit); isfx(); return ch; } } int peek(); _G_size_t gcount() { return _gcount; } istream& ignore(int n=1, int delim = (-1) ); int sync (); istream& seekg(streampos); istream& seekg(streamoff, _seek_dir); streampos tellg(); istream& putback(char ch) { if (good() && _strbuf->sputbackc(ch) == (-1) ) clear(ios::badbit); return *this;} istream& unget() { if (good() && _strbuf->sungetc() == (-1) ) clear(ios::badbit); return *this;} istream& scan(const char *format ...); istream& vscan(const char *format, _G_va_list args); istream& operator>>(char*); istream& operator>>(unsigned char* p) { return operator>>((char*)p); } istream& operator>>(signed char*p) { return operator>>((char*)p); } istream& operator>>(char& c); istream& operator>>(unsigned char& c) {return operator>>((char&)c);} istream& operator>>(signed char& c) {return operator>>((char&)c);} istream& operator>>(int&); istream& operator>>(long&); __extension__ istream& operator>>(long long&); __extension__ istream& operator>>(unsigned long long&); istream& operator>>(short&); istream& operator>>(unsigned int&); istream& operator>>(unsigned long&); istream& operator>>(unsigned short&); istream& operator>>(bool&); istream& operator>>(float&); istream& operator>>(double&); istream& operator>>(long double&); istream& operator>>( __manip func) {(*func)(*this); return *this;} istream& operator>>(__imanip func) { return (*func)(*this); } istream& operator>>(streambuf*); }; class iostream : public istream, public ostream { public: iostream() { } iostream(streambuf* sb, ostream*tied= __null ); }; class _IO_istream_withassign : public istream { public: _IO_istream_withassign& operator=(istream&); _IO_istream_withassign& operator=(_IO_istream_withassign& rhs) { return operator= (static_cast (rhs)); } }; class _IO_ostream_withassign : public ostream { public: _IO_ostream_withassign& operator=(ostream&); _IO_ostream_withassign& operator=(_IO_ostream_withassign& rhs) { return operator= (static_cast (rhs)); } }; extern _IO_istream_withassign cin; extern _IO_ostream_withassign cout, cerr; extern _IO_ostream_withassign clog ; extern istream& lock(istream& ins); extern istream& unlock(istream& ins); extern ostream& lock(ostream& outs); extern ostream& unlock(ostream& outs); struct Iostream_init { } ; inline ios& dec(ios& i) { i.setf(ios::dec, ios::dec|ios::hex|ios::oct); return i; } inline ios& hex(ios& i) { i.setf(ios::hex, ios::dec|ios::hex|ios::oct); return i; } inline ios& oct(ios& i) { i.setf(ios::oct, ios::dec|ios::hex|ios::oct); return i; } } # 6 "/usr/include/g++-3/iostream" 2 3 # 33 "c_grammar.cpp" 2 # 1 "/usr/include/g++-3/fstream" 1 3 # 1 "/usr/include/g++-3/fstream.h" 1 3 #pragma interface extern "C++" { class fstreambase : virtual public ios { mutable filebuf __my_fb; void __fb_init (); public: fstreambase(); fstreambase(int fd); fstreambase(int fd, char *p, int l); fstreambase(const char *name, int mode, int prot=0664); void close(); filebuf* rdbuf() const { return &__my_fb; } void open(const char *name, int mode, int prot=0664); int is_open() const { return rdbuf()->is_open(); } void setbuf(char *ptr, int len) { rdbuf()->setbuf(ptr, len); } void attach(int fd); }; class ifstream : public fstreambase, public istream { public: ifstream() : fstreambase() { } ifstream(int fd) : fstreambase(fd) { } ifstream(int fd, char *p, int l) : fstreambase(fd, p, l) { } ifstream(const char *name, int mode=ios::in, int prot=0664) : fstreambase(name, mode | ios::in, prot) { } void open(const char *name, int mode=ios::in, int prot=0664) { fstreambase::open(name, mode | ios::in, prot); } }; class ofstream : public fstreambase, public ostream { public: ofstream() : fstreambase() { } ofstream(int fd) : fstreambase(fd) { } ofstream(int fd, char *p, int l) : fstreambase(fd, p, l) { } ofstream(const char *name, int mode=ios::out, int prot=0664) : fstreambase(name, mode | ios::out, prot) { } void open(const char *name, int mode=ios::out, int prot=0664) { fstreambase::open(name, mode | ios::out, prot); } }; class fstream : public fstreambase, public iostream { public: fstream() : fstreambase() { } fstream(int fd) : fstreambase(fd) { } fstream(const char *name, int mode, int prot=0664) : fstreambase(name, mode, prot) { } fstream(int fd, char *p, int l) : fstreambase(fd, p, l) { } void open(const char *name, int mode, int prot=0664) { fstreambase::open(name, mode, prot); } }; } # 6 "/usr/include/g++-3/fstream" 2 3 # 34 "c_grammar.cpp" 2 # 1 "/usr/include/g++-3/vector" 1 3 # 1 "/usr/include/g++-3/stl_algobase.h" 1 3 # 1 "/usr/include/g++-3/stl_config.h" 1 3 # 148 "/usr/include/g++-3/stl_config.h" 3 # 178 "/usr/include/g++-3/stl_config.h" 3 # 237 "/usr/include/g++-3/stl_config.h" 3 # 251 "/usr/include/g++-3/stl_config.h" 3 # 319 "/usr/include/g++-3/stl_config.h" 3 # 36 "/usr/include/g++-3/stl_algobase.h" 2 3 # 1 "/usr/include/g++-3/stl_relops.h" 1 3 template inline bool operator!=(const _Tp& __x, const _Tp& __y) { return !(__x == __y); } template inline bool operator>(const _Tp& __x, const _Tp& __y) { return __y < __x; } template inline bool operator<=(const _Tp& __x, const _Tp& __y) { return !(__y < __x); } template inline bool operator>=(const _Tp& __x, const _Tp& __y) { return !(__x < __y); } # 39 "/usr/include/g++-3/stl_algobase.h" 2 3 # 1 "/usr/include/g++-3/stl_pair.h" 1 3 template struct pair { typedef _T1 first_type; typedef _T2 second_type; _T1 first; _T2 second; pair() : first(_T1()), second(_T2()) {} pair(const _T1& __a, const _T2& __b) : first(__a), second(__b) {} template pair(const pair<_U1, _U2>& __p) : first(__p.first), second(__p.second) {} }; template inline bool operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) { return __x.first == __y.first && __x.second == __y.second; } template inline bool operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) { return __x.first < __y.first || (!(__y.first < __x.first) && __x.second < __y.second); } template inline pair<_T1, _T2> make_pair(const _T1& __x, const _T2& __y) { return pair<_T1, _T2>(__x, __y); } # 42 "/usr/include/g++-3/stl_algobase.h" 2 3 # 1 "/usr/include/g++-3/type_traits.h" 1 3 struct __true_type { }; struct __false_type { }; template struct __type_traits { typedef __true_type this_dummy_member_must_be_first; typedef __false_type has_trivial_default_constructor; typedef __false_type has_trivial_copy_constructor; typedef __false_type has_trivial_assignment_operator; typedef __false_type has_trivial_destructor; typedef __false_type is_POD_type; }; template<> struct __type_traits { typedef __true_type has_trivial_default_constructor; typedef __true_type has_trivial_copy_constructor; typedef __true_type has_trivial_assignment_operator; typedef __true_type has_trivial_destructor; typedef __true_type is_POD_type; }; template<> struct __type_traits { typedef __true_type has_trivial_default_constructor; typedef __true_type has_trivial_copy_constructor; typedef __true_type has_trivial_assignment_operator; typedef __true_type has_trivial_destructor; typedef __true_type is_POD_type; }; template<> struct __type_traits { typedef __true_type has_trivial_default_constructor; typedef __true_type has_trivial_copy_constructor; typedef __true_type has_trivial_assignment_operator; typedef __true_type has_trivial_destructor; typedef __true_type is_POD_type; }; template<> struct __type_traits { typedef __true_type has_trivial_default_constructor; typedef __true_type has_trivial_copy_constructor; typedef __true_type has_trivial_assignment_operator; typedef __true_type has_trivial_destructor; typedef __true_type is_POD_type; }; template<> struct __type_traits { typedef __true_type has_trivial_default_constructor; typedef __true_type has_trivial_copy_constructor; typedef __true_type has_trivial_assignment_operator; typedef __true_type has_trivial_destructor; typedef __true_type is_POD_type; }; template<> struct __type_traits { typedef __true_type has_trivial_default_constructor; typedef __true_type has_trivial_copy_constructor; typedef __true_type has_trivial_assignment_operator; typedef __true_type has_trivial_destructor; typedef __true_type is_POD_type; }; template<> struct __type_traits { typedef __true_type has_trivial_default_constructor; typedef __true_type has_trivial_copy_constructor; typedef __true_type has_trivial_assignment_operator; typedef __true_type has_trivial_destructor; typedef __true_type is_POD_type; }; template<> struct __type_traits { typedef __true_type has_trivial_default_constructor; typedef __true_type has_trivial_copy_constructor; typedef __true_type has_trivial_assignment_operator; typedef __true_type has_trivial_destructor; typedef __true_type is_POD_type; }; template<> struct __type_traits { typedef __true_type has_trivial_default_constructor; typedef __true_type has_trivial_copy_constructor; typedef __true_type has_trivial_assignment_operator; typedef __true_type has_trivial_destructor; typedef __true_type is_POD_type; }; template<> struct __type_traits { typedef __true_type has_trivial_default_constructor; typedef __true_type has_trivial_copy_constructor; typedef __true_type has_trivial_assignment_operator; typedef __true_type has_trivial_destructor; typedef __true_type is_POD_type; }; template<> struct __type_traits { typedef __true_type has_trivial_default_constructor; typedef __true_type has_trivial_copy_constructor; typedef __true_type has_trivial_assignment_operator; typedef __true_type has_trivial_destructor; typedef __true_type is_POD_type; }; template<> struct __type_traits { typedef __true_type has_trivial_default_constructor; typedef __true_type has_trivial_copy_constructor; typedef __true_type has_trivial_assignment_operator; typedef __true_type has_trivial_destructor; typedef __true_type is_POD_type; }; template<> struct __type_traits { typedef __true_type has_trivial_default_constructor; typedef __true_type has_trivial_copy_constructor; typedef __true_type has_trivial_assignment_operator; typedef __true_type has_trivial_destructor; typedef __true_type is_POD_type; }; template<> struct __type_traits { typedef __true_type has_trivial_default_constructor; typedef __true_type has_trivial_copy_constructor; typedef __true_type has_trivial_assignment_operator; typedef __true_type has_trivial_destructor; typedef __true_type is_POD_type; }; template<> struct __type_traits { typedef __true_type has_trivial_default_constructor; typedef __true_type has_trivial_copy_constructor; typedef __true_type has_trivial_assignment_operator; typedef __true_type has_trivial_destructor; typedef __true_type is_POD_type; }; template<> struct __type_traits { typedef __true_type has_trivial_default_constructor; typedef __true_type has_trivial_copy_constructor; typedef __true_type has_trivial_assignment_operator; typedef __true_type has_trivial_destructor; typedef __true_type is_POD_type; }; template struct __type_traits<_Tp*> { typedef __true_type has_trivial_default_constructor; typedef __true_type has_trivial_copy_constructor; typedef __true_type has_trivial_assignment_operator; typedef __true_type has_trivial_destructor; typedef __true_type is_POD_type; }; # 295 "/usr/include/g++-3/type_traits.h" 3 template struct _Is_integer { typedef __false_type _Integral; }; template<> struct _Is_integer { typedef __true_type _Integral; }; template<> struct _Is_integer { typedef __true_type _Integral; }; template<> struct _Is_integer { typedef __true_type _Integral; }; template<> struct _Is_integer { typedef __true_type _Integral; }; template<> struct _Is_integer { typedef __true_type _Integral; }; template<> struct _Is_integer { typedef __true_type _Integral; }; template<> struct _Is_integer { typedef __true_type _Integral; }; template<> struct _Is_integer { typedef __true_type _Integral; }; template<> struct _Is_integer { typedef __true_type _Integral; }; template<> struct _Is_integer { typedef __true_type _Integral; }; template<> struct _Is_integer { typedef __true_type _Integral; }; template<> struct _Is_integer { typedef __true_type _Integral; }; template<> struct _Is_integer { typedef __true_type _Integral; }; # 45 "/usr/include/g++-3/stl_algobase.h" 2 3 # 1 "/usr/include/string.h" 1 3 extern "C" { # 1 "/usr/include/_ansi.h" 1 3 # 1 "/usr/include/sys/config.h" 1 3 # 14 "/usr/include/sys/config.h" 3 # 25 "/usr/include/sys/config.h" 3 # 46 "/usr/include/sys/config.h" 3 # 126 "/usr/include/sys/config.h" 3 typedef int __int32_t; typedef unsigned int __uint32_t; # 15 "/usr/include/_ansi.h" 2 3 # 67 "/usr/include/_ansi.h" 3 # 14 "/usr/include/string.h" 2 3 # 1 "/usr/include/sys/reent.h" 1 3 extern "C" { # 1 "/usr/include/sys/_types.h" 1 3 typedef long _off_t; typedef long _ssize_t; # 14 "/usr/include/sys/reent.h" 2 3 typedef __uint32_t __ULong; struct _glue { struct _glue *_next; int _niobs; struct __sFILE *_iobs; }; struct _Bigint { struct _Bigint *_next; int _k, _maxwds, _sign, _wds; __ULong _x[1]; }; struct __tm { int __tm_sec; int __tm_min; int __tm_hour; int __tm_mday; int __tm_mon; int __tm_year; int __tm_wday; int __tm_yday; int __tm_isdst; }; struct _atexit { struct _atexit *_next; int _ind; void (*_fns[32 ])(void); }; struct __sbuf { unsigned char *_base; int _size; }; typedef long _fpos_t; struct __sFILE { unsigned char *_p; int _r; int _w; short _flags; short _file; struct __sbuf _bf; int _lbfsize; void * _cookie; _ssize_t __attribute__((__cdecl__)) (*_read) (void * _cookie, char *_buf, int _n) ; _ssize_t __attribute__((__cdecl__)) (*_write) (void * _cookie, const char *_buf, int _n) ; _fpos_t __attribute__((__cdecl__)) (*_seek) (void * _cookie, _fpos_t _offset, int _whence) ; int __attribute__((__cdecl__)) (*_close) (void * _cookie) ; struct __sbuf _ub; unsigned char *_up; int _ur; unsigned char _ubuf[3]; unsigned char _nbuf[1]; struct __sbuf _lb; int _blksize; int _offset; struct _reent *_data; }; struct _rand48 { unsigned short _seed[3]; unsigned short _mult[3]; unsigned short _add; }; struct _reent { int _errno; struct __sFILE *_stdin, *_stdout, *_stderr; int _inc; char _emergency[25]; int _current_category; const char *_current_locale; int __sdidinit; void __attribute__((__cdecl__)) (*__cleanup) (struct _reent *) ; struct _Bigint *_result; int _result_k; struct _Bigint *_p5s; struct _Bigint **_freelist; int _cvtlen; char *_cvtbuf; union { struct { unsigned int _unused_rand; char * _strtok_last; char _asctime_buf[26]; struct __tm _localtime_buf; int _gamma_signgam; __extension__ unsigned long long _rand_next; struct _rand48 _r48; } _reent; struct { unsigned char * _nextf[30 ]; unsigned int _nmalloc[30 ]; } _unused; } _new; struct _atexit *_atexit; struct _atexit _atexit0; void (**(_sig_func))(int); struct _glue __sglue; struct __sFILE __sf[3]; }; extern struct _reent *_impure_ptr ; void _reclaim_reent (struct _reent *) ; } # 15 "/usr/include/string.h" 2 3 # 1 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/stddef.h" 1 3 # 21 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/stddef.h" 3 # 63 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/stddef.h" 3 # 133 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/stddef.h" 3 typedef unsigned int size_t; # 273 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/stddef.h" 3 # 285 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/stddef.h" 3 # 319 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/stddef.h" 3 # 18 "/usr/include/string.h" 2 3 void * __attribute__((__cdecl__)) memchr (const void * , int, size_t) ; int __attribute__((__cdecl__)) memcmp (const void * , const void * , size_t) ; void * __attribute__((__cdecl__)) memcpy (void * , const void * , size_t) ; void * __attribute__((__cdecl__)) memmove (void * , const void * , size_t) ; void * __attribute__((__cdecl__)) memset (void * , int, size_t) ; char * __attribute__((__cdecl__)) strcat (char *, const char *) ; char * __attribute__((__cdecl__)) strchr (const char *, int) ; int __attribute__((__cdecl__)) strcmp (const char *, const char *) ; int __attribute__((__cdecl__)) strcoll (const char *, const char *) ; char * __attribute__((__cdecl__)) strcpy (char *, const char *) ; size_t __attribute__((__cdecl__)) strcspn (const char *, const char *) ; char * __attribute__((__cdecl__)) strerror (int) ; size_t __attribute__((__cdecl__)) strlen (const char *) ; char * __attribute__((__cdecl__)) strncat (char *, const char *, size_t) ; int __attribute__((__cdecl__)) strncmp (const char *, const char *, size_t) ; char * __attribute__((__cdecl__)) strncpy (char *, const char *, size_t) ; char * __attribute__((__cdecl__)) strpbrk (const char *, const char *) ; char * __attribute__((__cdecl__)) strrchr (const char *, int) ; size_t __attribute__((__cdecl__)) strspn (const char *, const char *) ; char * __attribute__((__cdecl__)) strstr (const char *, const char *) ; char * __attribute__((__cdecl__)) strtok (char *, const char *) ; size_t __attribute__((__cdecl__)) strxfrm (char *, const char *, size_t) ; char * __attribute__((__cdecl__)) strtok_r (char *, const char *, char **) ; int __attribute__((__cdecl__)) bcmp (const char *, const char *, size_t) ; void __attribute__((__cdecl__)) bcopy (const char *, char *, size_t) ; void __attribute__((__cdecl__)) bzero (char *, size_t) ; int __attribute__((__cdecl__)) ffs (int) ; char * __attribute__((__cdecl__)) index (const char *, int) ; void * __attribute__((__cdecl__)) memccpy (void * , const void * , int, size_t) ; char * __attribute__((__cdecl__)) rindex (const char *, int) ; int __attribute__((__cdecl__)) strcasecmp (const char *, const char *) ; char * __attribute__((__cdecl__)) strdup (const char *) ; char * __attribute__((__cdecl__)) _strdup_r (struct _reent *, const char *) ; int __attribute__((__cdecl__)) strncasecmp (const char *, const char *, size_t) ; char * __attribute__((__cdecl__)) strsep (char **, const char *) ; char * __attribute__((__cdecl__)) strlwr (char *) ; char * __attribute__((__cdecl__)) strupr (char *) ; const char * __attribute__((__cdecl__)) strsignal (int __signo) ; int __attribute__((__cdecl__)) strtosigno (const char *__name) ; } # 48 "/usr/include/g++-3/stl_algobase.h" 2 3 # 1 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/limits.h" 1 3 # 1 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/syslimits.h" 1 3 # 1 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/limits.h" 1 3 # 114 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/limits.h" 3 # 1 "/usr/include/limits.h" 1 3 # 117 "/usr/include/limits.h" 3 # 117 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/limits.h" 2 3 # 7 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/syslimits.h" 2 3 # 11 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/limits.h" 2 3 # 110 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/limits.h" 3 # 49 "/usr/include/g++-3/stl_algobase.h" 2 3 # 1 "/usr/include/stdlib.h" 1 3 extern "C" { # 1 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/stddef.h" 1 3 # 21 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/stddef.h" 3 # 63 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/stddef.h" 3 # 133 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/stddef.h" 3 # 190 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/stddef.h" 3 # 285 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/stddef.h" 3 # 319 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/stddef.h" 3 # 17 "/usr/include/stdlib.h" 2 3 # 1 "/usr/include/alloca.h" 1 3 # 22 "/usr/include/stdlib.h" 2 3 typedef struct { int quot; int rem; } div_t; typedef struct { long quot; long rem; } ldiv_t; extern __attribute__(( dllimport )) int __mb_cur_max; void __attribute__((__cdecl__)) abort (void ) __attribute__ ( (noreturn) ) ; int __attribute__((__cdecl__)) abs (int) ; int __attribute__((__cdecl__)) atexit (void (*__func)(void )) ; double __attribute__((__cdecl__)) atof (const char *__nptr) ; float __attribute__((__cdecl__)) atoff (const char *__nptr) ; int __attribute__((__cdecl__)) atoi (const char *__nptr) ; long __attribute__((__cdecl__)) atol (const char *__nptr) ; void * __attribute__((__cdecl__)) bsearch (const void * __key, const void * __base, size_t __nmemb, size_t __size, int (* __attribute__((__cdecl__)) _compar ) (const void * , const void * ) ) ; void * __attribute__((__cdecl__)) calloc (size_t __nmemb, size_t __size) ; div_t __attribute__((__cdecl__)) div (int __numer, int __denom) ; void __attribute__((__cdecl__)) exit (int __status) __attribute__ ( (noreturn) ) ; void __attribute__((__cdecl__)) free (void * ) ; char * __attribute__((__cdecl__)) getenv (const char *__string) ; char * __attribute__((__cdecl__)) _getenv_r (struct _reent *, const char *__string) ; char * __attribute__((__cdecl__)) _findenv (const char *, int *) ; char * __attribute__((__cdecl__)) _findenv_r (struct _reent *, const char *, int *) ; long __attribute__((__cdecl__)) labs (long) ; ldiv_t __attribute__((__cdecl__)) ldiv (long __numer, long __denom) ; void * __attribute__((__cdecl__)) malloc (size_t __size) ; int __attribute__((__cdecl__)) mblen (const char *, size_t) ; int __attribute__((__cdecl__)) _mblen_r (struct _reent *, const char *, size_t, int *) ; int __attribute__((__cdecl__)) mbtowc (wchar_t *, const char *, size_t) ; int __attribute__((__cdecl__)) _mbtowc_r (struct _reent *, wchar_t *, const char *, size_t, int *) ; int __attribute__((__cdecl__)) wctomb (char *, wchar_t) ; int __attribute__((__cdecl__)) _wctomb_r (struct _reent *, char *, wchar_t, int *) ; size_t __attribute__((__cdecl__)) mbstowcs (wchar_t *, const char *, size_t) ; size_t __attribute__((__cdecl__)) _mbstowcs_r (struct _reent *, wchar_t *, const char *, size_t, int *) ; size_t __attribute__((__cdecl__)) wcstombs (char *, const wchar_t *, size_t) ; size_t __attribute__((__cdecl__)) _wcstombs_r (struct _reent *, char *, const wchar_t *, size_t, int *) ; int __attribute__((__cdecl__)) mkstemp (char *) ; char * __attribute__((__cdecl__)) mktemp (char *) ; void __attribute__((__cdecl__)) qsort (void * __base, size_t __nmemb, size_t __size, int(*_compar)(const void * , const void * )) ; int __attribute__((__cdecl__)) rand (void ) ; void * __attribute__((__cdecl__)) realloc (void * __r, size_t __size) ; void __attribute__((__cdecl__)) srand (unsigned __seed) ; double __attribute__((__cdecl__)) strtod (const char *__n, char **__end_PTR) ; double __attribute__((__cdecl__)) _strtod_r (struct _reent *,const char *__n, char **__end_PTR) ; float __attribute__((__cdecl__)) strtodf (const char *__n, char **__end_PTR) ; long __attribute__((__cdecl__)) strtol (const char *__n, char **__end_PTR, int __base) ; long __attribute__((__cdecl__)) _strtol_r (struct _reent *,const char *__n, char **__end_PTR, int __base) ; unsigned long __attribute__((__cdecl__)) strtoul (const char *__n, char **__end_PTR, int __base) ; unsigned long __attribute__((__cdecl__)) _strtoul_r (struct _reent *,const char *__n, char **__end_PTR, int __base) ; int __attribute__((__cdecl__)) system (const char *__string) ; int __attribute__((__cdecl__)) putenv (const char *__string) ; int __attribute__((__cdecl__)) _putenv_r (struct _reent *, const char *__string) ; int __attribute__((__cdecl__)) setenv (const char *__string, const char *__value, int __overwrite) ; int __attribute__((__cdecl__)) _setenv_r (struct _reent *, const char *__string, const char *__value, int __overwrite) ; char * __attribute__((__cdecl__)) gcvt (double,int,char *) ; char * __attribute__((__cdecl__)) gcvtf (float,int,char *) ; char * __attribute__((__cdecl__)) fcvt (double,int,int *,int *) ; char * __attribute__((__cdecl__)) fcvtf (float,int,int *,int *) ; char * __attribute__((__cdecl__)) ecvt (double,int,int *,int *) ; char * __attribute__((__cdecl__)) ecvtbuf (double, int, int*, int*, char *) ; char * __attribute__((__cdecl__)) fcvtbuf (double, int, int*, int*, char *) ; char * __attribute__((__cdecl__)) ecvtf (float,int,int *,int *) ; char * __attribute__((__cdecl__)) dtoa (double, int, int, int *, int*, char**) ; int __attribute__((__cdecl__)) rand_r (unsigned *__seed) ; double __attribute__((__cdecl__)) drand48 (void ) ; double __attribute__((__cdecl__)) _drand48_r (struct _reent *) ; double __attribute__((__cdecl__)) erand48 (unsigned short [3]) ; double __attribute__((__cdecl__)) _erand48_r (struct _reent *, unsigned short [3]) ; long __attribute__((__cdecl__)) jrand48 (unsigned short [3]) ; long __attribute__((__cdecl__)) _jrand48_r (struct _reent *, unsigned short [3]) ; void __attribute__((__cdecl__)) lcong48 (unsigned short [7]) ; void __attribute__((__cdecl__)) _lcong48_r (struct _reent *, unsigned short [7]) ; long __attribute__((__cdecl__)) lrand48 (void ) ; long __attribute__((__cdecl__)) _lrand48_r (struct _reent *) ; long __attribute__((__cdecl__)) mrand48 (void ) ; long __attribute__((__cdecl__)) _mrand48_r (struct _reent *) ; long __attribute__((__cdecl__)) nrand48 (unsigned short [3]) ; long __attribute__((__cdecl__)) _nrand48_r (struct _reent *, unsigned short [3]) ; unsigned short * __attribute__((__cdecl__)) seed48 (unsigned short [3]) ; unsigned short * __attribute__((__cdecl__)) _seed48_r (struct _reent *, unsigned short [3]) ; void __attribute__((__cdecl__)) srand48 (long) ; void __attribute__((__cdecl__)) _srand48_r (struct _reent *, long) ; long long __attribute__((__cdecl__)) strtoll (const char *__n, char **__end_PTR, int __base) ; long long __attribute__((__cdecl__)) _strtoll_r (struct _reent *, const char *__n, char **__end_PTR, int __base) ; unsigned long long __attribute__((__cdecl__)) strtoull (const char *__n, char **__end_PTR, int __base) ; unsigned long long __attribute__((__cdecl__)) _strtoull_r (struct _reent *, const char *__n, char **__end_PTR, int __base) ; char * __attribute__((__cdecl__)) realpath (const char *, char *) ; void __attribute__((__cdecl__)) unsetenv (const char *__string) ; void __attribute__((__cdecl__)) _unsetenv_r (struct _reent *, const char *__string) ; int __attribute__((__cdecl__)) random (void ) ; long __attribute__((__cdecl__)) srandom (unsigned __seed) ; char * __attribute__((__cdecl__)) ptsname (int) ; int __attribute__((__cdecl__)) grantpt (int) ; int __attribute__((__cdecl__)) unlockpt (int) ; char * __attribute__((__cdecl__)) _dtoa_r (struct _reent *, double, int, int, int *, int*, char**) ; void * __attribute__((__cdecl__)) _malloc_r (struct _reent *, size_t) ; void * __attribute__((__cdecl__)) _calloc_r (struct _reent *, size_t, size_t) ; void __attribute__((__cdecl__)) _free_r (struct _reent *, void * ) ; void * __attribute__((__cdecl__)) _realloc_r (struct _reent *, void * , size_t) ; void __attribute__((__cdecl__)) _mstats_r (struct _reent *, char *) ; int __attribute__((__cdecl__)) _system_r (struct _reent *, const char *) ; void __attribute__((__cdecl__)) __eprintf (const char *, const char *, unsigned int, const char *) ; } # 50 "/usr/include/g++-3/stl_algobase.h" 2 3 # 1 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/stddef.h" 1 3 # 63 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/stddef.h" 3 typedef int ptrdiff_t; # 190 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/stddef.h" 3 # 271 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/stddef.h" 3 typedef unsigned int wint_t; # 319 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/stddef.h" 3 # 51 "/usr/include/g++-3/stl_algobase.h" 2 3 # 1 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/new.h" 1 3 # 1 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/new" 1 3 #pragma interface "new" # 1 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/stddef.h" 1 3 # 345 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/stddef.h" 3 # 8 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/new" 2 3 # 1 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/exception" 1 3 #pragma interface "exception" extern "C++" { namespace std { class exception { public: exception () { } virtual ~exception () { } virtual const char* what () const; }; class bad_exception : public exception { public: bad_exception () { } virtual ~bad_exception () { } }; typedef void (*terminate_handler) (); typedef void (*unexpected_handler) (); terminate_handler set_terminate (terminate_handler); void terminate () __attribute__ ((__noreturn__)); unexpected_handler set_unexpected (unexpected_handler); void unexpected () __attribute__ ((__noreturn__)); bool uncaught_exception (); } } # 9 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/new" 2 3 extern "C++" { namespace std { class bad_alloc : public exception { public: virtual const char* what() const throw() { return "bad_alloc"; } }; struct nothrow_t {}; extern const nothrow_t nothrow; typedef void (*new_handler)(); new_handler set_new_handler (new_handler); } void *operator new (size_t) throw (std::bad_alloc); void *operator new[] (size_t) throw (std::bad_alloc); void operator delete (void *) throw(); void operator delete[] (void *) throw(); void *operator new (size_t, const std::nothrow_t&) throw(); void *operator new[] (size_t, const std::nothrow_t&) throw(); void operator delete (void *, const std::nothrow_t&) throw(); void operator delete[] (void *, const std::nothrow_t&) throw(); inline void *operator new(size_t, void *place) throw() { return place; } inline void *operator new[](size_t, void *place) throw() { return place; } } # 6 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/new.h" 2 3 using std::new_handler; using std::set_new_handler; # 52 "/usr/include/g++-3/stl_algobase.h" 2 3 # 1 "/usr/include/g++-3/stl_iterator.h" 1 3 struct input_iterator_tag {}; struct output_iterator_tag {}; struct forward_iterator_tag : public input_iterator_tag {}; struct bidirectional_iterator_tag : public forward_iterator_tag {}; struct random_access_iterator_tag : public bidirectional_iterator_tag {}; template struct input_iterator { typedef input_iterator_tag iterator_category; typedef _Tp value_type; typedef _Distance difference_type; typedef _Tp* pointer; typedef _Tp& reference; }; struct output_iterator { typedef output_iterator_tag iterator_category; typedef void value_type; typedef void difference_type; typedef void pointer; typedef void reference; }; template struct forward_iterator { typedef forward_iterator_tag iterator_category; typedef _Tp value_type; typedef _Distance difference_type; typedef _Tp* pointer; typedef _Tp& reference; }; template struct bidirectional_iterator { typedef bidirectional_iterator_tag iterator_category; typedef _Tp value_type; typedef _Distance difference_type; typedef _Tp* pointer; typedef _Tp& reference; }; template struct random_access_iterator { typedef random_access_iterator_tag iterator_category; typedef _Tp value_type; typedef _Distance difference_type; typedef _Tp* pointer; typedef _Tp& reference; }; # 98 "/usr/include/g++-3/stl_iterator.h" 3 template struct iterator_traits { typedef typename _Iterator::iterator_category iterator_category; typedef typename _Iterator::value_type value_type; typedef typename _Iterator::difference_type difference_type; typedef typename _Iterator::pointer pointer; typedef typename _Iterator::reference reference; }; template struct iterator_traits<_Tp*> { typedef random_access_iterator_tag iterator_category; typedef _Tp value_type; typedef ptrdiff_t difference_type; typedef _Tp* pointer; typedef _Tp& reference; }; template struct iterator_traits { typedef random_access_iterator_tag iterator_category; typedef _Tp value_type; typedef ptrdiff_t difference_type; typedef const _Tp* pointer; typedef const _Tp& reference; }; template inline typename iterator_traits<_Iter>::iterator_category __iterator_category(const _Iter&) { typedef typename iterator_traits<_Iter>::iterator_category _Category; return _Category(); } template inline typename iterator_traits<_Iter>::difference_type* __distance_type(const _Iter&) { return static_cast::difference_type*>(0); } template inline typename iterator_traits<_Iter>::value_type* __value_type(const _Iter&) { return static_cast::value_type*>(0); } template inline typename iterator_traits<_Iter>::iterator_category iterator_category(const _Iter& __i) { return __iterator_category(__i); } template inline typename iterator_traits<_Iter>::difference_type* distance_type(const _Iter& __i) { return __distance_type(__i); } template inline typename iterator_traits<_Iter>::value_type* value_type(const _Iter& __i) { return __value_type(__i); } # 259 "/usr/include/g++-3/stl_iterator.h" 3 template inline void __distance(_InputIterator __first, _InputIterator __last, _Distance& __n, input_iterator_tag) { while (__first != __last) { ++__first; ++__n; } } template inline void __distance(_RandomAccessIterator __first, _RandomAccessIterator __last, _Distance& __n, random_access_iterator_tag) { __n += __last - __first; } template inline void distance(_InputIterator __first, _InputIterator __last, _Distance& __n) { __distance(__first, __last, __n, iterator_category(__first)); } template inline typename iterator_traits<_InputIterator>::difference_type __distance(_InputIterator __first, _InputIterator __last, input_iterator_tag) { typename iterator_traits<_InputIterator>::difference_type __n = 0; while (__first != __last) { ++__first; ++__n; } return __n; } template inline typename iterator_traits<_RandomAccessIterator>::difference_type __distance(_RandomAccessIterator __first, _RandomAccessIterator __last, random_access_iterator_tag) { return __last - __first; } template inline typename iterator_traits<_InputIterator>::difference_type distance(_InputIterator __first, _InputIterator __last) { typedef typename iterator_traits<_InputIterator>::iterator_category _Category; return __distance(__first, __last, _Category()); } template inline void __advance(_InputIter& __i, _Distance __n, input_iterator_tag) { while (__n--) ++__i; } template inline void __advance(_BidirectionalIterator& __i, _Distance __n, bidirectional_iterator_tag) { if (__n >= 0) while (__n--) ++__i; else while (__n++) --__i; } template inline void __advance(_RandomAccessIterator& __i, _Distance __n, random_access_iterator_tag) { __i += __n; } template inline void advance(_InputIterator& __i, _Distance __n) { __advance(__i, __n, iterator_category(__i)); } template class back_insert_iterator { protected: _Container* container; public: typedef _Container container_type; typedef output_iterator_tag iterator_category; typedef void value_type; typedef void difference_type; typedef void pointer; typedef void reference; explicit back_insert_iterator(_Container& __x) : container(&__x) {} back_insert_iterator<_Container>& operator=(const typename _Container::value_type& __value) { container->push_back(__value); return *this; } back_insert_iterator<_Container>& operator*() { return *this; } back_insert_iterator<_Container>& operator++() { return *this; } back_insert_iterator<_Container>& operator++(int) { return *this; } }; # 378 "/usr/include/g++-3/stl_iterator.h" 3 template inline back_insert_iterator<_Container> back_inserter(_Container& __x) { return back_insert_iterator<_Container>(__x); } template class front_insert_iterator { protected: _Container* container; public: typedef _Container container_type; typedef output_iterator_tag iterator_category; typedef void value_type; typedef void difference_type; typedef void pointer; typedef void reference; explicit front_insert_iterator(_Container& __x) : container(&__x) {} front_insert_iterator<_Container>& operator=(const typename _Container::value_type& __value) { container->push_front(__value); return *this; } front_insert_iterator<_Container>& operator*() { return *this; } front_insert_iterator<_Container>& operator++() { return *this; } front_insert_iterator<_Container>& operator++(int) { return *this; } }; # 417 "/usr/include/g++-3/stl_iterator.h" 3 template inline front_insert_iterator<_Container> front_inserter(_Container& __x) { return front_insert_iterator<_Container>(__x); } template class insert_iterator { protected: _Container* container; typename _Container::iterator iter; public: typedef _Container container_type; typedef output_iterator_tag iterator_category; typedef void value_type; typedef void difference_type; typedef void pointer; typedef void reference; insert_iterator(_Container& __x, typename _Container::iterator __i) : container(&__x), iter(__i) {} insert_iterator<_Container>& operator=(const typename _Container::value_type& __value) { iter = container->insert(iter, __value); ++iter; return *this; } insert_iterator<_Container>& operator*() { return *this; } insert_iterator<_Container>& operator++() { return *this; } insert_iterator<_Container>& operator++(int) { return *this; } }; # 459 "/usr/include/g++-3/stl_iterator.h" 3 template inline insert_iterator<_Container> inserter(_Container& __x, _Iterator __i) { typedef typename _Container::iterator __iter; return insert_iterator<_Container>(__x, __iter(__i)); } template class reverse_bidirectional_iterator { typedef reverse_bidirectional_iterator<_BidirectionalIterator, _Tp, _Reference, _Distance> _Self; protected: _BidirectionalIterator current; public: typedef bidirectional_iterator_tag iterator_category; typedef _Tp value_type; typedef _Distance difference_type; typedef _Tp* pointer; typedef _Reference reference; reverse_bidirectional_iterator() {} explicit reverse_bidirectional_iterator(_BidirectionalIterator __x) : current(__x) {} _BidirectionalIterator base() const { return current; } _Reference operator*() const { _BidirectionalIterator __tmp = current; return *--__tmp; } pointer operator->() const { return &(operator*()); } _Self& operator++() { --current; return *this; } _Self operator++(int) { _Self __tmp = *this; --current; return __tmp; } _Self& operator--() { ++current; return *this; } _Self operator--(int) { _Self __tmp = *this; ++current; return __tmp; } }; # 550 "/usr/include/g++-3/stl_iterator.h" 3 template inline bool operator==( const reverse_bidirectional_iterator<_BiIter, _Tp, _Ref, _Distance>& __x, const reverse_bidirectional_iterator<_BiIter, _Tp, _Ref, _Distance>& __y) { return __x.base() == __y.base(); } template class reverse_iterator { protected: _Iterator current; public: typedef typename iterator_traits<_Iterator>::iterator_category iterator_category; typedef typename iterator_traits<_Iterator>::value_type value_type; typedef typename iterator_traits<_Iterator>::difference_type difference_type; typedef typename iterator_traits<_Iterator>::pointer pointer; typedef typename iterator_traits<_Iterator>::reference reference; typedef _Iterator iterator_type; typedef reverse_iterator<_Iterator> _Self; public: reverse_iterator() {} explicit reverse_iterator(iterator_type __x) : current(__x) {} reverse_iterator(const _Self& __x) : current(__x.current) {} template reverse_iterator(const reverse_iterator<_Iter>& __x) : current(__x.base()) {} iterator_type base() const { return current; } reference operator*() const { _Iterator __tmp = current; return *--__tmp; } pointer operator->() const { return &(operator*()); } _Self& operator++() { --current; return *this; } _Self operator++(int) { _Self __tmp = *this; --current; return __tmp; } _Self& operator--() { ++current; return *this; } _Self operator--(int) { _Self __tmp = *this; ++current; return __tmp; } _Self operator+(difference_type __n) const { return _Self(current - __n); } _Self& operator+=(difference_type __n) { current -= __n; return *this; } _Self operator-(difference_type __n) const { return _Self(current + __n); } _Self& operator-=(difference_type __n) { current += __n; return *this; } reference operator[](difference_type __n) const { return *(*this + __n); } }; template inline bool operator==(const reverse_iterator<_Iterator>& __x, const reverse_iterator<_Iterator>& __y) { return __x.base() == __y.base(); } template inline bool operator<(const reverse_iterator<_Iterator>& __x, const reverse_iterator<_Iterator>& __y) { return __y.base() < __x.base(); } template inline typename reverse_iterator<_Iterator>::difference_type operator-(const reverse_iterator<_Iterator>& __x, const reverse_iterator<_Iterator>& __y) { return __y.base() - __x.base(); } template inline reverse_iterator<_Iterator> operator+(typename reverse_iterator<_Iterator>::difference_type __n, const reverse_iterator<_Iterator>& __x) { return reverse_iterator<_Iterator>(__x.base() - __n); } # 805 "/usr/include/g++-3/stl_iterator.h" 3 template class istream_iterator { friend bool operator== <> (const istream_iterator&, const istream_iterator&); protected: istream* _M_stream; _Tp _M_value; bool _M_end_marker; void _M_read() { _M_end_marker = (*_M_stream) ? true : false; if (_M_end_marker) *_M_stream >> _M_value; _M_end_marker = (*_M_stream) ? true : false; } public: typedef input_iterator_tag iterator_category; typedef _Tp value_type; typedef _Dist difference_type; typedef const _Tp* pointer; typedef const _Tp& reference; istream_iterator() : _M_stream(&cin), _M_end_marker(false) {} istream_iterator(istream& __s) : _M_stream(&__s) { _M_read(); } reference operator*() const { return _M_value; } pointer operator->() const { return &(operator*()); } istream_iterator<_Tp, _Dist>& operator++() { _M_read(); return *this; } istream_iterator<_Tp, _Dist> operator++(int) { istream_iterator<_Tp, _Dist> __tmp = *this; _M_read(); return __tmp; } }; # 864 "/usr/include/g++-3/stl_iterator.h" 3 template inline bool operator==(const istream_iterator<_Tp, _Distance>& __x, const istream_iterator<_Tp, _Distance>& __y) { return (__x._M_stream == __y._M_stream && __x._M_end_marker == __y._M_end_marker) || __x._M_end_marker == false && __y._M_end_marker == false; } template class ostream_iterator { protected: ostream* _M_stream; const char* _M_string; public: typedef output_iterator_tag iterator_category; typedef void value_type; typedef void difference_type; typedef void pointer; typedef void reference; ostream_iterator(ostream& __s) : _M_stream(&__s), _M_string(0) {} ostream_iterator(ostream& __s, const char* __c) : _M_stream(&__s), _M_string(__c) {} ostream_iterator<_Tp>& operator=(const _Tp& __value) { *_M_stream << __value; if (_M_string) *_M_stream << _M_string; return *this; } ostream_iterator<_Tp>& operator*() { return *this; } ostream_iterator<_Tp>& operator++() { return *this; } ostream_iterator<_Tp>& operator++(int) { return *this; } }; # 907 "/usr/include/g++-3/stl_iterator.h" 3 # 56 "/usr/include/g++-3/stl_algobase.h" 2 3 template inline void __iter_swap(_ForwardIter1 __a, _ForwardIter2 __b, _Tp*) { _Tp __tmp = *__a; *__a = *__b; *__b = __tmp; } template inline void iter_swap(_ForwardIter1 __a, _ForwardIter2 __b) { __iter_swap(__a, __b, __value_type( __a ) ); } template inline void swap(_Tp& __a, _Tp& __b) { _Tp __tmp = __a; __a = __b; __b = __tmp; } template inline const _Tp& min(const _Tp& __a, const _Tp& __b) { return __b < __a ? __b : __a; } template inline const _Tp& max(const _Tp& __a, const _Tp& __b) { return __a < __b ? __b : __a; } template inline const _Tp& min(const _Tp& __a, const _Tp& __b, _Compare __comp) { return __comp(__b, __a) ? __b : __a; } template inline const _Tp& max(const _Tp& __a, const _Tp& __b, _Compare __comp) { return __comp(__a, __b) ? __b : __a; } template inline _OutputIter __copy(_InputIter __first, _InputIter __last, _OutputIter __result, input_iterator_tag, _Distance*) { for ( ; __first != __last; ++__result, ++__first) *__result = *__first; return __result; } template inline _OutputIter __copy(_RandomAccessIter __first, _RandomAccessIter __last, _OutputIter __result, random_access_iterator_tag, _Distance*) { for (_Distance __n = __last - __first; __n > 0; --__n) { *__result = *__first; ++__first; ++__result; } return __result; } template inline _Tp* __copy_trivial(const _Tp* __first, const _Tp* __last, _Tp* __result) { memmove(__result, __first, sizeof(_Tp) * (__last - __first)); return __result + (__last - __first); } template struct __copy_dispatch { static _OutputIter copy(_InputIter __first, _InputIter __last, _OutputIter __result) { typedef typename iterator_traits<_InputIter>::iterator_category _Category; typedef typename iterator_traits<_InputIter>::difference_type _Distance; return __copy(__first, __last, __result, _Category(), (_Distance*) 0); } }; template struct __copy_dispatch<_Tp*, _Tp*, __true_type> { static _Tp* copy(const _Tp* __first, const _Tp* __last, _Tp* __result) { return __copy_trivial(__first, __last, __result); } }; template struct __copy_dispatch { static _Tp* copy(const _Tp* __first, const _Tp* __last, _Tp* __result) { return __copy_trivial(__first, __last, __result); } }; template inline _OutputIter copy(_InputIter __first, _InputIter __last, _OutputIter __result) { typedef typename iterator_traits<_InputIter>::value_type _Tp; typedef typename __type_traits<_Tp>::has_trivial_assignment_operator _Trivial; return __copy_dispatch<_InputIter, _OutputIter, _Trivial> ::copy(__first, __last, __result); } # 213 "/usr/include/g++-3/stl_algobase.h" 3 template inline _BidirectionalIter2 __copy_backward(_BidirectionalIter1 __first, _BidirectionalIter1 __last, _BidirectionalIter2 __result, bidirectional_iterator_tag, _Distance*) { while (__first != __last) *--__result = *--__last; return __result; } template inline _BidirectionalIter __copy_backward(_RandomAccessIter __first, _RandomAccessIter __last, _BidirectionalIter __result, random_access_iterator_tag, _Distance*) { for (_Distance __n = __last - __first; __n > 0; --__n) *--__result = *--__last; return __result; } template struct __copy_backward_dispatch { typedef typename iterator_traits<_BidirectionalIter1>::iterator_category _Cat; typedef typename iterator_traits<_BidirectionalIter1>::difference_type _Distance; static _BidirectionalIter2 copy(_BidirectionalIter1 __first, _BidirectionalIter1 __last, _BidirectionalIter2 __result) { return __copy_backward(__first, __last, __result, _Cat(), (_Distance*) 0); } }; template struct __copy_backward_dispatch<_Tp*, _Tp*, __true_type> { static _Tp* copy(const _Tp* __first, const _Tp* __last, _Tp* __result) { const ptrdiff_t _Num = __last - __first; memmove(__result - _Num, __first, sizeof(_Tp) * _Num); return __result - _Num; } }; template struct __copy_backward_dispatch { static _Tp* copy(const _Tp* __first, const _Tp* __last, _Tp* __result) { return __copy_backward_dispatch<_Tp*, _Tp*, __true_type> ::copy(__first, __last, __result); } }; template inline _BI2 copy_backward(_BI1 __first, _BI1 __last, _BI2 __result) { typedef typename __type_traits::value_type> ::has_trivial_assignment_operator _Trivial; return __copy_backward_dispatch<_BI1, _BI2, _Trivial> ::copy(__first, __last, __result); } # 303 "/usr/include/g++-3/stl_algobase.h" 3 template pair<_InputIter, _OutputIter> __copy_n(_InputIter __first, _Size __count, _OutputIter __result, input_iterator_tag) { for ( ; __count > 0; --__count) { *__result = *__first; ++__first; ++__result; } return pair<_InputIter, _OutputIter>(__first, __result); } template inline pair<_RAIter, _OutputIter> __copy_n(_RAIter __first, _Size __count, _OutputIter __result, random_access_iterator_tag) { _RAIter __last = __first + __count; return pair<_RAIter, _OutputIter>(__last, copy(__first, __last, __result)); } template inline pair<_InputIter, _OutputIter> __copy_n(_InputIter __first, _Size __count, _OutputIter __result) { return __copy_n(__first, __count, __result, __iterator_category( __first ) ); } template inline pair<_InputIter, _OutputIter> copy_n(_InputIter __first, _Size __count, _OutputIter __result) { return __copy_n(__first, __count, __result); } template void fill(_ForwardIter __first, _ForwardIter __last, const _Tp& __value) { for ( ; __first != __last; ++__first) *__first = __value; } template _OutputIter fill_n(_OutputIter __first, _Size __n, const _Tp& __value) { for ( ; __n > 0; --__n, ++__first) *__first = __value; return __first; } template pair<_InputIter1, _InputIter2> mismatch(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2) { while (__first1 != __last1 && *__first1 == *__first2) { ++__first1; ++__first2; } return pair<_InputIter1, _InputIter2>(__first1, __first2); } template pair<_InputIter1, _InputIter2> mismatch(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _BinaryPredicate __binary_pred) { while (__first1 != __last1 && __binary_pred(*__first1, *__first2)) { ++__first1; ++__first2; } return pair<_InputIter1, _InputIter2>(__first1, __first2); } template inline bool equal(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2) { for ( ; __first1 != __last1; ++__first1, ++__first2) if (*__first1 != *__first2) return false; return true; } template inline bool equal(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _BinaryPredicate __binary_pred) { for ( ; __first1 != __last1; ++__first1, ++__first2) if (!__binary_pred(*__first1, *__first2)) return false; return true; } template bool lexicographical_compare(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2) { for ( ; __first1 != __last1 && __first2 != __last2 ; ++__first1, ++__first2) { if (*__first1 < *__first2) return true; if (*__first2 < *__first1) return false; } return __first1 == __last1 && __first2 != __last2; } template bool lexicographical_compare(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _Compare __comp) { for ( ; __first1 != __last1 && __first2 != __last2 ; ++__first1, ++__first2) { if (__comp(*__first1, *__first2)) return true; if (__comp(*__first2, *__first1)) return false; } return __first1 == __last1 && __first2 != __last2; } inline bool lexicographical_compare(const unsigned char* __first1, const unsigned char* __last1, const unsigned char* __first2, const unsigned char* __last2) { const size_t __len1 = __last1 - __first1; const size_t __len2 = __last2 - __first2; const int __result = memcmp(__first1, __first2, min(__len1, __len2)); return __result != 0 ? __result < 0 : __len1 < __len2; } inline bool lexicographical_compare(const char* __first1, const char* __last1, const char* __first2, const char* __last2) { return lexicographical_compare((const signed char*) __first1, (const signed char*) __last1, (const signed char*) __first2, (const signed char*) __last2); } template int __lexicographical_compare_3way(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2) { while (__first1 != __last1 && __first2 != __last2) { if (*__first1 < *__first2) return -1; if (*__first2 < *__first1) return 1; ++__first1; ++__first2; } if (__first2 == __last2) { return !(__first1 == __last1); } else { return -1; } } inline int __lexicographical_compare_3way(const unsigned char* __first1, const unsigned char* __last1, const unsigned char* __first2, const unsigned char* __last2) { const ptrdiff_t __len1 = __last1 - __first1; const ptrdiff_t __len2 = __last2 - __first2; const int __result = memcmp(__first1, __first2, min(__len1, __len2)); return __result != 0 ? __result : (__len1 == __len2 ? 0 : (__len1 < __len2 ? -1 : 1)); } inline int __lexicographical_compare_3way(const char* __first1, const char* __last1, const char* __first2, const char* __last2) { return __lexicographical_compare_3way( (const signed char*) __first1, (const signed char*) __last1, (const signed char*) __first2, (const signed char*) __last2); } template int lexicographical_compare_3way(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2) { return __lexicographical_compare_3way(__first1, __last1, __first2, __last2); } # 30 "/usr/include/g++-3/vector" 2 3 # 1 "/usr/include/g++-3/stl_alloc.h" 1 3 # 1 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/stddef.h" 1 3 # 345 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/stddef.h" 3 # 53 "/usr/include/g++-3/stl_alloc.h" 2 3 # 1 "/usr/include/assert.h" 1 3 extern "C" { void __attribute__((__cdecl__)) __assert (const char *, int, const char *) ; } # 56 "/usr/include/g++-3/stl_alloc.h" 2 3 # 78 "/usr/include/g++-3/stl_alloc.h" 3 # 87 "/usr/include/g++-3/stl_alloc.h" 3 # 97 "/usr/include/g++-3/stl_alloc.h" 3 # 115 "/usr/include/g++-3/stl_alloc.h" 3 template class __malloc_alloc_template { private: static void* _S_oom_malloc(size_t); static void* _S_oom_realloc(void*, size_t); static void (* __malloc_alloc_oom_handler)(); public: static void* allocate(size_t __n) { void* __result = malloc(__n); if (0 == __result) __result = _S_oom_malloc(__n); return __result; } static void deallocate(void* __p, size_t ) { free(__p); } static void* reallocate(void* __p, size_t , size_t __new_sz) { void* __result = realloc(__p, __new_sz); if (0 == __result) __result = _S_oom_realloc(__p, __new_sz); return __result; } static void (* __set_malloc_handler(void (*__f)()))() { void (* __old)() = __malloc_alloc_oom_handler; __malloc_alloc_oom_handler = __f; return(__old); } }; template void (* __malloc_alloc_template<__inst>::__malloc_alloc_oom_handler)() = 0; template void* __malloc_alloc_template<__inst>::_S_oom_malloc(size_t __n) { void (* __my_malloc_handler)(); void* __result; for (;;) { __my_malloc_handler = __malloc_alloc_oom_handler; if (0 == __my_malloc_handler) { cerr << "out of memory" << endl; exit(1) ; } (*__my_malloc_handler)(); __result = malloc(__n); if (__result) return(__result); } } template void* __malloc_alloc_template<__inst>::_S_oom_realloc(void* __p, size_t __n) { void (* __my_malloc_handler)(); void* __result; for (;;) { __my_malloc_handler = __malloc_alloc_oom_handler; if (0 == __my_malloc_handler) { cerr << "out of memory" << endl; exit(1) ; } (*__my_malloc_handler)(); __result = realloc(__p, __n); if (__result) return(__result); } } typedef __malloc_alloc_template<0> malloc_alloc; template class simple_alloc { public: static _Tp* allocate(size_t __n) { return 0 == __n ? 0 : (_Tp*) _Alloc::allocate(__n * sizeof (_Tp)); } static _Tp* allocate(void) { return (_Tp*) _Alloc::allocate(sizeof (_Tp)); } static void deallocate(_Tp* __p, size_t __n) { if (0 != __n) _Alloc::deallocate(__p, __n * sizeof (_Tp)); } static void deallocate(_Tp* __p) { _Alloc::deallocate(__p, sizeof (_Tp)); } }; template class debug_alloc { private: enum {_S_extra = 8}; public: static void* allocate(size_t __n) { char* __result = (char*)_Alloc::allocate(__n + _S_extra); *(size_t*)__result = __n; return __result + _S_extra; } static void deallocate(void* __p, size_t __n) { char* __real_p = (char*)__p - _S_extra; (( *(size_t*)__real_p == __n ) ? (void)0 : __assert("/usr/include/g++-3/stl_alloc.h", 263, "*(size_t*)__real_p == __n")) ; _Alloc::deallocate(__real_p, __n + _S_extra); } static void* reallocate(void* __p, size_t __old_sz, size_t __new_sz) { char* __real_p = (char*)__p - _S_extra; (( *(size_t*)__real_p == __old_sz ) ? (void)0 : __assert("/usr/include/g++-3/stl_alloc.h", 270, "*(size_t*)__real_p == __old_sz")) ; char* __result = (char*) _Alloc::reallocate(__real_p, __old_sz + _S_extra, __new_sz + _S_extra); *(size_t*)__result = __new_sz; return __result + _S_extra; } }; template class __default_alloc_template { private: enum {_ALIGN = 8}; enum {_MAX_BYTES = 128}; enum {_NFREELISTS = _MAX_BYTES/_ALIGN}; static size_t _S_round_up(size_t __bytes) { return (((__bytes) + _ALIGN-1) & ~(_ALIGN - 1)); } private : union _Obj { union _Obj* _M_free_list_link; char _M_client_data[1]; }; private: static _Obj* _S_free_list[_NFREELISTS]; static size_t _S_freelist_index(size_t __bytes) { return (((__bytes) + _ALIGN-1)/_ALIGN - 1); } static void* _S_refill(size_t __n); static char* _S_chunk_alloc(size_t __size, int& __nobjs); static char* _S_start_free; static char* _S_end_free; static size_t _S_heap_size; # 389 "/usr/include/g++-3/stl_alloc.h" 3 class _Lock { public: _Lock() { ; } ~_Lock() { ; } }; friend class _Lock; public: static void* allocate(size_t __n) { _Obj* * __my_free_list; _Obj* __result; if (__n > (size_t) _MAX_BYTES) { return(malloc_alloc::allocate(__n)); } __my_free_list = _S_free_list + _S_freelist_index(__n); __result = *__my_free_list; if (__result == 0) { void* __r = _S_refill(_S_round_up(__n)); return __r; } *__my_free_list = __result -> _M_free_list_link; return (__result); }; static void deallocate(void* __p, size_t __n) { _Obj* __q = (_Obj*)__p; _Obj* * __my_free_list; if (__n > (size_t) _MAX_BYTES) { malloc_alloc::deallocate(__p, __n); return; } __my_free_list = _S_free_list + _S_freelist_index(__n); __q -> _M_free_list_link = *__my_free_list; *__my_free_list = __q; } static void* reallocate(void* __p, size_t __old_sz, size_t __new_sz); } ; typedef __default_alloc_template< false , 0> alloc; typedef __default_alloc_template single_client_alloc; template char* __default_alloc_template<__threads, __inst>::_S_chunk_alloc(size_t __size, int& __nobjs) { char* __result; size_t __total_bytes = __size * __nobjs; size_t __bytes_left = _S_end_free - _S_start_free; if (__bytes_left >= __total_bytes) { __result = _S_start_free; _S_start_free += __total_bytes; return(__result); } else if (__bytes_left >= __size) { __nobjs = (int)(__bytes_left/__size); __total_bytes = __size * __nobjs; __result = _S_start_free; _S_start_free += __total_bytes; return(__result); } else { size_t __bytes_to_get = 2 * __total_bytes + _S_round_up(_S_heap_size >> 4); if (__bytes_left > 0) { _Obj* * __my_free_list = _S_free_list + _S_freelist_index(__bytes_left); ((_Obj*)_S_start_free) -> _M_free_list_link = *__my_free_list; *__my_free_list = (_Obj*)_S_start_free; } _S_start_free = (char*)malloc(__bytes_to_get); if (0 == _S_start_free) { size_t __i; _Obj* * __my_free_list; _Obj* __p; for (__i = __size; __i <= _MAX_BYTES; __i += _ALIGN) { __my_free_list = _S_free_list + _S_freelist_index(__i); __p = *__my_free_list; if (0 != __p) { *__my_free_list = __p -> _M_free_list_link; _S_start_free = (char*)__p; _S_end_free = _S_start_free + __i; return(_S_chunk_alloc(__size, __nobjs)); } } _S_end_free = 0; _S_start_free = (char*)malloc_alloc::allocate(__bytes_to_get); } _S_heap_size += __bytes_to_get; _S_end_free = _S_start_free + __bytes_to_get; return(_S_chunk_alloc(__size, __nobjs)); } } template void* __default_alloc_template<__threads, __inst>::_S_refill(size_t __n) { int __nobjs = 20; char* __chunk = _S_chunk_alloc(__n, __nobjs); _Obj* * __my_free_list; _Obj* __result; _Obj* __current_obj; _Obj* __next_obj; int __i; if (1 == __nobjs) return(__chunk); __my_free_list = _S_free_list + _S_freelist_index(__n); __result = (_Obj*)__chunk; *__my_free_list = __next_obj = (_Obj*)(__chunk + __n); for (__i = 1; ; __i++) { __current_obj = __next_obj; __next_obj = (_Obj*)((char*)__next_obj + __n); if (__nobjs - 1 == __i) { __current_obj -> _M_free_list_link = 0; break; } else { __current_obj -> _M_free_list_link = __next_obj; } } return(__result); } template void* __default_alloc_template::reallocate(void* __p, size_t __old_sz, size_t __new_sz) { void* __result; size_t __copy_sz; if (__old_sz > (size_t) _MAX_BYTES && __new_sz > (size_t) _MAX_BYTES) { return(realloc(__p, __new_sz)); } if (_S_round_up(__old_sz) == _S_round_up(__new_sz)) return(__p); __result = allocate(__new_sz); __copy_sz = __new_sz > __old_sz? __old_sz : __new_sz; memcpy(__result, __p, __copy_sz); deallocate(__p, __old_sz); return(__result); } # 602 "/usr/include/g++-3/stl_alloc.h" 3 # 689 "/usr/include/g++-3/stl_alloc.h" 3 template char* __default_alloc_template<__threads, __inst>::_S_start_free = 0; template char* __default_alloc_template<__threads, __inst>::_S_end_free = 0; template size_t __default_alloc_template<__threads, __inst>::_S_heap_size = 0; template __default_alloc_template<__threads, __inst>::_Obj* __default_alloc_template<__threads, __inst> ::_S_free_list[ _NFREELISTS ] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; template class allocator { typedef alloc _Alloc; public: typedef size_t size_type; typedef ptrdiff_t difference_type; typedef _Tp* pointer; typedef const _Tp* const_pointer; typedef _Tp& reference; typedef const _Tp& const_reference; typedef _Tp value_type; template struct rebind { typedef allocator<_Tp1> other; }; allocator() throw() {} allocator(const allocator&) throw() {} template allocator(const allocator<_Tp1>&) throw() {} ~allocator() throw() {} pointer address(reference __x) const { return &__x; } const_pointer address(const_reference __x) const { return &__x; } _Tp* allocate(size_type __n, const void* = 0) { return __n != 0 ? static_cast<_Tp*>(_Alloc::allocate(__n * sizeof(_Tp))) : 0; } void deallocate(pointer __p, size_type __n) { _Alloc::deallocate(__p, __n * sizeof(_Tp)); } size_type max_size() const throw() { return size_t(-1) / sizeof(_Tp); } void construct(pointer __p, const _Tp& __val) { new(__p) _Tp(__val); } void destroy(pointer __p) { __p->~_Tp(); } }; template<> class allocator { typedef size_t size_type; typedef ptrdiff_t difference_type; typedef void* pointer; typedef const void* const_pointer; typedef void value_type; template struct rebind { typedef allocator<_Tp1> other; }; }; template inline bool operator==(const allocator<_T1>&, const allocator<_T2>&) { return true; } template inline bool operator!=(const allocator<_T1>&, const allocator<_T2>&) { return false; } template struct __allocator { _Alloc __underlying_alloc; typedef size_t size_type; typedef ptrdiff_t difference_type; typedef _Tp* pointer; typedef const _Tp* const_pointer; typedef _Tp& reference; typedef const _Tp& const_reference; typedef _Tp value_type; template struct rebind { typedef __allocator<_Tp1, _Alloc> other; }; __allocator() throw() {} __allocator(const __allocator& __a) throw() : __underlying_alloc(__a.__underlying_alloc) {} template __allocator(const __allocator<_Tp1, _Alloc>& __a) throw() : __underlying_alloc(__a.__underlying_alloc) {} ~__allocator() throw() {} pointer address(reference __x) const { return &__x; } const_pointer address(const_reference __x) const { return &__x; } _Tp* allocate(size_type __n, const void* = 0) { return __n != 0 ? static_cast<_Tp*>(__underlying_alloc.allocate(__n * sizeof(_Tp))) : 0; } void deallocate(pointer __p, size_type __n) { __underlying_alloc.deallocate(__p, __n * sizeof(_Tp)); } size_type max_size() const throw() { return size_t(-1) / sizeof(_Tp); } void construct(pointer __p, const _Tp& __val) { new(__p) _Tp(__val); } void destroy(pointer __p) { __p->~_Tp(); } }; template class __allocator { typedef size_t size_type; typedef ptrdiff_t difference_type; typedef void* pointer; typedef const void* const_pointer; typedef void value_type; template struct rebind { typedef __allocator<_Tp1, _Alloc> other; }; }; template inline bool operator==(const __allocator<_Tp, _Alloc>& __a1, const __allocator<_Tp, _Alloc>& __a2) { return __a1.__underlying_alloc == __a2.__underlying_alloc; } template inline bool operator!=(const __allocator<_Tp, _Alloc>& __a1, const __allocator<_Tp, _Alloc>& __a2) { return __a1.__underlying_alloc != __a2.__underlying_alloc; } template inline bool operator==(const __malloc_alloc_template&, const __malloc_alloc_template&) { return true; } template inline bool operator!=(const __malloc_alloc_template<__inst>&, const __malloc_alloc_template<__inst>&) { return false; } template inline bool operator==(const __default_alloc_template<__threads, __inst>&, const __default_alloc_template<__threads, __inst>&) { return true; } template inline bool operator!=(const __default_alloc_template<__threads, __inst>&, const __default_alloc_template<__threads, __inst>&) { return false; } template inline bool operator==(const debug_alloc<_Alloc>&, const debug_alloc<_Alloc>&) { return true; } template inline bool operator!=(const debug_alloc<_Alloc>&, const debug_alloc<_Alloc>&) { return false; } template struct _Alloc_traits { static const bool _S_instanceless = false; typedef typename _Allocator:: rebind<_Tp>::other allocator_type; }; template const bool _Alloc_traits<_Tp, _Allocator>::_S_instanceless; template struct _Alloc_traits<_Tp, allocator<_Tp1> > { static const bool _S_instanceless = true; typedef simple_alloc<_Tp, alloc> _Alloc_type; typedef allocator<_Tp> allocator_type; }; template struct _Alloc_traits<_Tp, __malloc_alloc_template<__inst> > { static const bool _S_instanceless = true; typedef simple_alloc<_Tp, __malloc_alloc_template<__inst> > _Alloc_type; typedef __allocator<_Tp, __malloc_alloc_template<__inst> > allocator_type; }; template struct _Alloc_traits<_Tp, __default_alloc_template<__threads, __inst> > { static const bool _S_instanceless = true; typedef simple_alloc<_Tp, __default_alloc_template<__threads, __inst> > _Alloc_type; typedef __allocator<_Tp, __default_alloc_template<__threads, __inst> > allocator_type; }; template struct _Alloc_traits<_Tp, debug_alloc<_Alloc> > { static const bool _S_instanceless = true; typedef simple_alloc<_Tp, debug_alloc<_Alloc> > _Alloc_type; typedef __allocator<_Tp, debug_alloc<_Alloc> > allocator_type; }; template struct _Alloc_traits<_Tp, __allocator<_Tp1, __malloc_alloc_template<__inst> > > { static const bool _S_instanceless = true; typedef simple_alloc<_Tp, __malloc_alloc_template<__inst> > _Alloc_type; typedef __allocator<_Tp, __malloc_alloc_template<__inst> > allocator_type; }; template struct _Alloc_traits<_Tp, __allocator<_Tp1, __default_alloc_template<__thr, __inst> > > { static const bool _S_instanceless = true; typedef simple_alloc<_Tp, __default_alloc_template<__thr,__inst> > _Alloc_type; typedef __allocator<_Tp, __default_alloc_template<__thr,__inst> > allocator_type; }; template struct _Alloc_traits<_Tp, __allocator<_Tp1, debug_alloc<_Alloc> > > { static const bool _S_instanceless = true; typedef simple_alloc<_Tp, debug_alloc<_Alloc> > _Alloc_type; typedef __allocator<_Tp, debug_alloc<_Alloc> > allocator_type; }; # 31 "/usr/include/g++-3/vector" 2 3 # 1 "/usr/include/g++-3/stl_construct.h" 1 3 template inline void destroy(_Tp* __pointer) { __pointer->~_Tp(); } template inline void construct(_T1* __p, const _T2& __value) { new (__p) _T1(__value); } template inline void construct(_T1* __p) { new (__p) _T1(); } template inline void __destroy_aux(_ForwardIterator __first, _ForwardIterator __last, __false_type) { for ( ; __first != __last; ++__first) destroy(&*__first); } template inline void __destroy_aux(_ForwardIterator, _ForwardIterator, __true_type) {} template inline void __destroy(_ForwardIterator __first, _ForwardIterator __last, _Tp*) { typedef typename __type_traits<_Tp>::has_trivial_destructor _Trivial_destructor; __destroy_aux(__first, __last, _Trivial_destructor()); } template inline void destroy(_ForwardIterator __first, _ForwardIterator __last) { __destroy(__first, __last, __value_type( __first ) ); } inline void destroy(char*, char*) {} inline void destroy(wchar_t*, wchar_t*) {} # 32 "/usr/include/g++-3/vector" 2 3 # 1 "/usr/include/g++-3/stl_uninitialized.h" 1 3 template inline _ForwardIter __uninitialized_copy_aux(_InputIter __first, _InputIter __last, _ForwardIter __result, __true_type) { return copy(__first, __last, __result); } template _ForwardIter __uninitialized_copy_aux(_InputIter __first, _InputIter __last, _ForwardIter __result, __false_type) { _ForwardIter __cur = __result; try { for ( ; __first != __last; ++__first, ++__cur) construct(&*__cur, *__first); return __cur; } catch(...) { destroy(__result, __cur) ; throw; } ; } template inline _ForwardIter __uninitialized_copy(_InputIter __first, _InputIter __last, _ForwardIter __result, _Tp*) { typedef typename __type_traits<_Tp>::is_POD_type _Is_POD; return __uninitialized_copy_aux(__first, __last, __result, _Is_POD()); } template inline _ForwardIter uninitialized_copy(_InputIter __first, _InputIter __last, _ForwardIter __result) { return __uninitialized_copy(__first, __last, __result, __value_type( __result ) ); } inline char* uninitialized_copy(const char* __first, const char* __last, char* __result) { memmove(__result, __first, __last - __first); return __result + (__last - __first); } inline wchar_t* uninitialized_copy(const wchar_t* __first, const wchar_t* __last, wchar_t* __result) { memmove(__result, __first, sizeof(wchar_t) * (__last - __first)); return __result + (__last - __first); } template pair<_InputIter, _ForwardIter> __uninitialized_copy_n(_InputIter __first, _Size __count, _ForwardIter __result, input_iterator_tag) { _ForwardIter __cur = __result; try { for ( ; __count > 0 ; --__count, ++__first, ++__cur) construct(&*__cur, *__first); return pair<_InputIter, _ForwardIter>(__first, __cur); } catch(...) { destroy(__result, __cur) ; throw; } ; } template inline pair<_RandomAccessIter, _ForwardIter> __uninitialized_copy_n(_RandomAccessIter __first, _Size __count, _ForwardIter __result, random_access_iterator_tag) { _RandomAccessIter __last = __first + __count; return pair<_RandomAccessIter, _ForwardIter>( __last, uninitialized_copy(__first, __last, __result)); } template inline pair<_InputIter, _ForwardIter> __uninitialized_copy_n(_InputIter __first, _Size __count, _ForwardIter __result) { return __uninitialized_copy_n(__first, __count, __result, __iterator_category( __first ) ); } template inline pair<_InputIter, _ForwardIter> uninitialized_copy_n(_InputIter __first, _Size __count, _ForwardIter __result) { return __uninitialized_copy_n(__first, __count, __result, __iterator_category( __first ) ); } template inline void __uninitialized_fill_aux(_ForwardIter __first, _ForwardIter __last, const _Tp& __x, __true_type) { fill(__first, __last, __x); } template void __uninitialized_fill_aux(_ForwardIter __first, _ForwardIter __last, const _Tp& __x, __false_type) { _ForwardIter __cur = __first; try { for ( ; __cur != __last; ++__cur) construct(&*__cur, __x); } catch(...) { destroy(__first, __cur) ; throw; } ; } template inline void __uninitialized_fill(_ForwardIter __first, _ForwardIter __last, const _Tp& __x, _Tp1*) { typedef typename __type_traits<_Tp1>::is_POD_type _Is_POD; __uninitialized_fill_aux(__first, __last, __x, _Is_POD()); } template inline void uninitialized_fill(_ForwardIter __first, _ForwardIter __last, const _Tp& __x) { __uninitialized_fill(__first, __last, __x, __value_type( __first ) ); } template inline _ForwardIter __uninitialized_fill_n_aux(_ForwardIter __first, _Size __n, const _Tp& __x, __true_type) { return fill_n(__first, __n, __x); } template _ForwardIter __uninitialized_fill_n_aux(_ForwardIter __first, _Size __n, const _Tp& __x, __false_type) { _ForwardIter __cur = __first; try { for ( ; __n > 0; --__n, ++__cur) construct(&*__cur, __x); return __cur; } catch(...) { destroy(__first, __cur) ; throw; } ; } template inline _ForwardIter __uninitialized_fill_n(_ForwardIter __first, _Size __n, const _Tp& __x, _Tp1*) { typedef typename __type_traits<_Tp1>::is_POD_type _Is_POD; return __uninitialized_fill_n_aux(__first, __n, __x, _Is_POD()); } template inline _ForwardIter uninitialized_fill_n(_ForwardIter __first, _Size __n, const _Tp& __x) { return __uninitialized_fill_n(__first, __n, __x, __value_type( __first ) ); } template inline _ForwardIter __uninitialized_copy_copy(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _ForwardIter __result) { _ForwardIter __mid = uninitialized_copy(__first1, __last1, __result); try { return uninitialized_copy(__first2, __last2, __mid); } catch(...) { destroy(__result, __mid) ; throw; } ; } template inline _ForwardIter __uninitialized_fill_copy(_ForwardIter __result, _ForwardIter __mid, const _Tp& __x, _InputIter __first, _InputIter __last) { uninitialized_fill(__result, __mid, __x); try { return uninitialized_copy(__first, __last, __mid); } catch(...) { destroy(__result, __mid) ; throw; } ; } template inline void __uninitialized_copy_fill(_InputIter __first1, _InputIter __last1, _ForwardIter __first2, _ForwardIter __last2, const _Tp& __x) { _ForwardIter __mid2 = uninitialized_copy(__first1, __last1, __first2); try { uninitialized_fill(__mid2, __last2, __x); } catch(...) { destroy(__first2, __mid2) ; throw; } ; } # 33 "/usr/include/g++-3/vector" 2 3 # 1 "/usr/include/g++-3/stl_vector.h" 1 3 template class _Vector_alloc_base { public: typedef typename _Alloc_traits<_Tp, _Allocator>::allocator_type allocator_type; allocator_type get_allocator() const { return _M_data_allocator; } _Vector_alloc_base(const allocator_type& __a) : _M_data_allocator(__a), _M_start(0), _M_finish(0), _M_end_of_storage(0) {} protected: allocator_type _M_data_allocator; _Tp* _M_start; _Tp* _M_finish; _Tp* _M_end_of_storage; _Tp* _M_allocate(size_t __n) { return _M_data_allocator.allocate(__n); } void _M_deallocate(_Tp* __p, size_t __n) { if (__p) _M_data_allocator.deallocate(__p, __n); } }; template class _Vector_alloc_base<_Tp, _Allocator, true> { public: typedef typename _Alloc_traits<_Tp, _Allocator>::allocator_type allocator_type; allocator_type get_allocator() const { return allocator_type(); } _Vector_alloc_base(const allocator_type&) : _M_start(0), _M_finish(0), _M_end_of_storage(0) {} protected: _Tp* _M_start; _Tp* _M_finish; _Tp* _M_end_of_storage; typedef typename _Alloc_traits<_Tp, _Allocator>::_Alloc_type _Alloc_type; _Tp* _M_allocate(size_t __n) { return _Alloc_type::allocate(__n); } void _M_deallocate(_Tp* __p, size_t __n) { _Alloc_type::deallocate(__p, __n);} }; template struct _Vector_base : public _Vector_alloc_base<_Tp, _Alloc, _Alloc_traits<_Tp, _Alloc>::_S_instanceless> { typedef _Vector_alloc_base<_Tp, _Alloc, _Alloc_traits<_Tp, _Alloc>::_S_instanceless> _Base; typedef typename _Base::allocator_type allocator_type; _Vector_base(const allocator_type& __a) : _Base(__a) {} _Vector_base(size_t __n, const allocator_type& __a) : _Base(__a) { _M_start = _M_allocate(__n); _M_finish = _M_start; _M_end_of_storage = _M_start + __n; } ~_Vector_base() { _M_deallocate(_M_start, _M_end_of_storage - _M_start); } }; # 150 "/usr/include/g++-3/stl_vector.h" 3 template > class vector : protected _Vector_base<_Tp, _Alloc> { private: typedef _Vector_base<_Tp, _Alloc> _Base; public: typedef _Tp value_type; typedef value_type* pointer; typedef const value_type* const_pointer; typedef value_type* iterator; typedef const value_type* const_iterator; typedef value_type& reference; typedef const value_type& const_reference; typedef size_t size_type; typedef ptrdiff_t difference_type; typedef typename _Base::allocator_type allocator_type; allocator_type get_allocator() const { return _Base::get_allocator(); } typedef reverse_iterator const_reverse_iterator; typedef reverse_iterator reverse_iterator; protected: using _Base::_M_allocate; using _Base::_M_deallocate; using _Base::_M_start; using _Base::_M_finish; using _Base::_M_end_of_storage; protected: void _M_insert_aux(iterator __position, const _Tp& __x); void _M_insert_aux(iterator __position); public: iterator begin() { return _M_start; } const_iterator begin() const { return _M_start; } iterator end() { return _M_finish; } const_iterator end() const { return _M_finish; } reverse_iterator rbegin() { return reverse_iterator(end()); } const_reverse_iterator rbegin() const { return const_reverse_iterator(end()); } reverse_iterator rend() { return reverse_iterator(begin()); } const_reverse_iterator rend() const { return const_reverse_iterator(begin()); } size_type size() const { return size_type(end() - begin()); } size_type max_size() const { return size_type(-1) / sizeof(_Tp); } size_type capacity() const { return size_type(_M_end_of_storage - begin()); } bool empty() const { return begin() == end(); } reference operator[](size_type __n) { return *(begin() + __n); } const_reference operator[](size_type __n) const { return *(begin() + __n); } explicit vector(const allocator_type& __a = allocator_type()) : _Base(__a) {} vector(size_type __n, const _Tp& __value, const allocator_type& __a = allocator_type()) : _Base(__n, __a) { _M_finish = uninitialized_fill_n(_M_start, __n, __value); } explicit vector(size_type __n) : _Base(__n, allocator_type()) { _M_finish = uninitialized_fill_n(_M_start, __n, _Tp()); } vector(const vector<_Tp, _Alloc>& __x) : _Base(__x.size(), __x.get_allocator()) { _M_finish = uninitialized_copy(__x.begin(), __x.end(), _M_start); } template vector(_InputIterator __first, _InputIterator __last, const allocator_type& __a = allocator_type()) : _Base(__a) { typedef typename _Is_integer<_InputIterator>::_Integral _Integral; _M_initialize_aux(__first, __last, _Integral()); } template void _M_initialize_aux(_Integer __n, _Integer __value, __true_type) { _M_start = _M_allocate(__n); _M_end_of_storage = _M_start + __n; _M_finish = uninitialized_fill_n(_M_start, __n, __value); } template void _M_initialize_aux(_InputIterator __first, _InputIterator __last, __false_type) { _M_range_initialize(__first, __last, __iterator_category( __first ) ); } ~vector() { destroy(_M_start, _M_finish); } vector<_Tp, _Alloc>& operator=(const vector<_Tp, _Alloc>& __x); void reserve(size_type __n) { if (capacity() < __n) { const size_type __old_size = size(); iterator __tmp = _M_allocate_and_copy(__n, _M_start, _M_finish); destroy(_M_start, _M_finish); _M_deallocate(_M_start, _M_end_of_storage - _M_start); _M_start = __tmp; _M_finish = __tmp + __old_size; _M_end_of_storage = _M_start + __n; } } void assign(size_type __n, const _Tp& __val); template void assign(_InputIterator __first, _InputIterator __last) { typedef typename _Is_integer<_InputIterator>::_Integral _Integral; _M_assign_dispatch(__first, __last, _Integral()); } template void _M_assign_dispatch(_Integer __n, _Integer __val, __true_type) { assign((size_type) __n, (_Tp) __val); } template void _M_assign_dispatch(_InputIter __first, _InputIter __last, __false_type) { _M_assign_aux(__first, __last, __iterator_category( __first ) ); } template void _M_assign_aux(_InputIterator __first, _InputIterator __last, input_iterator_tag); template void _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last, forward_iterator_tag); reference front() { return *begin(); } const_reference front() const { return *begin(); } reference back() { return *(end() - 1); } const_reference back() const { return *(end() - 1); } void push_back(const _Tp& __x) { if (_M_finish != _M_end_of_storage) { construct(_M_finish, __x); ++_M_finish; } else _M_insert_aux(end(), __x); } void push_back() { if (_M_finish != _M_end_of_storage) { construct(_M_finish); ++_M_finish; } else _M_insert_aux(end()); } void swap(vector<_Tp, _Alloc>& __x) { ::swap(_M_start, __x._M_start); ::swap(_M_finish, __x._M_finish); ::swap(_M_end_of_storage, __x._M_end_of_storage); } iterator insert(iterator __position, const _Tp& __x) { size_type __n = __position - begin(); if (_M_finish != _M_end_of_storage && __position == end()) { construct(_M_finish, __x); ++_M_finish; } else _M_insert_aux(__position, __x); return begin() + __n; } iterator insert(iterator __position) { size_type __n = __position - begin(); if (_M_finish != _M_end_of_storage && __position == end()) { construct(_M_finish); ++_M_finish; } else _M_insert_aux(__position); return begin() + __n; } template void insert(iterator __pos, _InputIterator __first, _InputIterator __last) { typedef typename _Is_integer<_InputIterator>::_Integral _Integral; _M_insert_dispatch(__pos, __first, __last, _Integral()); } template void _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __val, __true_type) { insert(__pos, (size_type) __n, (_Tp) __val); } template void _M_insert_dispatch(iterator __pos, _InputIterator __first, _InputIterator __last, __false_type) { _M_range_insert(__pos, __first, __last, __iterator_category( __first ) ); } void insert (iterator __pos, size_type __n, const _Tp& __x); void pop_back() { --_M_finish; destroy(_M_finish); } iterator erase(iterator __position) { if (__position + 1 != end()) copy(__position + 1, _M_finish, __position); --_M_finish; destroy(_M_finish); return __position; } iterator erase(iterator __first, iterator __last) { iterator __i = copy(__last, _M_finish, __first); destroy(__i, _M_finish); _M_finish = _M_finish - (__last - __first); return __first; } void resize(size_type __new_size, const _Tp& __x) { if (__new_size < size()) erase(begin() + __new_size, end()); else insert(end(), __new_size - size(), __x); } void resize(size_type __new_size) { resize(__new_size, _Tp()); } void clear() { erase(begin(), end()); } protected: template iterator _M_allocate_and_copy(size_type __n, _ForwardIterator __first, _ForwardIterator __last) { iterator __result = _M_allocate(__n); try { uninitialized_copy(__first, __last, __result); return __result; } catch(...) { _M_deallocate(__result, __n) ; throw; } ; } # 440 "/usr/include/g++-3/stl_vector.h" 3 template void _M_range_initialize(_InputIterator __first, _InputIterator __last, input_iterator_tag) { for ( ; __first != __last; ++__first) push_back(*__first); } template void _M_range_initialize(_ForwardIterator __first, _ForwardIterator __last, forward_iterator_tag) { size_type __n = 0; distance(__first, __last, __n); _M_start = _M_allocate(__n); _M_end_of_storage = _M_start + __n; _M_finish = uninitialized_copy(__first, __last, _M_start); } template void _M_range_insert(iterator __pos, _InputIterator __first, _InputIterator __last, input_iterator_tag); template void _M_range_insert(iterator __pos, _ForwardIterator __first, _ForwardIterator __last, forward_iterator_tag); }; template inline bool operator==(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y) { return __x.size() == __y.size() && equal(__x.begin(), __x.end(), __y.begin()); } template inline bool operator<(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y) { return lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end()); } template inline void swap(vector<_Tp, _Alloc>& __x, vector<_Tp, _Alloc>& __y) { __x.swap(__y); } template vector<_Tp,_Alloc>& vector<_Tp,_Alloc>::operator=(const vector<_Tp, _Alloc>& __x) { if (&__x != this) { const size_type __xlen = __x.size(); if (__xlen > capacity()) { iterator __tmp = _M_allocate_and_copy(__xlen, __x.begin(), __x.end()); destroy(_M_start, _M_finish); _M_deallocate(_M_start, _M_end_of_storage - _M_start); _M_start = __tmp; _M_end_of_storage = _M_start + __xlen; } else if (size() >= __xlen) { iterator __i = copy(__x.begin(), __x.end(), begin()); destroy(__i, _M_finish); } else { copy(__x.begin(), __x.begin() + size(), _M_start); uninitialized_copy(__x.begin() + size(), __x.end(), _M_finish); } _M_finish = _M_start + __xlen; } return *this; } template void vector<_Tp, _Alloc>::assign(size_t __n, const value_type& __val) { if (__n > capacity()) { vector<_Tp, _Alloc> __tmp(__n, __val, get_allocator()); __tmp.swap(*this); } else if (__n > size()) { fill(begin(), end(), __val); _M_finish = uninitialized_fill_n(_M_finish, __n - size(), __val); } else erase(fill_n(begin(), __n, __val), end()); } template template void vector<_Tp, _Alloc>::_M_assign_aux(_InputIter __first, _InputIter __last, input_iterator_tag) { iterator __cur = begin(); for ( ; __first != __last && __cur != end(); ++__cur, ++__first) *__cur = *__first; if (__first == __last) erase(__cur, end()); else insert(end(), __first, __last); } template template void vector<_Tp, _Alloc>::_M_assign_aux(_ForwardIter __first, _ForwardIter __last, forward_iterator_tag) { size_type __len = 0; distance(__first, __last, __len); if (__len > capacity()) { iterator __tmp = _M_allocate_and_copy(__len, __first, __last); destroy(_M_start, _M_finish); _M_deallocate(_M_start, _M_end_of_storage - _M_start); _M_start = __tmp; _M_end_of_storage = _M_finish = _M_start + __len; } else if (size() >= __len) { iterator __new_finish = copy(__first, __last, _M_start); destroy(__new_finish, _M_finish); _M_finish = __new_finish; } else { _ForwardIter __mid = __first; advance(__mid, size()); copy(__first, __mid, _M_start); _M_finish = uninitialized_copy(__mid, __last, _M_finish); } } template void vector<_Tp, _Alloc>::_M_insert_aux(iterator __position, const _Tp& __x) { if (_M_finish != _M_end_of_storage) { construct(_M_finish, *(_M_finish - 1)); ++_M_finish; _Tp __x_copy = __x; copy_backward(__position, _M_finish - 2, _M_finish - 1); *__position = __x_copy; } else { const size_type __old_size = size(); const size_type __len = __old_size != 0 ? 2 * __old_size : 1; iterator __new_start = _M_allocate(__len); iterator __new_finish = __new_start; try { __new_finish = uninitialized_copy(_M_start, __position, __new_start); construct(__new_finish, __x); ++__new_finish; __new_finish = uninitialized_copy(__position, _M_finish, __new_finish); } catch(...) { (destroy(__new_start,__new_finish), _M_deallocate(__new_start,__len)) ; throw; } ; destroy(begin(), end()); _M_deallocate(_M_start, _M_end_of_storage - _M_start); _M_start = __new_start; _M_finish = __new_finish; _M_end_of_storage = __new_start + __len; } } template void vector<_Tp, _Alloc>::_M_insert_aux(iterator __position) { if (_M_finish != _M_end_of_storage) { construct(_M_finish, *(_M_finish - 1)); ++_M_finish; copy_backward(__position, _M_finish - 2, _M_finish - 1); *__position = _Tp(); } else { const size_type __old_size = size(); const size_type __len = __old_size != 0 ? 2 * __old_size : 1; iterator __new_start = _M_allocate(__len); iterator __new_finish = __new_start; try { __new_finish = uninitialized_copy(_M_start, __position, __new_start); construct(__new_finish); ++__new_finish; __new_finish = uninitialized_copy(__position, _M_finish, __new_finish); } catch(...) { (destroy(__new_start,__new_finish), _M_deallocate(__new_start,__len)) ; throw; } ; destroy(begin(), end()); _M_deallocate(_M_start, _M_end_of_storage - _M_start); _M_start = __new_start; _M_finish = __new_finish; _M_end_of_storage = __new_start + __len; } } template void vector<_Tp, _Alloc>::insert(iterator __position, size_type __n, const _Tp& __x) { if (__n != 0) { if (size_type(_M_end_of_storage - _M_finish) >= __n) { _Tp __x_copy = __x; const size_type __elems_after = _M_finish - __position; iterator __old_finish = _M_finish; if (__elems_after > __n) { uninitialized_copy(_M_finish - __n, _M_finish, _M_finish); _M_finish += __n; copy_backward(__position, __old_finish - __n, __old_finish); fill(__position, __position + __n, __x_copy); } else { uninitialized_fill_n(_M_finish, __n - __elems_after, __x_copy); _M_finish += __n - __elems_after; uninitialized_copy(__position, __old_finish, _M_finish); _M_finish += __elems_after; fill(__position, __old_finish, __x_copy); } } else { const size_type __old_size = size(); const size_type __len = __old_size + max(__old_size, __n); iterator __new_start = _M_allocate(__len); iterator __new_finish = __new_start; try { __new_finish = uninitialized_copy(_M_start, __position, __new_start); __new_finish = uninitialized_fill_n(__new_finish, __n, __x); __new_finish = uninitialized_copy(__position, _M_finish, __new_finish); } catch(...) { (destroy(__new_start,__new_finish), _M_deallocate(__new_start,__len)) ; throw; } ; destroy(_M_start, _M_finish); _M_deallocate(_M_start, _M_end_of_storage - _M_start); _M_start = __new_start; _M_finish = __new_finish; _M_end_of_storage = __new_start + __len; } } } template template void vector<_Tp, _Alloc>::_M_range_insert(iterator __pos, _InputIterator __first, _InputIterator __last, input_iterator_tag) { for ( ; __first != __last; ++__first) { __pos = insert(__pos, *__first); ++__pos; } } template template void vector<_Tp, _Alloc>::_M_range_insert(iterator __position, _ForwardIterator __first, _ForwardIterator __last, forward_iterator_tag) { if (__first != __last) { size_type __n = 0; distance(__first, __last, __n); if (size_type(_M_end_of_storage - _M_finish) >= __n) { const size_type __elems_after = _M_finish - __position; iterator __old_finish = _M_finish; if (__elems_after > __n) { uninitialized_copy(_M_finish - __n, _M_finish, _M_finish); _M_finish += __n; copy_backward(__position, __old_finish - __n, __old_finish); copy(__first, __last, __position); } else { _ForwardIterator __mid = __first; advance(__mid, __elems_after); uninitialized_copy(__mid, __last, _M_finish); _M_finish += __n - __elems_after; uninitialized_copy(__position, __old_finish, _M_finish); _M_finish += __elems_after; copy(__first, __mid, __position); } } else { const size_type __old_size = size(); const size_type __len = __old_size + max(__old_size, __n); iterator __new_start = _M_allocate(__len); iterator __new_finish = __new_start; try { __new_finish = uninitialized_copy(_M_start, __position, __new_start); __new_finish = uninitialized_copy(__first, __last, __new_finish); __new_finish = uninitialized_copy(__position, _M_finish, __new_finish); } catch(...) { (destroy(__new_start,__new_finish), _M_deallocate(__new_start,__len)) ; throw; } ; destroy(_M_start, _M_finish); _M_deallocate(_M_start, _M_end_of_storage - _M_start); _M_start = __new_start; _M_finish = __new_finish; _M_end_of_storage = __new_start + __len; } } } # 810 "/usr/include/g++-3/stl_vector.h" 3 # 34 "/usr/include/g++-3/vector" 2 3 # 1 "/usr/include/g++-3/stl_bvector.h" 1 3 static const int __WORD_BIT = int(8 *sizeof(unsigned int)); struct _Bit_reference { unsigned int* _M_p; unsigned int _M_mask; _Bit_reference(unsigned int* __x, unsigned int __y) : _M_p(__x), _M_mask(__y) {} public: _Bit_reference() : _M_p(0), _M_mask(0) {} operator bool() const { return !(!(*_M_p & _M_mask)); } _Bit_reference& operator=(bool __x) { if (__x) *_M_p |= _M_mask; else *_M_p &= ~_M_mask; return *this; } _Bit_reference& operator=(const _Bit_reference& __x) { return *this = bool(__x); } bool operator==(const _Bit_reference& __x) const { return bool(*this) == bool(__x); } bool operator<(const _Bit_reference& __x) const { return !bool(*this) && bool(__x); } void flip() { *_M_p ^= _M_mask; } }; inline void swap(_Bit_reference __x, _Bit_reference __y) { bool __tmp = __x; __x = __y; __y = __tmp; } struct _Bit_iterator : public random_access_iterator { typedef _Bit_reference reference; typedef _Bit_reference* pointer; typedef _Bit_iterator iterator; unsigned int* _M_p; unsigned int _M_offset; void bump_up() { if (_M_offset++ == __WORD_BIT - 1) { _M_offset = 0; ++_M_p; } } void bump_down() { if (_M_offset-- == 0) { _M_offset = __WORD_BIT - 1; --_M_p; } } _Bit_iterator() : _M_p(0), _M_offset(0) {} _Bit_iterator(unsigned int* __x, unsigned int __y) : _M_p(__x), _M_offset(__y) {} reference operator*() const { return reference(_M_p, 1U << _M_offset); } iterator& operator++() { bump_up(); return *this; } iterator operator++(int) { iterator __tmp = *this; bump_up(); return __tmp; } iterator& operator--() { bump_down(); return *this; } iterator operator--(int) { iterator __tmp = *this; bump_down(); return __tmp; } iterator& operator+=(difference_type __i) { difference_type __n = __i + _M_offset; _M_p += __n / __WORD_BIT; __n = __n % __WORD_BIT; if (__n < 0) { _M_offset = (unsigned int) __n + __WORD_BIT; --_M_p; } else _M_offset = (unsigned int) __n; return *this; } iterator& operator-=(difference_type __i) { *this += -__i; return *this; } iterator operator+(difference_type __i) const { iterator __tmp = *this; return __tmp += __i; } iterator operator-(difference_type __i) const { iterator __tmp = *this; return __tmp -= __i; } difference_type operator-(iterator __x) const { return __WORD_BIT * (_M_p - __x._M_p) + _M_offset - __x._M_offset; } reference operator[](difference_type __i) { return *(*this + __i); } bool operator==(const iterator& __x) const { return _M_p == __x._M_p && _M_offset == __x._M_offset; } bool operator!=(const iterator& __x) const { return _M_p != __x._M_p || _M_offset != __x._M_offset; } bool operator<(iterator __x) const { return _M_p < __x._M_p || (_M_p == __x._M_p && _M_offset < __x._M_offset); } }; struct _Bit_const_iterator : public random_access_iterator { typedef bool reference; typedef bool const_reference; typedef const bool* pointer; typedef _Bit_const_iterator const_iterator; unsigned int* _M_p; unsigned int _M_offset; void bump_up() { if (_M_offset++ == __WORD_BIT - 1) { _M_offset = 0; ++_M_p; } } void bump_down() { if (_M_offset-- == 0) { _M_offset = __WORD_BIT - 1; --_M_p; } } _Bit_const_iterator() : _M_p(0), _M_offset(0) {} _Bit_const_iterator(unsigned int* __x, unsigned int __y) : _M_p(__x), _M_offset(__y) {} _Bit_const_iterator(const _Bit_iterator& __x) : _M_p(__x._M_p), _M_offset(__x._M_offset) {} const_reference operator*() const { return _Bit_reference(_M_p, 1U << _M_offset); } const_iterator& operator++() { bump_up(); return *this; } const_iterator operator++(int) { const_iterator __tmp = *this; bump_up(); return __tmp; } const_iterator& operator--() { bump_down(); return *this; } const_iterator operator--(int) { const_iterator __tmp = *this; bump_down(); return __tmp; } const_iterator& operator+=(difference_type __i) { difference_type __n = __i + _M_offset; _M_p += __n / __WORD_BIT; __n = __n % __WORD_BIT; if (__n < 0) { _M_offset = (unsigned int) __n + __WORD_BIT; --_M_p; } else _M_offset = (unsigned int) __n; return *this; } const_iterator& operator-=(difference_type __i) { *this += -__i; return *this; } const_iterator operator+(difference_type __i) const { const_iterator __tmp = *this; return __tmp += __i; } const_iterator operator-(difference_type __i) const { const_iterator __tmp = *this; return __tmp -= __i; } difference_type operator-(const_iterator __x) const { return __WORD_BIT * (_M_p - __x._M_p) + _M_offset - __x._M_offset; } const_reference operator[](difference_type __i) { return *(*this + __i); } bool operator==(const const_iterator& __x) const { return _M_p == __x._M_p && _M_offset == __x._M_offset; } bool operator!=(const const_iterator& __x) const { return _M_p != __x._M_p || _M_offset != __x._M_offset; } bool operator<(const_iterator __x) const { return _M_p < __x._M_p || (_M_p == __x._M_p && _M_offset < __x._M_offset); } }; template class _Bvector_alloc_base { public: typedef typename _Alloc_traits::allocator_type allocator_type; allocator_type get_allocator() const { return _M_data_allocator; } _Bvector_alloc_base(const allocator_type& __a) : _M_data_allocator(__a), _M_start(), _M_finish(), _M_end_of_storage(0) {} protected: unsigned int* _M_bit_alloc(size_t __n) { return _M_data_allocator.allocate((__n + __WORD_BIT - 1)/__WORD_BIT); } void _M_deallocate() { if (_M_start._M_p) _M_data_allocator.deallocate(_M_start._M_p, _M_end_of_storage - _M_start._M_p); } typename _Alloc_traits::allocator_type _M_data_allocator; _Bit_iterator _M_start; _Bit_iterator _M_finish; unsigned int* _M_end_of_storage; }; template class _Bvector_alloc_base<_Allocator, true> { public: typedef typename _Alloc_traits::allocator_type allocator_type; allocator_type get_allocator() const { return allocator_type(); } _Bvector_alloc_base(const allocator_type&) : _M_start(), _M_finish(), _M_end_of_storage(0) {} protected: typedef typename _Alloc_traits::_Alloc_type _Alloc_type; unsigned int* _M_bit_alloc(size_t __n) { return _Alloc_type::allocate((__n + __WORD_BIT - 1)/__WORD_BIT); } void _M_deallocate() { if (_M_start._M_p) _Alloc_type::deallocate(_M_start._M_p, _M_end_of_storage - _M_start._M_p); } _Bit_iterator _M_start; _Bit_iterator _M_finish; unsigned int* _M_end_of_storage; }; template class _Bvector_base : public _Bvector_alloc_base<_Alloc, _Alloc_traits::_S_instanceless> { typedef _Bvector_alloc_base<_Alloc, _Alloc_traits::_S_instanceless> _Base; public: typedef typename _Base::allocator_type allocator_type; _Bvector_base(const allocator_type& __a) : _Base(__a) {} ~_Bvector_base() { _Base::_M_deallocate(); } }; # 348 "/usr/include/g++-3/stl_bvector.h" 3 template class vector : public _Bvector_base<_Alloc> { typedef _Bvector_base<_Alloc> _Base; public: typedef bool value_type; typedef size_t size_type; typedef ptrdiff_t difference_type; typedef _Bit_reference reference; typedef bool const_reference; typedef _Bit_reference* pointer; typedef const bool* const_pointer; typedef _Bit_iterator iterator; typedef _Bit_const_iterator const_iterator; typedef reverse_iterator const_reverse_iterator; typedef reverse_iterator reverse_iterator; typedef typename _Base::allocator_type allocator_type; allocator_type get_allocator() const { return _Base::get_allocator(); } protected: protected: void _M_initialize(size_type __n) { unsigned int* __q = _M_bit_alloc(__n); _M_end_of_storage = __q + (__n + __WORD_BIT - 1)/__WORD_BIT; _M_start = iterator(__q, 0); _M_finish = _M_start + difference_type(__n); } void _M_insert_aux(iterator __position, bool __x) { if (_M_finish._M_p != _M_end_of_storage) { copy_backward(__position, _M_finish, _M_finish + 1); *__position = __x; ++_M_finish; } else { size_type __len = size() ? 2 * size() : __WORD_BIT; unsigned int* __q = _M_bit_alloc(__len); iterator __i = copy(begin(), __position, iterator(__q, 0)); *__i++ = __x; _M_finish = copy(__position, end(), __i); _M_deallocate(); _M_end_of_storage = __q + (__len + __WORD_BIT - 1)/__WORD_BIT; _M_start = iterator(__q, 0); } } template void _M_initialize_range(_InputIterator __first, _InputIterator __last, input_iterator_tag) { _M_start = iterator(); _M_finish = iterator(); _M_end_of_storage = 0; for ( ; __first != __last; ++__first) push_back(*__first); } template void _M_initialize_range(_ForwardIterator __first, _ForwardIterator __last, forward_iterator_tag) { size_type __n = 0; distance(__first, __last, __n); _M_initialize(__n); copy(__first, __last, _M_start); } template void _M_insert_range(iterator __pos, _InputIterator __first, _InputIterator __last, input_iterator_tag) { for ( ; __first != __last; ++__first) { __pos = insert(__pos, *__first); ++__pos; } } template void _M_insert_range(iterator __position, _ForwardIterator __first, _ForwardIterator __last, forward_iterator_tag) { if (__first != __last) { size_type __n = 0; distance(__first, __last, __n); if (capacity() - size() >= __n) { copy_backward(__position, end(), _M_finish + difference_type(__n)); copy(__first, __last, __position); _M_finish += difference_type(__n); } else { size_type __len = size() + max(size(), __n); unsigned int* __q = _M_bit_alloc(__len); iterator __i = copy(begin(), __position, iterator(__q, 0)); __i = copy(__first, __last, __i); _M_finish = copy(__position, end(), __i); _M_deallocate(); _M_end_of_storage = __q + (__len + __WORD_BIT - 1)/__WORD_BIT; _M_start = iterator(__q, 0); } } } public: iterator begin() { return _M_start; } const_iterator begin() const { return _M_start; } iterator end() { return _M_finish; } const_iterator end() const { return _M_finish; } reverse_iterator rbegin() { return reverse_iterator(end()); } const_reverse_iterator rbegin() const { return const_reverse_iterator(end()); } reverse_iterator rend() { return reverse_iterator(begin()); } const_reverse_iterator rend() const { return const_reverse_iterator(begin()); } size_type size() const { return size_type(end() - begin()); } size_type max_size() const { return size_type(-1); } size_type capacity() const { return size_type(const_iterator(_M_end_of_storage, 0) - begin()); } bool empty() const { return begin() == end(); } reference operator[](size_type __n) { return *(begin() + difference_type(__n)); } const_reference operator[](size_type __n) const { return *(begin() + difference_type(__n)); } explicit vector (const allocator_type& __a = allocator_type()) : _Base(__a) {} vector (size_type __n, bool __value, const allocator_type& __a = allocator_type()) : _Base(__a) { _M_initialize(__n); fill(_M_start._M_p, _M_end_of_storage, __value ? ~0 : 0); } explicit vector (size_type __n) : _Base(allocator_type()) { _M_initialize(__n); fill(_M_start._M_p, _M_end_of_storage, 0); } vector (const vector & __x) : _Base(__x.get_allocator()) { _M_initialize(__x.size()); copy(__x.begin(), __x.end(), _M_start); } template vector (_InputIterator __first, _InputIterator __last, const allocator_type& __a = allocator_type()) : _Base(__a) { typedef typename _Is_integer<_InputIterator>::_Integral _Integral; _M_initialize_dispatch(__first, __last, _Integral()); } template void _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type) { _M_initialize(__n); fill(_M_start._M_p, _M_end_of_storage, __x ? ~0 : 0); } template void _M_initialize_dispatch(_InputIterator __first, _InputIterator __last, __false_type) { _M_initialize_range(__first, __last, __iterator_category( __first ) ); } # 587 "/usr/include/g++-3/stl_bvector.h" 3 ~vector () { } vector & operator=(const vector & __x) { if (&__x == this) return *this; if (__x.size() > capacity()) { _M_deallocate(); _M_initialize(__x.size()); } copy(__x.begin(), __x.end(), begin()); _M_finish = begin() + difference_type(__x.size()); return *this; } void assign(size_t __n, bool __x) { if (__n > size()) { fill(_M_start._M_p, _M_end_of_storage, __x ? ~0 : 0); insert(end(), __n - size(), __x); } else { erase(begin() + __n, end()); fill(_M_start._M_p, _M_end_of_storage, __x ? ~0 : 0); } } template void assign(_InputIterator __first, _InputIterator __last) { typedef typename _Is_integer<_InputIterator>::_Integral _Integral; _M_assign_dispatch(__first, __last, _Integral()); } template void _M_assign_dispatch(_Integer __n, _Integer __val, __true_type) { assign((size_t) __n, (bool) __val); } template void _M_assign_dispatch(_InputIter __first, _InputIter __last, __false_type) { _M_assign_aux(__first, __last, __iterator_category( __first ) ); } template void _M_assign_aux(_InputIterator __first, _InputIterator __last, input_iterator_tag) { iterator __cur = begin(); for ( ; __first != __last && __cur != end(); ++__cur, ++__first) *__cur = *__first; if (__first == __last) erase(__cur, end()); else insert(end(), __first, __last); } template void _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last, forward_iterator_tag) { size_type __len = 0; distance(__first, __last, __len); if (__len < size()) erase(copy(__first, __last, begin()), end()); else { _ForwardIterator __mid = __first; advance(__mid, size()); copy(__first, __mid, begin()); insert(end(), __mid, __last); } } void reserve(size_type __n) { if (capacity() < __n) { unsigned int* __q = _M_bit_alloc(__n); _M_finish = copy(begin(), end(), iterator(__q, 0)); _M_deallocate(); _M_start = iterator(__q, 0); _M_end_of_storage = __q + (__n + __WORD_BIT - 1)/__WORD_BIT; } } reference front() { return *begin(); } const_reference front() const { return *begin(); } reference back() { return *(end() - 1); } const_reference back() const { return *(end() - 1); } void push_back(bool __x) { if (_M_finish._M_p != _M_end_of_storage) *_M_finish++ = __x; else _M_insert_aux(end(), __x); } void swap(vector & __x) { ::swap(_M_start, __x._M_start); ::swap(_M_finish, __x._M_finish); ::swap(_M_end_of_storage, __x._M_end_of_storage); } iterator insert(iterator __position, bool __x = bool()) { difference_type __n = __position - begin(); if (_M_finish._M_p != _M_end_of_storage && __position == end()) *_M_finish++ = __x; else _M_insert_aux(__position, __x); return begin() + __n; } template void insert(iterator __position, _InputIterator __first, _InputIterator __last) { typedef typename _Is_integer<_InputIterator>::_Integral _Integral; _M_insert_dispatch(__position, __first, __last, _Integral()); } template void _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __x, __true_type) { insert(__pos, (size_type) __n, (bool) __x); } template void _M_insert_dispatch(iterator __pos, _InputIterator __first, _InputIterator __last, __false_type) { _M_insert_range(__pos, __first, __last, __iterator_category( __first ) ); } # 761 "/usr/include/g++-3/stl_bvector.h" 3 void insert(iterator __position, size_type __n, bool __x) { if (__n == 0) return; if (capacity() - size() >= __n) { copy_backward(__position, end(), _M_finish + difference_type(__n)); fill(__position, __position + difference_type(__n), __x); _M_finish += difference_type(__n); } else { size_type __len = size() + max(size(), __n); unsigned int* __q = _M_bit_alloc(__len); iterator __i = copy(begin(), __position, iterator(__q, 0)); fill_n(__i, __n, __x); _M_finish = copy(__position, end(), __i + difference_type(__n)); _M_deallocate(); _M_end_of_storage = __q + (__len + __WORD_BIT - 1)/__WORD_BIT; _M_start = iterator(__q, 0); } } void pop_back() { --_M_finish; } iterator erase(iterator __position) { if (__position + 1 != end()) copy(__position + 1, end(), __position); --_M_finish; return __position; } iterator erase(iterator __first, iterator __last) { _M_finish = copy(__last, end(), __first); return __first; } void resize(size_type __new_size, bool __x = bool()) { if (__new_size < size()) erase(begin() + difference_type(__new_size), end()); else insert(end(), __new_size - size(), __x); } void clear() { erase(begin(), end()); } }; typedef vector bit_vector; # 822 "/usr/include/g++-3/stl_bvector.h" 3 # 35 "/usr/include/g++-3/vector" 2 3 # 35 "c_grammar.cpp" 2 # 1 "/usr/include/boost/spirit/spirit.hpp" 1 3 # 1 "/usr/include/boost/spirit/spirit_core.hpp" 1 3 # 1 "/usr/include/boost/spirit/core/composite.hpp" 1 3 # 1 "/usr/include/boost/spirit/spirit_core_fwd.hpp" 1 3 namespace spirit { struct void_t {}; class match_policy; template class local; template struct grammar; class match; class match_policy; class rule_id; template class attr_match; template struct attr_action; template struct remove_wrap { typedef T type; }; struct plain_parser_category {}; struct binary_parser_category : public plain_parser_category {}; struct unary_parser_category : public plain_parser_category {}; struct action_parser_category : public unary_parser_category {}; struct exception_parser_category : public unary_parser_category {}; struct closure_parser_category : public unary_parser_category {}; struct param_parser_category : public closure_parser_category {}; namespace impl { template struct parser_return { typedef typename ParsePolicyT::match_t match_t; }; template struct strip_scanner { typedef T iterator_type; static T get(T ptr) { return ptr; } }; } } # 36 "/usr/include/boost/spirit/core/composite.hpp" 2 3 namespace spirit { template struct embed_trait { typedef T type; }; template struct unary { unary() : subj() {} unary(S const& subj_) : subj(subj_) {} S& subject() { return subj; } S const& subject() const { return subj; } private: typename embed_trait::type subj; }; template struct binary { binary() {} binary(A const& a_, B const& b_) : a(a_), b(b_) {} A& left() { return a; } A const& left() const { return a; } B& right() { return b; } B const& right() const { return b; } private: typename embed_trait::type a; typename embed_trait::type b; }; } # 55 "/usr/include/boost/spirit/spirit_core.hpp" 2 3 # 1 "/usr/include/boost/spirit/core/debug.hpp" 1 3 # 107 "/usr/include/boost/spirit/core/debug.hpp" 3 # 56 "/usr/include/boost/spirit/spirit_core.hpp" 2 3 # 1 "/usr/include/boost/spirit/core/parser.hpp" 1 3 namespace spirit { template class action; template class fixed_loop; template class finite_loop; template class infinite_loop; struct more_t {}; more_t const more = more_t(); namespace impl { template struct loop_traits { typedef finite_loop type; }; template struct loop_traits { typedef infinite_loop type; }; } template struct parser { typedef DerivedT derived_t; typedef plain_parser_category parser_category; parser() {} template action operator[](ActionT const& actor) const; template fixed_loop operator()(EndT const& end) const; template typename impl::loop_traits::type operator()(StartT const& start, EndT const& end) const; template fixed_loop repeat(EndT const& end) const; template typename impl::loop_traits::type repeat(StartT const& start, EndT const& end) const; DerivedT& derived(); DerivedT const& derived() const; template typename impl::parser_return::match_t parse(IteratorT& first, IteratorT const& last) const; template typename impl::parser_return::match_t parse(IteratorT& first, IteratorT const& last, ParsePolicyT const & ) const; }; class match { public: match(); explicit match(unsigned length); match(match const &hit); operator bool() const; match& operator += (match const& other); int length() const; protected: int data; }; match operator + (match const& a, match const& b); struct match_policy { typedef match match_t; static const match_t no_match(); static const match_t empty_match(); template static match_t create_match(int length, Iterator1T const& first, Iterator2T const& last); static void concat(match_t& l, match_t const& r); }; template struct tree_policy { typedef typename ParsePolicyT::match_t match_t; template static match_t create_node(int length, Iterator1T const& first, Iterator2T const& last); template static void apply_op_to_match(FunctorT const& op, match_t& m); template static void set_id_and_group(match_t& m, rule_id id, Iterator1T& first, Iterator2T const& last); }; template struct parse_info { IteratorT stop; bool match; bool full; unsigned length; parse_info() : stop() , match(false) , full(false) , length(0) {} template parse_info(ParseInfoT const& pi) : stop(pi.stop) , match(pi.match) , full(pi.full) , length(pi.length) {} }; template parse_info parse( IteratorT const& first, IteratorT const& last, parser const& parser); template parse_info parse( CharT const* str, parser const& parser); } # 57 "/usr/include/boost/spirit/spirit_core.hpp" 2 3 # 1 "/usr/include/boost/spirit/core/actions.hpp" 1 3 namespace spirit { template class base_action : public unary, public parser { public: typedef action_parser_category parser_category; template typename ParsePolicyT::match_t do_parse(IteratorT& first, IteratorT const& last) const; ActionT const& predicate() const { return actor; } protected: base_action(ParserT const& parser, ActionT const& actor); typename embed_trait::type actor; }; template class action : public base_action > { public: action(ParserT const& parser, ActionT const& actor); }; } # 58 "/usr/include/boost/spirit/spirit_core.hpp" 2 3 # 1 "/usr/include/boost/spirit/core/primitives.hpp" 1 3 # 1 "/usr/include/boost/type_traits.hpp" 1 3 # 1 "/usr/include/boost/type_traits/fwd.hpp" 1 3 # 1 "/usr/include/g++-3/cstdlib" 1 3 #pragma interface "cstdlib" extern "C++" { inline long abs(long x) { return x >= 0 ? x : -x; } } # 14 "/usr/include/boost/type_traits/fwd.hpp" 2 3 # 1 "/usr/include/g++-3/cstddef" 1 3 # 1 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/stddef.h" 1 3 # 345 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/stddef.h" 3 # 6 "/usr/include/g++-3/cstddef" 2 3 # 15 "/usr/include/boost/type_traits/fwd.hpp" 2 3 # 1 "/usr/include/boost/config.hpp" 1 3 # 1 "/usr/include/boost/config/user.hpp" 1 3 # 26 "/usr/include/boost/config.hpp" 2 3 # 1 "/usr/include/boost/config/select_compiler_config.hpp" 1 3 # 77 "/usr/include/boost/config/select_compiler_config.hpp" 3 # 31 "/usr/include/boost/config.hpp" 2 3 # 1 "/usr/include/boost/config/compiler/gcc.hpp" 1 3 # 24 "/usr/include/boost/config/compiler/gcc.hpp" 3 # 35 "/usr/include/boost/config.hpp" 2 3 # 1 "/usr/include/boost/config/select_stdlib_config.hpp" 1 3 # 1 "/usr/include/g++-3/utility" 1 3 # 18 "/usr/include/boost/config/select_stdlib_config.hpp" 2 3 # 38 "/usr/include/boost/config/select_stdlib_config.hpp" 3 # 59 "/usr/include/boost/config/select_stdlib_config.hpp" 3 # 40 "/usr/include/boost/config.hpp" 2 3 # 1 "/usr/include/boost/config/stdlib/sgi.hpp" 1 3 # 39 "/usr/include/boost/config/stdlib/sgi.hpp" 3 # 1 "/usr/include/g++-3/string" 1 3 # 1 "/usr/include/g++-3/std/bastring.h" 1 3 #pragma interface # 1 "/usr/include/g++-3/std/straits.h" 1 3 #pragma interface "std/straits.h" extern "C++" { template struct string_char_traits { typedef charT char_type; static void assign (char_type& c1, const char_type& c2) { c1 = c2; } static bool eq (const char_type& c1, const char_type& c2) { return (c1 == c2); } static bool ne (const char_type& c1, const char_type& c2) { return !(c1 == c2); } static bool lt (const char_type& c1, const char_type& c2) { return (c1 < c2); } static char_type eos () { return char_type(); } static bool is_del(char_type a) { return 0; } static int compare (const char_type* s1, const char_type* s2, size_t n) { size_t i; for (i = 0; i < n; ++i) if (ne (s1[i], s2[i])) return lt (s1[i], s2[i]) ? -1 : 1; return 0; } static size_t length (const char_type* s) { size_t l = 0; while (ne (*s++, eos ())) ++l; return l; } static char_type* copy (char_type* s1, const char_type* s2, size_t n) { for (; n--; ) assign (s1[n], s2[n]); return s1; } static char_type* move (char_type* s1, const char_type* s2, size_t n) { char_type a[n]; size_t i; for (i = 0; i < n; ++i) assign (a[i], s2[i]); for (i = 0; i < n; ++i) assign (s1[i], a[i]); return s1; } static char_type* set (char_type* s1, const char_type& c, size_t n) { for (; n--; ) assign (s1[n], c); return s1; } }; class istream; class ostream; # 1 "/usr/include/g++-3/cctype" 1 3 # 1 "/usr/include/ctype.h" 1 3 extern "C" { int __attribute__((__cdecl__)) isalnum (int __c) ; int __attribute__((__cdecl__)) isalpha (int __c) ; int __attribute__((__cdecl__)) iscntrl (int __c) ; int __attribute__((__cdecl__)) isdigit (int __c) ; int __attribute__((__cdecl__)) isgraph (int __c) ; int __attribute__((__cdecl__)) islower (int __c) ; int __attribute__((__cdecl__)) isprint (int __c) ; int __attribute__((__cdecl__)) ispunct (int __c) ; int __attribute__((__cdecl__)) isspace (int __c) ; int __attribute__((__cdecl__)) isupper (int __c) ; int __attribute__((__cdecl__)) isxdigit (int __c) ; int __attribute__((__cdecl__)) tolower (int __c) ; int __attribute__((__cdecl__)) toupper (int __c) ; int __attribute__((__cdecl__)) isascii (int __c) ; int __attribute__((__cdecl__)) toascii (int __c) ; int __attribute__((__cdecl__)) _tolower (int __c) ; int __attribute__((__cdecl__)) _toupper (int __c) ; extern __attribute__(( dllimport )) const char _ctype_[]; # 61 "/usr/include/ctype.h" 3 } # 6 "/usr/include/g++-3/cctype" 2 3 # 105 "/usr/include/g++-3/std/straits.h" 2 3 # 1 "/usr/include/g++-3/cstring" 1 3 # 94 "/usr/include/g++-3/cstring" 3 # 106 "/usr/include/g++-3/std/straits.h" 2 3 struct string_char_traits { typedef char char_type; static void assign (char_type& c1, const char_type& c2) { c1 = c2; } static bool eq (const char_type & c1, const char_type& c2) { return (c1 == c2); } static bool ne (const char_type& c1, const char_type& c2) { return (c1 != c2); } static bool lt (const char_type& c1, const char_type& c2) { return (c1 < c2); } static char_type eos () { return 0; } static bool is_del(char_type a) { return isspace(a); } static int compare (const char_type* s1, const char_type* s2, size_t n) { return memcmp (s1, s2, n); } static size_t length (const char_type* s) { return strlen (s); } static char_type* copy (char_type* s1, const char_type* s2, size_t n) { return (char_type*) memcpy (s1, s2, n); } static char_type* move (char_type* s1, const char_type* s2, size_t n) { return (char_type*) memmove (s1, s2, n); } static char_type* set (char_type* s1, const char_type& c, size_t n) { return (char_type*) memset (s1, c, n); } }; # 159 "/usr/include/g++-3/std/straits.h" 3 } # 36 "/usr/include/g++-3/std/bastring.h" 2 3 # 1 "/usr/include/g++-3/alloc.h" 1 3 # 40 "/usr/include/g++-3/alloc.h" 3 # 39 "/usr/include/g++-3/std/bastring.h" 2 3 extern "C++" { class istream; class ostream; # 1 "/usr/include/g++-3/iterator" 1 3 # 1 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/stddef.h" 1 3 # 345 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/stddef.h" 3 # 32 "/usr/include/g++-3/iterator" 2 3 # 44 "/usr/include/g++-3/std/bastring.h" 2 3 extern void __out_of_range (const char *); extern void __length_error (const char *); template , class Allocator = alloc > class basic_string { private: struct Rep { size_t len, res, ref; bool selfish; charT* data () { return reinterpret_cast(this + 1); } charT& operator[] (size_t s) { return data () [s]; } charT* grab () { if (selfish) return clone (); ++ref; return data (); } void release () { size_t __val; asm (".byte 0xf0, 0x0f, 0xc1, 0x02" : "=a" (__val) : "0" (-1), "m" (ref), "d" (&ref) : "memory"); if (__val == 1) delete this; } # 110 "/usr/include/g++-3/std/bastring.h" 3 inline static void * operator new (size_t, size_t); inline static void operator delete (void *); inline static Rep* create (size_t); charT* clone (); inline void copy (size_t, const charT *, size_t); inline void move (size_t, const charT *, size_t); inline void set (size_t, const charT, size_t); inline static bool excess_slop (size_t, size_t); inline static size_t frob_size (size_t); private: Rep &operator= (const Rep &); }; public: typedef traits traits_type; typedef typename traits::char_type value_type; typedef Allocator allocator_type; typedef size_t size_type; typedef ptrdiff_t difference_type; typedef charT& reference; typedef const charT& const_reference; typedef charT* pointer; typedef const charT* const_pointer; typedef pointer iterator; typedef const_pointer const_iterator; typedef ::reverse_iterator reverse_iterator; typedef ::reverse_iterator const_reverse_iterator; static const size_type npos = static_cast(-1); private: Rep *rep () const { return reinterpret_cast(dat) - 1; } void repup (Rep *p) { rep ()->release (); dat = p->data (); } public: const charT* data () const { return rep ()->data(); } size_type length () const { return rep ()->len; } size_type size () const { return rep ()->len; } size_type capacity () const { return rep ()->res; } size_type max_size () const { return (npos - 1)/sizeof (charT); } bool empty () const { return size () == 0; } basic_string& operator= (const basic_string& str) { if (&str != this) { rep ()->release (); dat = str.rep ()->grab (); } return *this; } explicit basic_string (): dat (nilRep.grab ()) { } basic_string (const basic_string& str): dat (str.rep ()->grab ()) { } basic_string (const basic_string& str, size_type pos, size_type n = npos) : dat (nilRep.grab ()) { assign (str, pos, n); } basic_string (const charT* s, size_type n) : dat (nilRep.grab ()) { assign (s, n); } basic_string (const charT* s) : dat (nilRep.grab ()) { assign (s); } basic_string (size_type n, charT c) : dat (nilRep.grab ()) { assign (n, c); } template basic_string(InputIterator __begin, InputIterator __end) : dat (nilRep.grab ()) { assign (__begin, __end); } ~basic_string () { rep ()->release (); } void swap (basic_string &s) { charT *d = dat; dat = s.dat; s.dat = d; } basic_string& append (const basic_string& str, size_type pos = 0, size_type n = npos) { return replace (length (), 0, str, pos, n); } basic_string& append (const charT* s, size_type n) { return replace (length (), 0, s, n); } basic_string& append (const charT* s) { return append (s, traits::length (s)); } basic_string& append (size_type n, charT c) { return replace (length (), 0, n, c); } template basic_string& append(InputIterator first, InputIterator last) { return replace (iend (), iend (), first, last); } void push_back(charT __c) { append(1, __c); } basic_string& assign (const basic_string& str, size_type pos = 0, size_type n = npos) { return replace (0, npos, str, pos, n); } basic_string& assign (const charT* s, size_type n) { return replace (0, npos, s, n); } basic_string& assign (const charT* s) { return assign (s, traits::length (s)); } basic_string& assign (size_type n, charT c) { return replace (0, npos, n, c); } template basic_string& assign(InputIterator first, InputIterator last) { return replace (ibegin (), iend (), first, last); } basic_string& operator= (const charT* s) { return assign (s); } basic_string& operator= (charT c) { return assign (1, c); } basic_string& operator+= (const basic_string& rhs) { return append (rhs); } basic_string& operator+= (const charT* s) { return append (s); } basic_string& operator+= (charT c) { return append (1, c); } basic_string& insert (size_type pos1, const basic_string& str, size_type pos2 = 0, size_type n = npos) { return replace (pos1, 0, str, pos2, n); } basic_string& insert (size_type pos, const charT* s, size_type n) { return replace (pos, 0, s, n); } basic_string& insert (size_type pos, const charT* s) { return insert (pos, s, traits::length (s)); } basic_string& insert (size_type pos, size_type n, charT c) { return replace (pos, 0, n, c); } iterator insert(iterator p, charT c) { size_type __o = p - ibegin (); insert (p - ibegin (), 1, c); selfish (); return ibegin () + __o; } iterator insert(iterator p, size_type n, charT c) { size_type __o = p - ibegin (); insert (p - ibegin (), n, c); selfish (); return ibegin () + __o; } template void insert(iterator p, InputIterator first, InputIterator last) { replace (p, p, first, last); } basic_string& erase (size_type pos = 0, size_type n = npos) { return replace (pos, n, (size_type)0, (charT)0); } iterator erase(iterator p) { size_type __o = p - begin(); replace (__o, 1, (size_type)0, (charT)0); selfish (); return ibegin() + __o; } iterator erase(iterator f, iterator l) { size_type __o = f - ibegin(); replace (__o, l-f, (size_type)0, (charT)0);selfish (); return ibegin() + __o; } basic_string& replace (size_type pos1, size_type n1, const basic_string& str, size_type pos2 = 0, size_type n2 = npos); basic_string& replace (size_type pos, size_type n1, const charT* s, size_type n2); basic_string& replace (size_type pos, size_type n1, const charT* s) { return replace (pos, n1, s, traits::length (s)); } basic_string& replace (size_type pos, size_type n1, size_type n2, charT c); basic_string& replace (size_type pos, size_type n, charT c) { return replace (pos, n, 1, c); } basic_string& replace (iterator i1, iterator i2, const basic_string& str) { return replace (i1 - ibegin (), i2 - i1, str); } basic_string& replace (iterator i1, iterator i2, const charT* s, size_type n) { return replace (i1 - ibegin (), i2 - i1, s, n); } basic_string& replace (iterator i1, iterator i2, const charT* s) { return replace (i1 - ibegin (), i2 - i1, s); } basic_string& replace (iterator i1, iterator i2, size_type n, charT c) { return replace (i1 - ibegin (), i2 - i1, n, c); } template basic_string& replace(iterator i1, iterator i2, InputIterator j1, InputIterator j2); private: static charT eos () { return traits::eos (); } void unique () { if (rep ()->ref > 1) alloc (length (), true); } void selfish () { unique (); rep ()->selfish = true; } public: charT operator[] (size_type pos) const { if (pos == length ()) return eos (); return data ()[pos]; } reference operator[] (size_type pos) { selfish (); return (*rep ())[pos]; } reference at (size_type pos) { do { if ( pos >= length () ) __out_of_range ("pos >= length ()"); } while (0) ; return (*this)[pos]; } const_reference at (size_type pos) const { do { if ( pos >= length () ) __out_of_range ("pos >= length ()"); } while (0) ; return data ()[pos]; } private: void terminate () const { traits::assign ((*rep ())[length ()], eos ()); } public: const charT* c_str () const { if (length () == 0) return ""; terminate (); return data (); } void resize (size_type n, charT c); void resize (size_type n) { resize (n, eos ()); } void reserve (size_type) { } size_type copy (charT* s, size_type n, size_type pos = 0) const; size_type find (const basic_string& str, size_type pos = 0) const { return find (str.data(), pos, str.length()); } size_type find (const charT* s, size_type pos, size_type n) const; size_type find (const charT* s, size_type pos = 0) const { return find (s, pos, traits::length (s)); } size_type find (charT c, size_type pos = 0) const; size_type rfind (const basic_string& str, size_type pos = npos) const { return rfind (str.data(), pos, str.length()); } size_type rfind (const charT* s, size_type pos, size_type n) const; size_type rfind (const charT* s, size_type pos = npos) const { return rfind (s, pos, traits::length (s)); } size_type rfind (charT c, size_type pos = npos) const; size_type find_first_of (const basic_string& str, size_type pos = 0) const { return find_first_of (str.data(), pos, str.length()); } size_type find_first_of (const charT* s, size_type pos, size_type n) const; size_type find_first_of (const charT* s, size_type pos = 0) const { return find_first_of (s, pos, traits::length (s)); } size_type find_first_of (charT c, size_type pos = 0) const { return find (c, pos); } size_type find_last_of (const basic_string& str, size_type pos = npos) const { return find_last_of (str.data(), pos, str.length()); } size_type find_last_of (const charT* s, size_type pos, size_type n) const; size_type find_last_of (const charT* s, size_type pos = npos) const { return find_last_of (s, pos, traits::length (s)); } size_type find_last_of (charT c, size_type pos = npos) const { return rfind (c, pos); } size_type find_first_not_of (const basic_string& str, size_type pos = 0) const { return find_first_not_of (str.data(), pos, str.length()); } size_type find_first_not_of (const charT* s, size_type pos, size_type n) const; size_type find_first_not_of (const charT* s, size_type pos = 0) const { return find_first_not_of (s, pos, traits::length (s)); } size_type find_first_not_of (charT c, size_type pos = 0) const; size_type find_last_not_of (const basic_string& str, size_type pos = npos) const { return find_last_not_of (str.data(), pos, str.length()); } size_type find_last_not_of (const charT* s, size_type pos, size_type n) const; size_type find_last_not_of (const charT* s, size_type pos = npos) const { return find_last_not_of (s, pos, traits::length (s)); } size_type find_last_not_of (charT c, size_type pos = npos) const; basic_string substr (size_type pos = 0, size_type n = npos) const { return basic_string (*this, pos, n); } int compare (const basic_string& str, size_type pos = 0, size_type n = npos) const; int compare (const charT* s, size_type pos, size_type n) const; int compare (const charT* s, size_type pos = 0) const { return compare (s, pos, traits::length (s)); } iterator begin () { selfish (); return &(*this)[0]; } iterator end () { selfish (); return &(*this)[length ()]; } private: iterator ibegin () const { return &(*rep ())[0]; } iterator iend () const { return &(*rep ())[length ()]; } public: const_iterator begin () const { return ibegin (); } const_iterator end () const { return iend (); } reverse_iterator rbegin() { return reverse_iterator (end ()); } const_reverse_iterator rbegin() const { return const_reverse_iterator (end ()); } reverse_iterator rend() { return reverse_iterator (begin ()); } const_reverse_iterator rend() const { return const_reverse_iterator (begin ()); } private: void alloc (size_type size, bool save); static size_type _find (const charT* ptr, charT c, size_type xpos, size_type len); inline bool check_realloc (size_type s) const; static Rep nilRep; charT *dat; }; template template basic_string & basic_string :: replace (iterator i1, iterator i2, InputIterator j1, InputIterator j2) { const size_type len = length (); size_type pos = i1 - ibegin (); size_type n1 = i2 - i1; size_type n2 = j2 - j1; do { if ( pos > len ) __out_of_range ("pos > len"); } while (0) ; if (n1 > len - pos) n1 = len - pos; do { if ( len - n1 > max_size () - n2 ) __length_error ("len - n1 > max_size () - n2"); } while (0) ; size_t newlen = len - n1 + n2; if (check_realloc (newlen)) { Rep *p = Rep::create (newlen); p->copy (0, data (), pos); p->copy (pos + n2, data () + pos + n1, len - (pos + n1)); for (; j1 != j2; ++j1, ++pos) traits::assign ((*p)[pos], *j1); repup (p); } else { rep ()->move (pos + n2, data () + pos + n1, len - (pos + n1)); for (; j1 != j2; ++j1, ++pos) traits::assign ((*rep ())[pos], *j1); } rep ()->len = newlen; return *this; } template inline basic_string operator+ (const basic_string & lhs, const basic_string & rhs) { basic_string str (lhs); str.append (rhs); return str; } template inline basic_string operator+ (const charT* lhs, const basic_string & rhs) { basic_string str (lhs); str.append (rhs); return str; } template inline basic_string operator+ (charT lhs, const basic_string & rhs) { basic_string str (1, lhs); str.append (rhs); return str; } template inline basic_string operator+ (const basic_string & lhs, const charT* rhs) { basic_string str (lhs); str.append (rhs); return str; } template inline basic_string operator+ (const basic_string & lhs, charT rhs) { basic_string str (lhs); str.append (1, rhs); return str; } template inline bool operator== (const basic_string & lhs, const basic_string & rhs) { return (lhs.compare (rhs) == 0); } template inline bool operator== (const charT* lhs, const basic_string & rhs) { return (rhs.compare (lhs) == 0); } template inline bool operator== (const basic_string & lhs, const charT* rhs) { return (lhs.compare (rhs) == 0); } template inline bool operator!= (const charT* lhs, const basic_string & rhs) { return (rhs.compare (lhs) != 0); } template inline bool operator!= (const basic_string & lhs, const charT* rhs) { return (lhs.compare (rhs) != 0); } template inline bool operator< (const basic_string & lhs, const basic_string & rhs) { return (lhs.compare (rhs) < 0); } template inline bool operator< (const charT* lhs, const basic_string & rhs) { return (rhs.compare (lhs) > 0); } template inline bool operator< (const basic_string & lhs, const charT* rhs) { return (lhs.compare (rhs) < 0); } template inline bool operator> (const charT* lhs, const basic_string & rhs) { return (rhs.compare (lhs) < 0); } template inline bool operator> (const basic_string & lhs, const charT* rhs) { return (lhs.compare (rhs) > 0); } template inline bool operator<= (const charT* lhs, const basic_string & rhs) { return (rhs.compare (lhs) >= 0); } template inline bool operator<= (const basic_string & lhs, const charT* rhs) { return (lhs.compare (rhs) <= 0); } template inline bool operator>= (const charT* lhs, const basic_string & rhs) { return (rhs.compare (lhs) <= 0); } template inline bool operator>= (const basic_string & lhs, const charT* rhs) { return (lhs.compare (rhs) >= 0); } template inline bool operator!= (const basic_string & lhs, const basic_string & rhs) { return (lhs.compare (rhs) != 0); } template inline bool operator> (const basic_string & lhs, const basic_string & rhs) { return (lhs.compare (rhs) > 0); } template inline bool operator<= (const basic_string & lhs, const basic_string & rhs) { return (lhs.compare (rhs) <= 0); } template inline bool operator>= (const basic_string & lhs, const basic_string & rhs) { return (lhs.compare (rhs) >= 0); } class istream; class ostream; template istream& operator>> (istream&, basic_string &); template ostream& operator<< (ostream&, const basic_string &); template istream& getline (istream&, basic_string &, charT delim = '\n'); } # 1 "/usr/include/g++-3/std/bastring.cc" 1 3 extern "C++" { template inline void * basic_string ::Rep:: operator new (size_t s, size_t extra) { return Allocator::allocate(s + extra * sizeof (charT)); } template inline void basic_string ::Rep:: operator delete (void * ptr) { Allocator::deallocate(ptr, sizeof(Rep) + reinterpret_cast(ptr)->res * sizeof (charT)); } template inline size_t basic_string ::Rep:: frob_size (size_t s) { size_t i = 16; while (i < s) i *= 2; return i; } template inline basic_string ::Rep * basic_string ::Rep:: create (size_t extra) { extra = frob_size (extra + 1); Rep *p = new (extra) Rep; p->res = extra; p->ref = 1; p->selfish = false; return p; } template charT * basic_string ::Rep:: clone () { Rep *p = Rep::create (len); p->copy (0, data (), len); p->len = len; return p->data (); } template inline bool basic_string ::Rep:: excess_slop (size_t s, size_t r) { return 2 * (s <= 16 ? 16 : s) < r; } template inline bool basic_string :: check_realloc (basic_string::size_type s) const { s += sizeof (charT); rep ()->selfish = false; return (rep ()->ref > 1 || s > capacity () || Rep::excess_slop (s, capacity ())); } template void basic_string :: alloc (basic_string::size_type __size, bool __save) { if (! check_realloc (__size)) return; Rep *p = Rep::create (__size); if (__save) { p->copy (0, data (), length ()); p->len = length (); } else p->len = 0; repup (p); } template basic_string & basic_string :: replace (size_type pos1, size_type n1, const basic_string& str, size_type pos2, size_type n2) { const size_t len2 = str.length (); if (pos1 == 0 && n1 >= length () && pos2 == 0 && n2 >= len2) return operator= (str); do { if ( pos2 > len2 ) __out_of_range ("pos2 > len2"); } while (0) ; if (n2 > len2 - pos2) n2 = len2 - pos2; return replace (pos1, n1, str.data () + pos2, n2); } template inline void basic_string ::Rep:: copy (size_t pos, const charT *s, size_t n) { if (n) traits::copy (data () + pos, s, n); } template inline void basic_string ::Rep:: move (size_t pos, const charT *s, size_t n) { if (n) traits::move (data () + pos, s, n); } template basic_string & basic_string :: replace (size_type pos, size_type n1, const charT* s, size_type n2) { const size_type len = length (); do { if ( pos > len ) __out_of_range ("pos > len"); } while (0) ; if (n1 > len - pos) n1 = len - pos; do { if ( len - n1 > max_size () - n2 ) __length_error ("len - n1 > max_size () - n2"); } while (0) ; size_t newlen = len - n1 + n2; if (check_realloc (newlen)) { Rep *p = Rep::create (newlen); p->copy (0, data (), pos); p->copy (pos + n2, data () + pos + n1, len - (pos + n1)); p->copy (pos, s, n2); repup (p); } else { rep ()->move (pos + n2, data () + pos + n1, len - (pos + n1)); rep ()->copy (pos, s, n2); } rep ()->len = newlen; return *this; } template inline void basic_string ::Rep:: set (size_t pos, const charT c, size_t n) { traits::set (data () + pos, c, n); } template basic_string & basic_string :: replace (size_type pos, size_type n1, size_type n2, charT c) { const size_t len = length (); do { if ( pos > len ) __out_of_range ("pos > len"); } while (0) ; if (n1 > len - pos) n1 = len - pos; do { if ( len - n1 > max_size () - n2 ) __length_error ("len - n1 > max_size () - n2"); } while (0) ; size_t newlen = len - n1 + n2; if (check_realloc (newlen)) { Rep *p = Rep::create (newlen); p->copy (0, data (), pos); p->copy (pos + n2, data () + pos + n1, len - (pos + n1)); p->set (pos, c, n2); repup (p); } else { rep ()->move (pos + n2, data () + pos + n1, len - (pos + n1)); rep ()->set (pos, c, n2); } rep ()->len = newlen; return *this; } template void basic_string :: resize (size_type n, charT c) { do { if ( n > max_size () ) __length_error ("n > max_size ()"); } while (0) ; if (n > length ()) append (n - length (), c); else erase (n); } template basic_string ::size_type basic_string :: copy (charT* s, size_type n, size_type pos) const { do { if ( pos > length () ) __out_of_range ("pos > length ()"); } while (0) ; if (n > length () - pos) n = length () - pos; traits::copy (s, data () + pos, n); return n; } template basic_string ::size_type basic_string :: find (const charT* s, size_type pos, size_type n) const { size_t xpos = pos; for (; xpos + n <= length (); ++xpos) if (traits::eq (data () [xpos], *s) && traits::compare (data () + xpos, s, n) == 0) return xpos; return npos; } template inline basic_string ::size_type basic_string :: _find (const charT* ptr, charT c, size_type xpos, size_type len) { for (; xpos < len; ++xpos) if (traits::eq (ptr [xpos], c)) return xpos; return npos; } template basic_string ::size_type basic_string :: find (charT c, size_type pos) const { return _find (data (), c, pos, length ()); } template basic_string ::size_type basic_string :: rfind (const charT* s, size_type pos, size_type n) const { if (n > length ()) return npos; size_t xpos = length () - n; if (xpos > pos) xpos = pos; for (++xpos; xpos-- > 0; ) if (traits::eq (data () [xpos], *s) && traits::compare (data () + xpos, s, n) == 0) return xpos; return npos; } template basic_string ::size_type basic_string :: rfind (charT c, size_type pos) const { if (1 > length ()) return npos; size_t xpos = length () - 1; if (xpos > pos) xpos = pos; for (++xpos; xpos-- > 0; ) if (traits::eq (data () [xpos], c)) return xpos; return npos; } template basic_string ::size_type basic_string :: find_first_of (const charT* s, size_type pos, size_type n) const { size_t xpos = pos; for (; xpos < length (); ++xpos) if (_find (s, data () [xpos], 0, n) != npos) return xpos; return npos; } template basic_string ::size_type basic_string :: find_last_of (const charT* s, size_type pos, size_type n) const { if (length() == 0) return npos; size_t xpos = length () - 1; if (xpos > pos) xpos = pos; for (++xpos; xpos-- > 0;) if (_find (s, data () [xpos], 0, n) != npos) return xpos; return npos; } template basic_string ::size_type basic_string :: find_first_not_of (const charT* s, size_type pos, size_type n) const { size_t xpos = pos; for (; xpos < length (); ++xpos) if (_find (s, data () [xpos], 0, n) == npos) return xpos; return npos; } template basic_string ::size_type basic_string :: find_first_not_of (charT c, size_type pos) const { size_t xpos = pos; for (; xpos < length (); ++xpos) if (traits::ne (data () [xpos], c)) return xpos; return npos; } template basic_string ::size_type basic_string :: find_last_not_of (const charT* s, size_type pos, size_type n) const { if (length() == 0) return npos; size_t xpos = length () - 1; if (xpos > pos) xpos = pos; for (++xpos; xpos-- > 0;) if (_find (s, data () [xpos], 0, n) == npos) return xpos; return npos; } template basic_string ::size_type basic_string :: find_last_not_of (charT c, size_type pos) const { if (length() == 0) return npos; size_t xpos = length () - 1; if (xpos > pos) xpos = pos; for (++xpos; xpos-- > 0;) if (traits::ne (data () [xpos], c)) return xpos; return npos; } template int basic_string :: compare (const basic_string& str, size_type pos, size_type n) const { do { if ( pos > length () ) __out_of_range ("pos > length ()"); } while (0) ; size_t rlen = length () - pos; if (rlen > n) rlen = n; if (rlen > str.length ()) rlen = str.length (); int r = traits::compare (data () + pos, str.data (), rlen); if (r != 0) return r; if (rlen == n) return 0; return (length () - pos) - str.length (); } template int basic_string :: compare (const charT* s, size_type pos, size_type n) const { do { if ( pos > length () ) __out_of_range ("pos > length ()"); } while (0) ; size_t rlen = length () - pos; if (rlen > n) rlen = n; int r = traits::compare (data () + pos, s, rlen); if (r != 0) return r; return (length () - pos) - n; } template istream & operator>> (istream &is, basic_string &s) { int w = is.width (0); if (is.ipfx0 ()) { register streambuf *sb = is.rdbuf (); s.resize (0); while (1) { int ch = sb->sbumpc (); if (ch == (-1) ) { is.setstate (ios::eofbit); break; } else if (traits::is_del (ch)) { sb->sungetc (); break; } s += static_cast (ch); if (--w == 1) break; } } is.isfx (); if (s.length () == 0) is.setstate (ios::failbit); return is; } template ostream & operator<< (ostream &o, const basic_string & s) { return o.write (s.data (), s.length ()); } template istream& getline (istream &is, basic_string & s, charT delim) { if (is.ipfx1 ()) { _G_size_t count = 0; streambuf *sb = is.rdbuf (); s.resize (0); while (1) { int ch = sb->sbumpc (); if (ch == (-1) ) { is.setstate (count == 0 ? (ios::failbit|ios::eofbit) : ios::eofbit); break; } ++count; if (ch == delim) break; s += static_cast (ch); if (s.length () == s.npos - 1) { is.setstate (ios::failbit); break; } } } is.isfx (); return is; } template basic_string ::Rep basic_string::nilRep = { 0, 0, 1, false }; template const basic_string ::size_type basic_string ::npos; } # 655 "/usr/include/g++-3/std/bastring.h" 2 3 # 6 "/usr/include/g++-3/string" 2 3 extern "C++" { typedef basic_string string; } # 82 "/usr/include/boost/config/stdlib/sgi.hpp" 2 3 # 44 "/usr/include/boost/config.hpp" 2 3 # 1 "/usr/include/boost/config/select_platform_config.hpp" 1 3 # 35 "/usr/include/boost/config/select_platform_config.hpp" 3 # 78 "/usr/include/boost/config/select_platform_config.hpp" 3 # 49 "/usr/include/boost/config.hpp" 2 3 # 1 "/usr/include/boost/config/platform/cygwin.hpp" 1 3 # 1 "/usr/include/unistd.h" 1 3 # 1 "/usr/include/sys/unistd.h" 1 3 extern "C" { # 1 "/usr/include/sys/types.h" 1 3 # 1 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/stddef.h" 1 3 # 345 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/stddef.h" 3 # 31 "/usr/include/sys/types.h" 2 3 # 1 "/usr/include/machine/types.h" 1 3 # 32 "/usr/include/sys/types.h" 2 3 typedef unsigned char u_char; typedef unsigned short u_short; typedef unsigned int u_int; typedef unsigned long u_long; typedef unsigned short ushort; typedef unsigned int uint; typedef unsigned long clock_t; typedef long time_t; struct timespec { time_t tv_sec; long tv_nsec; }; struct itimerspec { struct timespec it_interval; struct timespec it_value; }; typedef long daddr_t; typedef char * caddr_t; typedef unsigned long ino_t; typedef unsigned long vm_offset_t; typedef unsigned long vm_size_t; typedef char int8_t; typedef unsigned char u_int8_t; typedef short int16_t; typedef unsigned short u_int16_t; typedef int int32_t; typedef unsigned int u_int32_t; typedef long long int64_t; typedef unsigned long long u_int64_t; typedef int32_t register_t; typedef short dev_t; typedef long off_t; typedef unsigned short uid_t; typedef unsigned short gid_t; typedef int pid_t; typedef long key_t; typedef long ssize_t; typedef char * addr_t; typedef int mode_t; # 152 "/usr/include/sys/types.h" 3 typedef unsigned short nlink_t; typedef long fd_mask; typedef struct _types_fd_set { fd_mask fds_bits[((( 64 )+(( (sizeof (fd_mask) * 8 ) )-1))/( (sizeof (fd_mask) * 8 ) )) ]; } _types_fd_set; typedef unsigned long clockid_t; typedef unsigned long timer_t; typedef long useconds_t; # 1 "/usr/include/sys/features.h" 1 3 extern "C" { # 72 "/usr/include/sys/features.h" 3 } # 225 "/usr/include/sys/types.h" 2 3 # 328 "/usr/include/sys/types.h" 3 # 1 "/usr/include/cygwin/types.h" 1 3 extern "C" { typedef void *pthread_t; typedef void *pthread_mutex_t; typedef void *pthread_key_t; typedef void *pthread_attr_t; typedef void *pthread_mutexattr_t; typedef void *pthread_condattr_t; typedef void *pthread_cond_t; typedef struct { pthread_mutex_t mutex; int state; } pthread_once_t; typedef void *pthread_rwlock_t; typedef void *pthread_rwlockattr_t; # 58 "/usr/include/cygwin/types.h" 3 } # 330 "/usr/include/sys/types.h" 2 3 # 9 "/usr/include/sys/unistd.h" 2 3 # 1 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/stddef.h" 1 3 # 21 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/stddef.h" 3 # 63 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/stddef.h" 3 # 128 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/stddef.h" 3 # 190 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/stddef.h" 3 # 271 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/stddef.h" 3 # 319 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/stddef.h" 3 # 13 "/usr/include/sys/unistd.h" 2 3 extern char **environ; void __attribute__((__cdecl__)) _exit (int __status ) __attribute__ ( (noreturn) ) ; int __attribute__((__cdecl__)) access (const char *__path, int __amode ) ; unsigned __attribute__((__cdecl__)) alarm (unsigned __secs ) ; int __attribute__((__cdecl__)) chdir (const char *__path ) ; int __attribute__((__cdecl__)) chmod (const char *__path, mode_t __mode ) ; int __attribute__((__cdecl__)) chown (const char *__path, uid_t __owner, gid_t __group ) ; int __attribute__((__cdecl__)) chroot (const char *__path ) ; int __attribute__((__cdecl__)) close (int __fildes ) ; char __attribute__((__cdecl__)) *ctermid (char *__s ) ; char __attribute__((__cdecl__)) *cuserid (char *__s ) ; int __attribute__((__cdecl__)) dup (int __fildes ) ; int __attribute__((__cdecl__)) dup2 (int __fildes, int __fildes2 ) ; void __attribute__((__cdecl__)) endusershell (void) ; int __attribute__((__cdecl__)) execl (const char *__path, const char *, ... ) ; int __attribute__((__cdecl__)) execle (const char *__path, const char *, ... ) ; int __attribute__((__cdecl__)) execlp (const char *__file, const char *, ... ) ; int __attribute__((__cdecl__)) execv (const char *__path, char * const __argv[] ) ; int __attribute__((__cdecl__)) execve (const char *__path, char * const __argv[], char * const __envp[] ) ; int __attribute__((__cdecl__)) execvp (const char *__file, char * const __argv[] ) ; int __attribute__((__cdecl__)) fchdir (int __fildes) ; int __attribute__((__cdecl__)) fchmod (int __fildes, mode_t __mode ) ; int __attribute__((__cdecl__)) fchown (int __fildes, uid_t __owner, gid_t __group ) ; pid_t __attribute__((__cdecl__)) fork (void ) ; long __attribute__((__cdecl__)) fpathconf (int __fd, int __name ) ; int __attribute__((__cdecl__)) fsync (int __fd) ; char __attribute__((__cdecl__)) *getcwd (char *__buf, size_t __size ) ; gid_t __attribute__((__cdecl__)) getegid (void ) ; uid_t __attribute__((__cdecl__)) geteuid (void ) ; gid_t __attribute__((__cdecl__)) getgid (void ) ; int __attribute__((__cdecl__)) getgroups (int __gidsetsize, gid_t __grouplist[] ) ; char __attribute__((__cdecl__)) *getlogin (void ) ; int __attribute__((__cdecl__)) getlogin_r (char *name, size_t namesize) ; char __attribute__((__cdecl__)) *getpass (__const char *__prompt) ; size_t __attribute__((__cdecl__)) getpagesize (void) ; pid_t __attribute__((__cdecl__)) getpgid (pid_t) ; pid_t __attribute__((__cdecl__)) getpgrp (void ) ; pid_t __attribute__((__cdecl__)) getpid (void ) ; pid_t __attribute__((__cdecl__)) getppid (void ) ; uid_t __attribute__((__cdecl__)) getuid (void ) ; char * __attribute__((__cdecl__)) getusershell (void) ; char __attribute__((__cdecl__)) *getwd (char *__buf ) ; int __attribute__((__cdecl__)) iruserok (unsigned long raddr, int superuser, const char *ruser, const char *luser) ; int __attribute__((__cdecl__)) isatty (int __fildes ) ; int __attribute__((__cdecl__)) lchown (const char *__path, uid_t __owner, gid_t __group ) ; int __attribute__((__cdecl__)) link (const char *__path1, const char *__path2 ) ; int __attribute__((__cdecl__)) nice (int __nice_value ) ; off_t __attribute__((__cdecl__)) lseek (int __fildes, off_t __offset, int __whence ) ; long __attribute__((__cdecl__)) pathconf (const char *__path, int __name ) ; int __attribute__((__cdecl__)) pause (void ) ; int __attribute__((__cdecl__)) pthread_atfork (void (*)(void), void (*)(void), void (*)(void)) ; int __attribute__((__cdecl__)) pipe (int __fildes[2] ) ; _ssize_t __attribute__((__cdecl__)) read (int __fd, void *__buf, size_t __nbyte ) ; int __attribute__((__cdecl__)) revoke (char *path) ; int __attribute__((__cdecl__)) rmdir (const char *__path ) ; int __attribute__((__cdecl__)) ruserok (const char *rhost, int superuser, const char *ruser, const char *luser) ; void * __attribute__((__cdecl__)) sbrk (size_t __incr) ; int __attribute__((__cdecl__)) setegid (gid_t __gid ) ; int __attribute__((__cdecl__)) seteuid (uid_t __uid ) ; int __attribute__((__cdecl__)) setgid (gid_t __gid ) ; int __attribute__((__cdecl__)) setpgid (pid_t __pid, pid_t __pgid ) ; int __attribute__((__cdecl__)) setpgrp (void ) ; pid_t __attribute__((__cdecl__)) setsid (void ) ; int __attribute__((__cdecl__)) setuid (uid_t __uid ) ; void __attribute__((__cdecl__)) setusershell (void) ; unsigned __attribute__((__cdecl__)) sleep (unsigned int __seconds ) ; void __attribute__((__cdecl__)) swab (const void *, void *, ssize_t) ; long __attribute__((__cdecl__)) sysconf (int __name ) ; pid_t __attribute__((__cdecl__)) tcgetpgrp (int __fildes ) ; int __attribute__((__cdecl__)) tcsetpgrp (int __fildes, pid_t __pgrp_id ) ; char __attribute__((__cdecl__)) *ttyname (int __fildes ) ; int __attribute__((__cdecl__)) unlink (const char *__path ) ; int __attribute__((__cdecl__)) vhangup (void ) ; _ssize_t __attribute__((__cdecl__)) write (int __fd, const void *__buf, size_t __nbyte ) ; pid_t __attribute__((__cdecl__)) vfork (void ) ; int __attribute__((__cdecl__)) _close (int __fildes ) ; pid_t __attribute__((__cdecl__)) _fork (void ) ; pid_t __attribute__((__cdecl__)) _getpid (void ) ; int __attribute__((__cdecl__)) _link (const char *__path1, const char *__path2 ) ; off_t __attribute__((__cdecl__)) _lseek (int __fildes, off_t __offset, int __whence ) ; _ssize_t __attribute__((__cdecl__)) _read (int __fd, void *__buf, size_t __nbyte ) ; void * __attribute__((__cdecl__)) _sbrk (size_t __incr) ; int __attribute__((__cdecl__)) _unlink (const char *__path ) ; _ssize_t __attribute__((__cdecl__)) _write (int __fd, const void *__buf, size_t __nbyte ) ; int __attribute__((__cdecl__)) _execve (const char *__path, char * const __argv[], char * const __envp[] ) ; int __attribute__((__cdecl__)) getdtablesize (void) ; int __attribute__((__cdecl__)) setdtablesize (int) ; useconds_t __attribute__((__cdecl__)) ualarm (useconds_t __useconds, useconds_t __interval) ; unsigned __attribute__((__cdecl__)) usleep (unsigned int __useconds) ; int __attribute__((__cdecl__)) ftruncate (int __fd, off_t __length) ; int __attribute__((__cdecl__)) truncate (const char *, off_t __length) ; int __attribute__((__cdecl__)) gethostname (char *__name, size_t __len) ; char * __attribute__((__cdecl__)) mktemp (char *) ; int __attribute__((__cdecl__)) sync (void) ; int __attribute__((__cdecl__)) readlink (const char *__path, char *__buf, int __buflen) ; int __attribute__((__cdecl__)) symlink (const char *__name1, const char *__name2) ; } # 6 "/usr/include/unistd.h" 2 3 # 1 "/usr/include/getopt.h" 1 3 extern "C" { extern int opterr; extern int optind; extern int optopt; extern int optreset; extern char *optarg; int getopt (int, char * const *, const char *); } # 84 "/usr/include/getopt.h" 3 # 8 "/usr/include/unistd.h" 2 3 # 20 "/usr/include/boost/config/platform/cygwin.hpp" 2 3 # 1 "/usr/include/boost/config/posix_features.hpp" 1 3 # 32 "/usr/include/boost/config/platform/cygwin.hpp" 2 3 # 53 "/usr/include/boost/config.hpp" 2 3 # 1 "/usr/include/boost/config/suffix.hpp" 1 3 # 1 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/limits.h" 1 3 # 114 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/limits.h" 3 # 30 "/usr/include/boost/config/suffix.hpp" 2 3 # 208 "/usr/include/boost/config/suffix.hpp" 3 # 57 "/usr/include/boost/config.hpp" 2 3 # 18 "/usr/include/boost/type_traits/fwd.hpp" 2 3 namespace boost{ template struct is_convertible; template struct alignment_of; template struct is_void; template struct is_integral; template struct is_float; template struct is_arithmetic; template struct is_fundamental; template struct is_const; template struct is_volatile; template struct remove_const; template struct remove_volatile; template struct remove_cv; template struct is_array; template struct is_pointer; template struct is_reference; template struct is_member_pointer; template struct is_enum; template struct is_union; template struct is_object; template struct is_scalar; template struct is_class; template struct is_compound; template struct is_POD; template struct has_trivial_constructor; template struct has_trivial_copy; template struct has_trivial_assign; template struct has_trivial_destructor; template struct is_empty; template struct remove_reference; template struct add_reference; template struct remove_bounds; template struct remove_pointer; template struct add_pointer; template struct is_same; } # 13 "/usr/include/boost/type_traits.hpp" 2 3 # 1 "/usr/include/boost/type_traits/ice.hpp" 1 3 namespace boost{ namespace type_traits{ typedef char yes_type; typedef double no_type; template struct ice_not { static const bool value = true ; }; template <> struct ice_not { static const bool value = false ; }; template struct ice_or; template struct ice_or { static const bool value = true ; }; template <> struct ice_or { static const bool value = false ; }; template struct ice_and; template struct ice_and { static const bool value = false ; }; template <> struct ice_and { static const bool value = true ; }; template struct ice_eq { static const bool value = (b1 == b2) ; }; template struct ice_ne { static const bool value = (b1 != b2) ; }; template const bool ice_eq::value; template const bool ice_ne::value; } } # 14 "/usr/include/boost/type_traits.hpp" 2 3 # 1 "/usr/include/boost/type_traits/conversion_traits.hpp" 1 3 # 1 "/usr/include/boost/type_traits/arithmetic_traits.hpp" 1 3 # 1 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/limits.h" 1 3 # 114 "/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include/limits.h" 3 # 26 "/usr/include/boost/type_traits/arithmetic_traits.hpp" 2 3 namespace boost{ template struct is_void{ static const bool value = false ; }; template <> struct is_void{ static const bool value = true ; }; template struct is_integral { static const bool value = false ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template struct is_float { static const bool value = false ; }; template <> struct is_float { static const bool value = true ; }; template <> struct is_float { static const bool value = true ; }; template <> struct is_float { static const bool value = true ; }; template <> struct is_void { static const bool value = true ; }; template <> struct is_void { static const bool value = true ; }; template <> struct is_void { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_float { static const bool value = true ; }; template <> struct is_float { static const bool value = true ; }; template <> struct is_float { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_float { static const bool value = true ; }; template <> struct is_float { static const bool value = true ; }; template <> struct is_float { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_integral { static const bool value = true ; }; template <> struct is_float { static const bool value = true ; }; template <> struct is_float { static const bool value = true ; }; template <> struct is_float { static const bool value = true ; }; template struct is_arithmetic { static const bool value = (::boost::type_traits::ice_or< ::boost::is_integral::value, ::boost::is_float::value >::value) ; }; template struct is_fundamental { static const bool value = (::boost::type_traits::ice_or< ::boost::is_arithmetic::value, ::boost::is_void::value >::value) ; }; } # 26 "/usr/include/boost/type_traits/conversion_traits.hpp" 2 3 namespace boost{ # 143 "/usr/include/boost/type_traits/conversion_traits.hpp" 3 namespace detail{ struct any_conversion { template any_conversion(const T&); template any_conversion(T&); }; template struct checker { static boost::type_traits::no_type _m_check(any_conversion ...); static boost::type_traits::yes_type _m_check(T, int); }; } template struct is_convertible { private: static From _m_from; public: static const bool value = sizeof( detail::checker::_m_check(_m_from, 0) ) == sizeof(type_traits::yes_type); void foo(); }; template struct is_convertible { static const bool value = false; }; template struct is_convertible { static const bool value = false; }; template <> struct is_convertible { static const bool value = true; }; # 223 "/usr/include/boost/type_traits/conversion_traits.hpp" 3 } # 15 "/usr/include/boost/type_traits.hpp" 2 3 # 1 "/usr/include/boost/type_traits/cv_traits.hpp" 1 3 namespace boost{ namespace detail{ template struct cv_traits_imp{}; template struct cv_traits_imp { static const bool is_const = false ; static const bool is_volatile = false ; typedef T unqualified_type; }; template struct cv_traits_imp { static const bool is_const = true ; static const bool is_volatile = false ; typedef T unqualified_type; }; template struct cv_traits_imp { static const bool is_const = false ; static const bool is_volatile = true ; typedef T unqualified_type; }; template struct cv_traits_imp { static const bool is_const = true ; static const bool is_volatile = true ; typedef T unqualified_type; }; template struct remove_const_helper { typedef T type; }; template struct remove_const_helper { typedef volatile T type; }; template struct remove_volatile_helper { typedef T type; }; template struct remove_volatile_helper { typedef const T type; }; } template struct remove_volatile { typedef typename detail::cv_traits_imp::unqualified_type uq_type; typedef typename detail::remove_volatile_helper::value>::type type; }; template struct remove_volatile{ typedef T& type; }; template struct remove_volatile{ typedef T type[N]; }; template struct remove_volatile{ typedef const T type[N]; }; template struct remove_const { typedef typename detail::cv_traits_imp::unqualified_type uq_type; typedef typename detail::remove_const_helper::value>::type type; }; template struct remove_const{ typedef T& type; }; template struct remove_const{ typedef T type[N]; }; template struct remove_const{ typedef volatile T type[N]; }; template struct remove_cv { typedef typename detail::cv_traits_imp::unqualified_type type; }; template struct remove_cv{ typedef T& type; }; template struct remove_cv{ typedef T type[N]; }; template struct remove_cv{ typedef T type[N]; }; template struct remove_cv{ typedef T type[N]; }; template struct is_const { static const bool value = detail::cv_traits_imp::is_const ; }; template struct is_const { static const bool value = false ; }; # 144 "/usr/include/boost/type_traits/cv_traits.hpp" 3 template struct is_volatile { static const bool value = detail::cv_traits_imp::is_volatile ; }; template struct is_volatile { static const bool value = false ; }; # 165 "/usr/include/boost/type_traits/cv_traits.hpp" 3 # 246 "/usr/include/boost/type_traits/cv_traits.hpp" 3 template struct add_const { typedef T const type; }; template struct add_volatile { typedef T volatile type; }; template struct add_const{ typedef T& type; }; template struct add_volatile{ typedef T& type; }; } # 17 "/usr/include/boost/type_traits.hpp" 2 3 # 1 "/usr/include/boost/type_traits/composite_traits.hpp" 1 3 # 1 "/usr/include/boost/type_traits/transform_traits.hpp" 1 3 namespace boost{ template struct remove_reference { typedef T type; }; template struct remove_reference { typedef T type; }; # 58 "/usr/include/boost/type_traits/transform_traits.hpp" 3 template struct add_reference { typedef T& type; }; template struct add_reference { typedef T& type; }; # 110 "/usr/include/boost/type_traits/transform_traits.hpp" 3 template <> struct add_reference{ typedef void type; }; template <> struct add_reference{ typedef const volatile void type; }; template <> struct add_reference{ typedef const void type; }; template <> struct add_reference{ typedef volatile void type; }; template struct remove_bounds { typedef T type; }; template struct remove_bounds { typedef T type; }; template struct remove_bounds { typedef const T type; }; template struct remove_bounds { typedef volatile T type; }; template struct remove_bounds { typedef const volatile T type; }; template struct remove_pointer { typedef T type; }; template struct remove_pointer { typedef T type; }; template struct remove_pointer { typedef T type; }; template struct remove_pointer { typedef T type; }; template struct remove_pointer { typedef T type; }; template struct add_pointer { private: typedef typename remove_reference::type no_ref_type; typedef typename remove_bounds::type no_b_type; public: typedef no_b_type* type; }; } # 45 "/usr/include/boost/type_traits/composite_traits.hpp" 2 3 namespace boost{ template struct is_array { static const bool value = false ; }; template struct is_array { static const bool value = true ; }; template struct is_array { static const bool value = true ; }; template struct is_array { static const bool value = true ; }; template struct is_array { static const bool value = true ; }; # 183 "/usr/include/boost/type_traits/composite_traits.hpp" 3 namespace detail{ template struct is_pointer_helper { static const bool value = false ; }; template struct is_pointer_helper { static const bool value = true ; }; template struct is_pointer_helper { static const bool value = true ; }; template struct is_pointer_helper { static const bool value = true ; }; template struct is_pointer_helper { static const bool value = true ; }; } template struct is_pointer { static const bool value = (::boost::type_traits::ice_and< ::boost::detail::is_pointer_helper::value, ::boost::type_traits::ice_not< ::boost::is_member_pointer::value >::value >::value) ; }; # 248 "/usr/include/boost/type_traits/composite_traits.hpp" 3 template struct is_reference { static const bool value = false ; }; template struct is_reference { static const bool value = true ; }; # 271 "/usr/include/boost/type_traits/composite_traits.hpp" 3 # 307 "/usr/include/boost/type_traits/composite_traits.hpp" 3 template struct is_union { private: typedef typename remove_cv::type cvt; public: static const bool value = false ; }; namespace detail{ struct int_convertible { int_convertible(int); }; } template struct is_enum { private: typedef typename ::boost::add_reference::type r_type; public: static const bool value = (::boost::type_traits::ice_and< ::boost::type_traits::ice_not< ::boost::is_arithmetic::value>::value, ::boost::type_traits::ice_not< ::boost::is_reference::value>::value, ::boost::is_convertible::value >::value) ; }; # 355 "/usr/include/boost/type_traits/composite_traits.hpp" 3 template struct is_member_pointer { static const bool value = false ; }; template struct is_member_pointer { static const bool value = true ; }; template struct is_member_pointer{ static const bool value = true ; }; template struct is_member_pointer{ static const bool value = true ; }; template struct is_member_pointer{ static const bool value = true ; }; template struct is_member_pointer{ static const bool value = true ; }; template struct is_member_pointer{ static const bool value = true ; }; template struct is_member_pointer{ static const bool value = true ; }; template struct is_member_pointer{ static const bool value = true ; }; template struct is_member_pointer{ static const bool value = true ; }; template struct is_member_pointer{ static const bool value = true ; }; template struct is_member_pointer{ static const bool value = true ; }; template struct is_member_pointer{ static const bool value = true ; }; template struct is_member_pointer{ static const bool value = true ; }; template struct is_member_pointer{ static const bool value = true ; }; template struct is_member_pointer{ static const bool value = true ; }; template struct is_member_pointer{ static const bool value = true ; }; template struct is_member_pointer{ static const bool value = true ; }; template struct is_member_pointer{ static const bool value = true ; }; template struct is_member_pointer{ static const bool value = true ; }; template struct is_member_pointer{ static const bool value = true ; }; template struct is_member_pointer{ static const bool value = true ; }; template struct is_member_pointer{ static const bool value = true ; }; template struct is_member_pointer{ static const bool value = true ; }; template struct is_member_pointer{ static const bool value = true ; }; template struct is_member_pointer{ static const bool value = true ; }; template struct is_member_pointer{ static const bool value = true ; }; template struct is_member_pointer{ static const bool value = true ; }; template struct is_member_pointer{ static const bool value = true ; }; template struct is_member_pointer{ static const bool value = true ; }; template struct is_member_pointer{ static const bool value = true ; }; template struct is_member_pointer{ static const bool value = true ; }; # 716 "/usr/include/boost/type_traits/composite_traits.hpp" 3 } # 18 "/usr/include/boost/type_traits.hpp" 2 3 # 1 "/usr/include/boost/type_traits/alignment_traits.hpp" 1 3 namespace boost{ namespace detail{ template struct alignment_of_hack { char c; T t; alignment_of_hack(); }; template struct alignment_logic { static const std::size_t value = A < S ? A : S ; }; } template struct alignment_of { static const std::size_t value = (::boost::detail::alignment_logic< sizeof(detail::alignment_of_hack) - sizeof(T), sizeof(T) >::value) ; }; template struct alignment_of { public: static const std::size_t value = ::boost::alignment_of::value ; }; template <> struct alignment_of { static const std::size_t value = 0 ; }; template <> struct alignment_of { static const std::size_t value = 0 ; }; template <> struct alignment_of { static const std::size_t value = 0 ; }; template <> struct alignment_of { static const std::size_t value = 0 ; }; } # 19 "/usr/include/boost/type_traits.hpp" 2 3 # 1 "/usr/include/boost/type_traits/object_traits.hpp" 1 3 # 1 "/usr/include/boost/type_traits/function_traits.hpp" 1 3 namespace boost{ namespace detail{ template struct is_function_helper_base{ static const bool value = false ; }; template struct is_function_helper_base{ static const bool value = true ; }; template struct is_function_helper_base{ static const bool value = true ; }; template struct is_function_helper_base{ static const bool value = true ; }; template struct is_function_helper_base{ static const bool value = true ; }; template struct is_function_helper_base{ static const bool value = true ; }; template struct is_function_helper_base{ static const bool value = true ; }; template struct is_function_helper_base{ static const bool value = true ; }; template struct is_function_helper_base{ static const bool value = true ; }; template struct is_function_helper_base{ static const bool value = true ; }; template struct is_function_helper_base{ static const bool value = true ; }; template struct is_function_helper_base{ static const bool value = true ; }; template struct is_function_helper_base{ static const bool value = true ; }; template struct is_function_helper_base{ static const bool value = true ; }; template struct is_function_helper_base{ static const bool value = true ; }; template struct is_function_helper_base{ static const bool value = true ; }; template struct is_function_helper_base{ static const bool value = true ; }; template struct is_function_helper_base{ static const bool value = true ; }; template struct is_function_helper_base{ static const bool value = true ; }; template struct is_function_helper_base{ static const bool value = true ; }; template struct is_function_helper_base{ static const bool value = true ; }; template struct is_function_helper_base{ static const bool value = true ; }; template struct is_function_helper_base{ static const bool value = true ; }; template struct is_function_helper_base{ static const bool value = true ; }; template struct is_function_helper_base{ static const bool value = true ; }; template struct is_function_helper_base{ static const bool value = true ; }; template struct is_function_helper_base{ static const bool value = true ; }; template struct is_function_helper_base{ static const bool value = true ; }; template struct is_function_helper_base{ static const bool value = true ; }; template struct is_function_helper_base{ static const bool value = true ; }; template struct is_function_helper_base{ static const bool value = true ; }; template struct is_function_helper : is_function_helper_base{}; # 108 "/usr/include/boost/type_traits/function_traits.hpp" 3 template struct is_function_ref_helper { static const bool value = false ; }; template struct is_function_chooser { typedef is_function_helper type; }; template struct is_function_chooser { typedef is_function_ref_helper type; }; } template struct is_function { private: typedef typename detail::is_function_chooser::value>::type m_type; public: static const bool value = m_type::value ; }; } # 31 "/usr/include/boost/type_traits/object_traits.hpp" 2 3 # 1 "/usr/include/boost/type_traits/same_traits.hpp" 1 3 namespace boost{ template struct is_same { static const bool value = false ; }; template struct is_same { static const bool value = true ; }; # 92 "/usr/include/boost/type_traits/same_traits.hpp" 3 } # 36 "/usr/include/boost/type_traits/object_traits.hpp" 2 3 namespace boost{ template struct is_object { static const bool value = (::boost::type_traits::ice_and< ::boost::type_traits::ice_not< ::boost::is_reference::value>::value, ::boost::type_traits::ice_not< ::boost::is_void::value>::value, ::boost::type_traits::ice_not< ::boost::is_function::value>::value >::value) ; }; template struct is_scalar { static const bool value = (::boost::type_traits::ice_or< ::boost::is_arithmetic::value, ::boost::is_enum::value, ::boost::is_pointer::value, ::boost::is_member_pointer::value >::value) ; }; template struct is_class { static const bool value = (::boost::type_traits::ice_and< ::boost::type_traits::ice_not< ::boost::is_union::value >::value, ::boost::type_traits::ice_not< ::boost::is_scalar::value >::value, ::boost::type_traits::ice_not< ::boost::is_array::value >::value, ::boost::type_traits::ice_not< ::boost::is_reference::value>::value, ::boost::type_traits::ice_not< ::boost::is_void::value >::value, ::boost::type_traits::ice_not< ::boost::is_function::value >::value >::value) ; # 109 "/usr/include/boost/type_traits/object_traits.hpp" 3 }; template struct is_compound { static const bool value = (::boost::type_traits::ice_or< ::boost::is_array::value, ::boost::is_pointer::value, ::boost::is_reference::value, ::boost::is_class::value, ::boost::is_union::value, ::boost::is_enum::value, ::boost::is_member_pointer::value >::value) ; }; template struct is_POD { static const bool value = (::boost::type_traits::ice_or< ::boost::is_scalar::value, ::boost::is_void::value, ::boost::is_same< typename ::__type_traits< T >::is_POD_type, ::__true_type>::value >::value) ; }; template struct is_POD { static const bool value = ::boost::is_POD::value ; }; template struct has_trivial_constructor { static const bool value = (::boost::type_traits::ice_or< ::boost::is_POD::value, ::boost::is_same< typename ::__type_traits< T >::has_trivial_default_constructor, ::__true_type>::value >::value) ; }; template struct has_trivial_copy { static const bool value = (::boost::type_traits::ice_and< ::boost::type_traits::ice_or< ::boost::is_POD::value, ::boost::is_same< typename ::__type_traits< T >::has_trivial_copy_constructor, ::__true_type>::value >::value, ::boost::type_traits::ice_not< ::boost::is_volatile::value >::value >::value) ; }; template struct has_trivial_assign { static const bool value = (::boost::type_traits::ice_and< ::boost::type_traits::ice_or< ::boost::is_POD::value, ::boost::is_same< typename ::__type_traits< T >::has_trivial_assignment_operator, ::__true_type>::value >::value, ::boost::type_traits::ice_not< ::boost::is_const::value >::value, ::boost::type_traits::ice_not< ::boost::is_volatile::value >::value >::value) ; }; template struct has_trivial_destructor { static const bool value = (::boost::type_traits::ice_or< ::boost::is_POD::value, ::boost::is_same< typename ::__type_traits< T >::has_trivial_destructor, ::__true_type>::value >::value) ; }; namespace detail{ template struct empty_helper_t1 : public T { empty_helper_t1(); int i[256]; }; struct empty_helper_t2 { int i[256]; }; template struct empty_helper{ static const bool value = false ; }; template struct empty_helper { static const bool value = (sizeof(empty_helper_t1) == sizeof(empty_helper_t2)) ; }; } template struct is_empty { private: typedef typename remove_cv::type cvt; typedef typename add_reference::type r_type; public: static const bool value = (::boost::type_traits::ice_or< ::boost::detail::empty_helper::value , ::boost::is_convertible< r_type,int>::value >::value, false >::value) ; }; # 345 "/usr/include/boost/type_traits/object_traits.hpp" 3 } # 20 "/usr/include/boost/type_traits.hpp" 2 3 # 37 "/usr/include/boost/spirit/core/primitives.hpp" 2 3 namespace spirit { template class char_action : public unary, public parser > { public: typedef action_parser_category parser_category; char_action(ParserT const& subject, ActionT const& actor_); template typename ParsePolicyT::match_t do_parse(IteratorT& first, IteratorT const& last) const; ActionT const &predicate() const { return actor; } private: typename embed_trait::type actor; }; template struct char_parser : public parser { template char_action operator[](ActionT const& actor) const; template typename ParsePolicyT::match_t do_parse(IteratorT& first, IteratorT const& last) const; }; template struct chlit : public char_parser > { chlit(CharT ch); template bool test(T ch) const; CharT ch; }; template struct range : public char_parser > { range(CharAT first, CharBT last); template bool test(T ch) const; CharAT first; CharBT last; }; template class cstring { public: typedef CharT const* const_iterator; typedef CharT value_type; cstring(const_iterator str, unsigned len); cstring(const_iterator str); const_iterator begin() const; const_iterator end() const; std::size_t length() const; private: const_iterator first; const_iterator last; }; template > struct strlit : public parser > { typedef typename boost::remove_reference::type string_type; typedef typename remove_wrap::type actual_type; typedef typename actual_type::const_iterator raw_string_type; strlit(StringT str); strlit(raw_string_type str); template typename ParsePolicyT::match_t do_parse(IteratorT& first, IteratorT const& last) const; StringT str; }; struct anychar_ : public char_parser { template bool test(CharT ch) const; }; struct nothing_ : public parser { template typename ParsePolicyT::match_t do_parse(IteratorT& first, IteratorT const& last) const; }; struct epsilon_ : public parser { template typename ParsePolicyT::match_t do_parse(IteratorT& first, IteratorT const& last) const; }; struct alnum_ : public char_parser { template bool test(CharT ch) const; }; struct alpha_ : public char_parser { template bool test(CharT ch) const; }; struct cntrl_ : public char_parser { template bool test(CharT ch) const; }; struct digit_ : public char_parser { template bool test(CharT ch) const; }; struct graph_ : public char_parser { template bool test(CharT ch) const; }; struct lower_ : public char_parser { template bool test(CharT ch) const; }; struct print_ : public char_parser { template bool test(CharT ch) const; }; struct punct_ : public char_parser { template bool test(CharT ch) const; }; struct blank_ : public char_parser { template bool test(CharT ch) const; }; struct space_ : public char_parser { template bool test(CharT ch) const; }; struct upper_ : public char_parser { template bool test(CharT ch) const; }; struct xdigit_ : public char_parser { template bool test(CharT ch) const; }; template class variable; template chlit ch_p(ParamT param); template range range_p(ParamAT first, ParamBT last); template strlit > str_p(CharT const* str); template strlit str_p(variable const& ref); const anychar_ anychar_p = anychar_(); const nothing_ nothing_p = nothing_(); const epsilon_ epsilon_p = epsilon_(); const epsilon_ eps_p = epsilon_(); const alnum_ alnum_p = alnum_(); const alpha_ alpha_p = alpha_(); const cntrl_ cntrl_p = cntrl_(); const digit_ digit_p = digit_(); const graph_ graph_p = graph_(); const lower_ lower_p = lower_(); const print_ print_p = print_(); const punct_ punct_p = punct_(); const blank_ blank_p = blank_(); const space_ space_p = space_(); const upper_ upper_p = upper_(); const xdigit_ xdigit_p = xdigit_(); } # 59 "/usr/include/boost/spirit/spirit_core.hpp" 2 3 # 1 "/usr/include/boost/spirit/core/operators.hpp" 1 3 namespace spirit { template struct sequence : public binary, public parser > { sequence(A const& a, B const& b) : binary(a, b) {} template typename ParsePolicyT::match_t do_parse(IteratorT& first, IteratorT const& last) const { typename ParsePolicyT::match_t ma, mb; if ((ma = this->left().template do_parse(first, last)) && (mb = this->right().template do_parse(first, last))) { ParsePolicyT::concat(ma, mb); return ma; } return ParsePolicyT::no_match(); } }; template sequence operator>>(parser const& a, parser const& b); template sequence > operator>>(parser const& a, char b); template sequence, B> operator>>(char a, parser const& b); template sequence > > operator>>(parser const& a, char const* b); template sequence >, B> operator>>(char const* a, parser const& b); template sequence > operator>>(parser const& a, wchar_t b); template sequence, B> operator>>(wchar_t a, parser const& b); template sequence > > operator>>(parser const& a, wchar_t const* b); template sequence >, B> operator>>(wchar_t const* a, parser const& b); template sequence operator&&(parser const& a, parser const& b); template sequence > operator&&(parser const& a, char b); template sequence, B> operator&&(char a, parser const& b); template sequence > > operator&&(parser const& a, char const* b); template sequence >, B> operator&&(char const* a, parser const& b); template sequence > operator&&(parser const& a, wchar_t b); template sequence, B> operator&&(wchar_t a, parser const& b); template sequence > > operator&&(parser const& a, wchar_t const* b); template sequence >, B> operator&&(wchar_t const* a, parser const& b); template struct sequential_or : public binary, public parser > { sequential_or(A const& a, B const& b) : binary(a, b) {} template typename ParsePolicyT::match_t do_parse(IteratorT& first, IteratorT const& last) const { { IteratorT s = first; typename ParsePolicyT::match_t ma = this->left().template do_parse(s, last); if (ma) { IteratorT t = s; typename ParsePolicyT::match_t mb = this->right().template do_parse(t, last); if (mb) { first = t; ParsePolicyT::concat(ma, mb); return ma; } else { first = s; return ma; } } } return this->right().template do_parse(first, last); } }; template sequential_or operator||(parser const& a, parser const& b); template sequential_or > operator||(parser const& a, char b); template sequential_or, B> operator||(char a, parser const& b); template sequential_or > > operator||(parser const& a, char const* b); template sequential_or >, B> operator||(char const* a, parser const& b); template sequential_or > operator||(parser const& a, wchar_t b); template sequential_or, B> operator||(wchar_t a, parser const& b); template sequential_or > > operator||(parser const& a, wchar_t const* b); template sequential_or >, B> operator||(wchar_t const* a, parser const& b); template struct alternative : public binary, public parser > { alternative(A const& a, B const& b) : binary(a, b) {} template typename ParsePolicyT::match_t do_parse(IteratorT& first, IteratorT const& last) const { { IteratorT s = first; if (typename ParsePolicyT::match_t hit = this->left().template do_parse(s, last)) { first = s; return hit; } } return this->right().template do_parse(first, last); } }; template alternative operator|(parser const& a, parser const& b); template alternative > operator|(parser const& a, char b); template alternative, B> operator|(char a, parser const& b); template alternative > > operator|(parser const& a, char const* b); template alternative >, B> operator|(char const* a, parser const& b); template alternative > operator|(parser const& a, wchar_t b); template alternative, B> operator|(wchar_t a, parser const& b); template alternative > > operator|(parser const& a, wchar_t const* b); template alternative >, B> operator|(wchar_t const* a, parser const& b); template struct intersection : public binary, public parser > { intersection(A const& a, B const& b) : binary(a, b) {} template typename ParsePolicyT::match_t do_parse(IteratorT& first, IteratorT const& last) const { IteratorT ls = first; if (typename ParsePolicyT::match_t l = this->left().template do_parse(ls, last)) { IteratorT rs = first; if (typename ParsePolicyT::match_t r = this->right().template do_parse(rs, last)) { bool less = l.length() < r.length(); first = less ? rs : ls; return less ? r : l; } } return ParsePolicyT::no_match(); } }; template intersection operator&(parser const& a, parser const& b); template intersection > operator&(parser const& a, char b); template intersection, B> operator&(char a, parser const& b); template intersection > > operator&(parser const& a, char const* b); template intersection >, B> operator&(char const* a, parser const& b); template intersection > operator&(parser const& a, wchar_t b); template intersection, B> operator&(wchar_t a, parser const& b); template intersection > > operator&(parser const& a, wchar_t const* b); template intersection >, B> operator&(wchar_t const* a, parser const& b); template struct difference : public binary, public parser > { difference(A const& a, B const& b) : binary(a, b) {} template typename ParsePolicyT::match_t do_parse(IteratorT& first, IteratorT const& last) const { IteratorT ls = first; IteratorT rs = first; typename ParsePolicyT::match_t hit, hit2; if ((hit = this->left().template do_parse(ls, last)) && !(hit2 = this->right().template do_parse(rs, last))) { first = ls; return hit; } if (hit2.length() < hit.length()) { first = ls; return hit; } return ParsePolicyT::no_match(); } }; template difference operator-(parser const& a, parser const& b); template difference > operator-(parser const& a, char b); template difference, B> operator-(char a, parser const& b); template difference > > operator-(parser const& a, char const* b); template difference >, B> operator-(char const* a, parser const& b); template difference > operator-(parser const& a, wchar_t b); template difference, B> operator-(wchar_t a, parser const& b); template difference > > operator-(parser const& a, wchar_t const* b); template difference >, B> operator-(wchar_t const* a, parser const& b); template struct exclusive_or : public binary, public parser > { exclusive_or(A const& a, B const& b) : binary(a, b) {} template typename ParsePolicyT::match_t do_parse(IteratorT& first, IteratorT const& last) const { IteratorT ls = first; IteratorT rs = first; typename ParsePolicyT::match_t l = this->left().template do_parse(ls, last); typename ParsePolicyT::match_t r = this->right().template do_parse(rs, last); if (bool(l) ^ bool(r)) { first = l ? ls : rs; return l ? l : r; } return ParsePolicyT::no_match(); } }; template exclusive_or operator^(parser const& a, parser const& b); template exclusive_or > operator^(parser const& a, char b); template exclusive_or, B> operator^(char a, parser const& b); template exclusive_or > > operator^(parser const& a, char const* b); template exclusive_or >, B> operator^(char const* a, parser const& b); template exclusive_or > operator^(parser const& a, wchar_t b); template exclusive_or, B> operator^(wchar_t a, parser const& b); template exclusive_or > > operator^(parser const& a, wchar_t const* b); template exclusive_or >, B> operator^(wchar_t const* a, parser const& b); template struct optional : public unary, public parser > { optional(S const& a) : unary(a) {} template typename ParsePolicyT::match_t do_parse(IteratorT& first, IteratorT const& last) const { IteratorT s = first; typename ParsePolicyT::match_t r = this->subject().template do_parse(s, last); if (r) { first = s; return r; } else { return ParsePolicyT::empty_match(); } } }; template optional operator!(parser const& a); template struct kleene_star : public unary, public parser > { kleene_star(S const& a) : unary(a) {} template typename ParsePolicyT::match_t do_parse(IteratorT& first, IteratorT const& last) const { typename ParsePolicyT::match_t hit = ParsePolicyT::create_match(0, first, first); while (true) { IteratorT s = first; typename ParsePolicyT::match_t next = this->subject().template do_parse(s, last); if (next) { first = s; ParsePolicyT::concat(hit, next); } else { return hit; } } } }; template kleene_star operator*(parser const& a); template struct positive : public unary, public parser > { positive(S const& a) : unary(a) {} template typename ParsePolicyT::match_t do_parse(IteratorT& first, IteratorT const& last) const { typename ParsePolicyT::match_t hit = this->subject().template do_parse(first, last); if (hit) { while (true) { IteratorT s = first; typename ParsePolicyT::match_t next = this->subject().template do_parse(s, last); if (next) { first = s; ParsePolicyT::concat(hit, next); } else { break; } } } return hit; } }; template inline positive operator + (parser const& a); template sequence > > operator%(parser const& a, parser const& b); template sequence, A> > > operator%(parser const& a, char b); template sequence, kleene_star > > > operator%(char a, parser const& b); template sequence >, A> > > operator%(parser const& a, char const* b); template sequence >, kleene_star > > > > operator%(char const* a, parser const& b); template sequence, A> > > operator%(parser const& a, wchar_t b); template sequence, kleene_star > > > operator%(wchar_t a, parser const& b); template sequence >, A> > > operator%(parser const& a, wchar_t const* b); template sequence >, kleene_star > > > > operator%(wchar_t const* a, parser const& b); } # 60 "/usr/include/boost/spirit/spirit_core.hpp" 2 3 # 1 "/usr/include/boost/spirit/core/attr_match.hpp" 1 3 namespace spirit { template class attr_match : public BaseT { public: attr_match(); attr_match(attr_match const& other); explicit attr_match(unsigned length, TypeT const& val = TypeT()); explicit attr_match(BaseT const& match, TypeT const& val = TypeT()); template attr_match(attr_match const& match); TypeT const& value() const; TypeT& value(); void value(TypeT const& val); private: TypeT val; }; } # 61 "/usr/include/boost/spirit/spirit_core.hpp" 2 3 # 1 "/usr/include/boost/spirit/core/attr_action.hpp" 1 3 namespace spirit { template struct attr_action : public base_action > { typedef typename ParserT::return_t return_t; attr_action(ParserT const& parser, ActionT const& actor); template attr_match do_parse(IteratorT& first, IteratorT const& last) const; }; namespace impl { template struct parser_return, ParsePolicyT> { typedef attr_match match_t; }; } } # 62 "/usr/include/boost/spirit/spirit_core.hpp" 2 3 # 1 "/usr/include/boost/spirit/core/impl/debug.ipp" 1 3 # 143 "/usr/include/boost/spirit/core/impl/debug.ipp" 3 # 65 "/usr/include/boost/spirit/spirit_core.hpp" 2 3 # 1 "/usr/include/boost/spirit/core/impl/parser.ipp" 1 3 # 1 "/usr/include/g++-3/cassert" 1 3 # 1 "/usr/include/assert.h" 1 3 extern "C" { void __attribute__((__cdecl__)) __assert (const char *, int, const char *) ; } # 6 "/usr/include/g++-3/cassert" 2 3 # 35 "/usr/include/boost/spirit/core/impl/parser.ipp" 2 3 namespace spirit { template template inline action parser::operator[](ActionT const& actor) const { return action(derived(), actor); } template template inline fixed_loop parser::operator()(EndT const& end) const { return fixed_loop(derived(), end); } template template inline typename impl::loop_traits::type parser::operator()(StartT const& start, EndT const& end) const { typedef typename impl::loop_traits::type type; return type(derived(), start, end); } template template inline fixed_loop parser::repeat(EndT const& end) const { return fixed_loop(derived(), end); } template template inline typename impl::loop_traits::type parser::repeat(StartT const& start, EndT const& end) const { typedef typename impl::loop_traits::type type; return type(derived(), start, end); } template inline DerivedT& parser::derived() { return *static_cast(this); } template inline DerivedT const& parser::derived() const { return *static_cast(this); } template template inline typename impl::parser_return::match_t parser::parse(IteratorT& first, IteratorT const& last) const { return derived().template do_parse(first, last); } template template inline typename impl::parser_return::match_t parser::parse(IteratorT& first, IteratorT const& last, ParsePolicyT const & ) const { return derived().template do_parse(first, last); } inline match::match() : data(-1) {} inline match::match(unsigned length) : data(length) {} inline int match::length() const { return data; } inline match::match(match const &hit) : data(hit.length()) {} inline match::operator bool() const { return data >= 0; } inline match& match::operator+=(match const& other) { (( *this && other ) ? (void)0 : __assert("/usr/include/boost/spirit/core/impl/parser.ipp", 159, "*this && other")) ; data += other.data; return *this; } inline match operator+(match const& a, match const& b) { return match(a) += b; } inline const match_policy::match_t match_policy::no_match() { return match(); } inline const match_policy::match_t match_policy::empty_match() { return match(0); } template inline match_policy::match_t match_policy::create_match(int length, Iterator1T const&, Iterator2T const&) { return match_t(length); } inline void match_policy::concat(match_policy::match_t& l, match_policy::match_t const& r) { l += r; } template template inline tree_policy::match_t tree_policy::create_node(int length, Iterator1T const& first, Iterator2T const& last) { } template template inline void tree_policy::apply_op_to_match(FunctorT const& , match_t& ) { } template template inline void tree_policy::set_id_and_group(match_t& , rule_id , Iterator1T& , Iterator2T const& ) { } template parse_info parse( IteratorT const& first_, IteratorT const& last, parser const& parser) { IteratorT first = first_; match hit = parser.derived().template do_parse( first, last); parse_info info; info.stop = first; info.match = hit; info.full = hit && (first == last); info.length = hit.length(); return info; } template parse_info parse( CharT const* str, parser const& parser) { CharT const* last = str; while (*last) last++; return parse(str, last, parser); } } # 66 "/usr/include/boost/spirit/spirit_core.hpp" 2 3 # 1 "/usr/include/boost/spirit/core/impl/actions.ipp" 1 3 namespace spirit { template inline base_action::base_action( ParserT const& parser, ActionT const& actor_) : unary(parser), actor(actor_) { } template template inline typename ParsePolicyT::match_t base_action::do_parse( IteratorT& first, IteratorT const& last) const { typedef impl::strip_scanner strip_scanner; typename strip_scanner::iterator_type begin = strip_scanner::get(first); typename ParsePolicyT::match_t hit = this->subject().template do_parse(first, last); if (hit) actor(begin, strip_scanner::get(first)); return hit; } template inline action::action( ParserT const& parser, ActionT const& actor_) : base_action >(parser, actor_) { } } # 67 "/usr/include/boost/spirit/spirit_core.hpp" 2 3 # 1 "/usr/include/boost/spirit/core/impl/primitives.ipp" 1 3 namespace spirit { template inline char_action::char_action( ParserT const& subject, ActionT const& actor_) : unary(subject), actor(actor_) { } template template inline typename ParsePolicyT::match_t char_action::do_parse(IteratorT& first, IteratorT const& last) const { if (first != last) { typedef impl::strip_scanner strip_scanner; typename strip_scanner::iterator_type begin = strip_scanner::get(first); if (typename ParsePolicyT::match_t hit = this->subject().template do_parse(first, last)) { actor(*begin); return hit; } } return ParsePolicyT::no_match(); } template template inline char_action char_parser::operator[](ActionT const& actor) const { return char_action(this->derived(), actor); } template template inline typename ParsePolicyT::match_t char_parser::do_parse(IteratorT& first, IteratorT const& last) const { if (first != last) if (this->derived().test(*first)) { IteratorT s(first); ++first; return ParsePolicyT::create_match(1, s, first); } return ParsePolicyT::no_match(); } template inline chlit::chlit(CharT ch_) : ch(ch_) { } template template inline bool chlit::test(T ch_) const { return T(ch) == ch_; } template inline range::range(CharAT first_, CharBT last_) : first(first_), last(last_) { (( first <= last ) ? (void)0 : __assert("/usr/include/boost/spirit/core/impl/primitives.ipp", 154, "first <= last")) ; } template template inline bool range::test(T ch) const { return (CharAT(ch) >= first) && (CharBT(ch) <= last); } template inline cstring::cstring(const_iterator str, unsigned len) : first(str), last(str + len) {} template inline cstring::cstring(const_iterator str) : first(str) { while (*str) str++; last = str; } template inline typename cstring::const_iterator cstring::begin() const { return first; } template inline typename cstring::const_iterator cstring::end() const { return last; } template inline std::size_t cstring::length() const { return last-first; } template inline strlit::strlit(StringT str_) : str(str_) { } template inline strlit::strlit(raw_string_type str_) : str(str_) { } template template inline typename ParsePolicyT::match_t strlit::do_parse(IteratorT& first, IteratorT const& last) const { typedef typename impl::strip_scanner ::iterator_type plain_iter; plain_iter i1 = impl::strip_scanner::get(first); plain_iter i2 = impl::strip_scanner::get(last); actual_type s = str; raw_string_type strEnd = s.end(); for (raw_string_type strFirst = s.begin(); strFirst != strEnd; ++strFirst, ++i1) if ((i1 == i2) || (*strFirst != *i1)) return ParsePolicyT::no_match(); IteratorT saved = first; first = i1; return ParsePolicyT::create_match(s.length(), saved, first); } inline bool isalnum(int c) { return std::isalnum(c); } inline bool isalpha(int c) { return std::isalpha(c); } inline bool iscntrl(int c) { return std::iscntrl(c); } inline bool isdigit(int c) { return std::isdigit(c); } inline bool isgraph(int c) { return std::isgraph(c); } inline bool islower(int c) { return std::islower(c); } inline bool isprint(int c) { return std::isprint(c); } inline bool ispunct(int c) { return std::ispunct(c); } inline bool isspace(int c) { return std::isspace(c); } inline bool isupper(int c) { return std::isupper(c); } inline bool isxdigit(int c) { return std::isxdigit(c); } # 334 "/usr/include/boost/spirit/core/impl/primitives.ipp" 3 template inline bool anychar_::test(CharT) const { return true; } template inline typename ParsePolicyT::match_t nothing_::do_parse(IteratorT& , IteratorT const& ) const { return ParsePolicyT::no_match(); } template inline typename ParsePolicyT::match_t epsilon_::do_parse(IteratorT& , IteratorT const& ) const { return ParsePolicyT::empty_match(); } template inline bool alnum_::test(CharT ch) const { return isalnum(ch); } template inline bool alpha_::test(CharT ch) const { return isalpha(ch); } template inline bool cntrl_::test(CharT ch) const { return iscntrl(ch); } template inline bool digit_::test(CharT ch) const { return isdigit(ch); } template inline bool graph_::test(CharT ch) const { return isgraph(ch); } template inline bool lower_::test(CharT ch) const { return islower(ch); } template inline bool print_::test(CharT ch) const { return isprint(ch); } template inline bool punct_::test(CharT ch) const { return ispunct(ch); } template inline bool blank_::test(CharT ch) const { return ch == ' ' || ch == '\t'; } template inline bool space_::test(CharT ch) const { return isspace(ch); } template inline bool upper_::test(CharT ch) const { return isupper(ch); } template inline bool xdigit_::test(CharT ch) const { return isxdigit(ch); } template inline chlit ch_p(ParamT param) { return chlit(param); } template inline range range_p(ParamAT first, ParamBT last) { return range(first, last); } template inline strlit > str_p(CharT const* str) { return strlit >(str); } template inline strlit str_p(variable const& ref) { return strlit(ref); } } # 68 "/usr/include/boost/spirit/spirit_core.hpp" 2 3 # 1 "/usr/include/boost/spirit/core/impl/operators.ipp" 1 3 namespace spirit { template inline sequence operator>>(parser const& a, parser const& b) { return sequence(a.derived(), b.derived()); } template inline sequence > operator>>(parser const& a, char b) { return sequence >(a.derived(), b); } template inline sequence, B> operator>>(char a, parser const& b) { return sequence, B>(a, b.derived()); } template inline sequence > > operator>>(parser const& a, char const* b) { return sequence > >(a.derived(), b); } template inline sequence >, B> operator>>(char const* a, parser const& b) { return sequence >, B>(a, b.derived()); } template inline sequence > operator>>(parser const& a, wchar_t b) { return sequence >(a.derived(), b); } template inline sequence, B> operator>>(wchar_t a, parser const& b) { return sequence, B>(a, b.derived()); } template inline sequence > > operator>>(parser const& a, wchar_t const* b) { return sequence > >(a.derived(), b); } template inline sequence >, B> operator>>(wchar_t const* a, parser const& b) { return sequence >, B>(a, b.derived()); } template inline sequence operator&&(parser const& a, parser const& b) { return sequence(a.derived(), b.derived()); } template inline sequence > operator&&(parser const& a, char b) { return sequence >(a.derived(), b); } template inline sequence, B> operator&&(char a, parser const& b) { return sequence, B>(a, b.derived()); } template inline sequence > > operator&&(parser const& a, char const* b) { return sequence > >(a.derived(), b); } template inline sequence >, B> operator&&(char const* a, parser const& b) { return sequence >, B>(a, b.derived()); } template inline sequence > operator&&(parser const& a, wchar_t b) { return sequence >(a.derived(), b); } template inline sequence, B> operator&&(wchar_t a, parser const& b) { return sequence, B>(a, b.derived()); } template inline sequence > > operator&&(parser const& a, wchar_t const* b) { return sequence > >(a.derived(), b); } template inline sequence >, B> operator&&(wchar_t const* a, parser const& b) { return sequence >, B>(a, b.derived()); } template inline sequential_or operator||(parser const& a, parser const& b) { return sequential_or(a.derived(), b.derived()); } template inline sequential_or > operator||(parser const& a, char b) { return sequential_or >(a.derived(), b); } template inline sequential_or, B> operator||(char a, parser const& b) { return sequential_or, B>(a, b.derived()); } template inline sequential_or > > operator||(parser const& a, char const* b) { return sequential_or > >(a.derived(), b); } template inline sequential_or >, B> operator||(char const* a, parser const& b) { return sequential_or >, B>(a, b.derived()); } template inline sequential_or > operator||(parser const& a, wchar_t b) { return sequential_or >(a.derived(), b); } template inline sequential_or, B> operator||(wchar_t a, parser const& b) { return sequential_or, B>(a, b.derived()); } template inline sequential_or > > operator||(parser const& a, wchar_t const* b) { return sequential_or > >(a.derived(), b); } template inline sequential_or >, B> operator||(wchar_t const* a, parser const& b) { return sequential_or >, B>(a, b.derived()); } template inline alternative operator|(parser const& a, parser const& b) { return alternative(a.derived(), b.derived()); } template inline alternative > operator|(parser const& a, char b) { return alternative >(a.derived(), b); } template inline alternative, B> operator|(char a, parser const& b) { return alternative, B>(a, b.derived()); } template inline alternative > > operator|(parser const& a, char const* b) { return alternative > >(a.derived(), b); } template inline alternative >, B> operator|(char const* a, parser const& b) { return alternative >, B>(a, b.derived()); } template inline alternative > operator|(parser const& a, wchar_t b) { return alternative >(a.derived(), b); } template inline alternative, B> operator|(wchar_t a, parser const& b) { return alternative, B>(a, b.derived()); } template inline alternative > > operator|(parser const& a, wchar_t const* b) { return alternative > >(a.derived(), b); } template inline alternative >, B> operator|(wchar_t const* a, parser const& b) { return alternative >, B>(a, b.derived()); } template inline intersection operator&(parser const& a, parser const& b) { return intersection(a.derived(), b.derived()); } template inline intersection > operator&(parser const& a, char b) { return intersection >(a.derived(), b); } template inline intersection, B> operator&(char a, parser const& b) { return intersection, B>(a, b.derived()); } template inline intersection > > operator&(parser const& a, char const* b) { return intersection > >(a.derived(), b); } template inline intersection >, B> operator&(char const* a, parser const& b) { return intersection >, B>(a, b.derived()); } template inline intersection > operator&(parser const& a, wchar_t b) { return intersection >(a.derived(), b); } template inline intersection, B> operator&(wchar_t a, parser const& b) { return intersection, B>(a, b.derived()); } template inline intersection > > operator&(parser const& a, wchar_t const* b) { return intersection > >(a.derived(), b); } template inline intersection >, B> operator&(wchar_t const* a, parser const& b) { return intersection >, B>(a, b.derived()); } template inline difference operator-(parser const& a, parser const& b) { return difference(a.derived(), b.derived()); } template inline difference > operator-(parser const& a, char b) { return difference >(a.derived(), b); } template inline difference, B> operator-(char a, parser const& b) { return difference, B>(a, b.derived()); } template inline difference > > operator-(parser const& a, char const* b) { return difference > >(a.derived(), b); } template inline difference >, B> operator-(char const* a, parser const& b) { return difference >, B>(a, b.derived()); } template inline difference > operator-(parser const& a, wchar_t b) { return difference >(a.derived(), b); } template inline difference, B> operator-(wchar_t a, parser const& b) { return difference, B>(a, b.derived()); } template inline difference > > operator-(parser const& a, wchar_t const* b) { return difference > >(a.derived(), b); } template inline difference >, B> operator-(wchar_t const* a, parser const& b) { return difference >, B>(a, b.derived()); } template inline exclusive_or operator^(parser const& a, parser const& b) { return exclusive_or(a.derived(), b.derived()); } template inline exclusive_or > operator^(parser const& a, char b) { return exclusive_or >(a.derived(), b); } template inline exclusive_or, B> operator^(char a, parser const& b) { return exclusive_or, B>(a, b.derived()); } template inline exclusive_or > > operator^(parser const& a, char const* b) { return exclusive_or > >(a.derived(), b); } template inline exclusive_or >, B> operator^(char const* a, parser const& b) { return exclusive_or >, B>(a, b.derived()); } template inline exclusive_or > operator^(parser const& a, wchar_t b) { return exclusive_or >(a.derived(), b); } template inline exclusive_or, B> operator^(wchar_t a, parser const& b) { return exclusive_or, B>(a, b.derived()); } template inline exclusive_or > > operator^(parser const& a, wchar_t const* b) { return exclusive_or > >(a.derived(), b); } template inline exclusive_or >, B> operator^(wchar_t const* a, parser const& b) { return exclusive_or >, B>(a, b.derived()); } template optional operator!(parser const& a) { return optional(a.derived()); } template inline kleene_star operator*(parser const& a) { return kleene_star(a.derived()); } template inline positive operator+(parser const& a) { return positive(a.derived()); } template inline sequence > > operator%(parser const& a, parser const& b) { return a.derived() >> *(b.derived() >> a.derived()); } template inline sequence, A> > > operator%(parser const& a, char b) { return a.derived() >> *(b >> a.derived()); } template inline sequence, kleene_star > > > operator%(char a, parser const& b) { return a >> *(b.derived() >> a); } template inline sequence >, A> > > operator%(parser const& a, char const* b) { return a.derived() >> *(b >> a.derived()); } template inline sequence >, kleene_star > > > > operator%(char const* a, parser const& b) { return a >> *(b.derived() >> a); } template inline sequence, A> > > operator%(parser const& a, wchar_t b) { return a.derived() >> *(b >> a.derived()); } template inline sequence, kleene_star > > > operator%(wchar_t a, parser const& b) { return a >> *(b.derived() >> a); } template inline sequence >, A> > > operator%(parser const& a, wchar_t const* b) { return a.derived() >> *(b >> a.derived()); } template inline sequence >, kleene_star > > > > operator%(wchar_t const* a, parser const& b) { return a >> *(b.derived() >> a); } } # 69 "/usr/include/boost/spirit/spirit_core.hpp" 2 3 # 1 "/usr/include/boost/spirit/core/impl/attr_match.ipp" 1 3 namespace spirit { template inline attr_match::attr_match() : val() { } template inline attr_match::attr_match(attr_match const& other) : BaseT(other), val(other.val) { } template inline attr_match::attr_match(unsigned length, TypeT const& val_) : BaseT(length), val(val_) { } template inline attr_match::attr_match(BaseT const& match, TypeT const& val_) : BaseT(match), val(val_) { } template template inline attr_match::attr_match( attr_match const& hit) : BaseT(hit), val(hit.value()) { } template inline TypeT const& attr_match::value() const { return val; } template inline TypeT& attr_match::value() { return val; } template inline void attr_match::value(TypeT const& val_) { val = val_; } } # 70 "/usr/include/boost/spirit/spirit_core.hpp" 2 3 # 1 "/usr/include/boost/spirit/core/impl/attr_action.ipp" 1 3 namespace spirit { template inline attr_action::attr_action( ParserT const& parser_, ActionT const& actor_) : base_action > (parser_, actor_) { } template template inline attr_match attr_action::do_parse( IteratorT& first, IteratorT const& last) const { attr_match hit(this->subject().template do_parse(first, last)); if (hit) this->actor(hit.value()); return hit; } } # 71 "/usr/include/boost/spirit/spirit_core.hpp" 2 3 # 54 "/usr/include/boost/spirit/spirit.hpp" 2 3 # 1 "/usr/include/boost/spirit/spirit_rule.hpp" 1 3 # 1 "/usr/include/boost/spirit/rule/rule.hpp" 1 3 # 1 "/usr/include/boost/spirit/spirit_rule_fwd.hpp" 1 3 namespace spirit { template class skipper; template class rule; template < typename IteratorT = char const*, typename SkipT = skipper > class scanner; template class base_rule; template , typename ParsePolicyT = match_policy> class rule; } # 35 "/usr/include/boost/spirit/rule/rule.hpp" 2 3 namespace spirit { namespace impl { template class abstract_parser; } class rule_id { public: rule_id() : p(0) {} template rule_id(base_rule const* prule) : p(prule) {} rule_id(long l) : p(reinterpret_cast(l)) {} bool operator==(rule_id const& x) { return p == x.p; } bool operator!=(rule_id const& x) { return !(*this == x); } long to_long() { return reinterpret_cast(p); } private: void const * p; }; template class base_rule : public parser { public: typedef IteratorT iterator_type; template typename ParsePolicyT2::match_t do_parse(IteratorT2& first, IteratorT2 const& last) const; base_rule& operator = (base_rule const& other); template base_rule& operator=(ParserT const& parser); rule_id set_id(rule_id id); void reset(); protected: base_rule(); explicit base_rule(rule_id const& id_); base_rule(base_rule const& other); ~base_rule(); template base_rule(parser const& parser); private: impl::abstract_parser* meta; rule_id id; }; template class rule : public base_rule > { typedef base_rule > base_rule_t; public: rule(); explicit rule(rule_id const& id_); rule(rule const& other); template rule(parser const& parser); rule& operator= (rule const& other); template rule& operator= (ParserT const& parser); }; template struct embed_trait > { typedef base_rule const& type; }; template struct embed_trait > { typedef rule const& type; }; template class skipper { public: template skipper(ParserT const& skip_rule, IteratorT const& last); skipper(IteratorT const& last); void skip(IteratorT& current) const; private: IteratorT last; rule skip_rule; }; template parse_info parse( IteratorT const& first, IteratorT const& last, parser const& parser, SkipT const& skip); template parse_info parse( CharT const* str, parser const& parser, SkipT const& skip); } # 1 "/usr/include/boost/spirit/rule/impl/rule.ipp" 1 3 namespace spirit { namespace impl { template class abstract_parser { public: abstract_parser(); virtual ~abstract_parser(); virtual typename ParsePolicyT::match_t do_parse_virtual(IteratorT& first, IteratorT const& last) const = 0; }; template inline abstract_parser::abstract_parser() {} template abstract_parser::~abstract_parser() {} template class concrete_parser : public ParserT, public abstract_parser { public: concrete_parser(ParserT const& parser); virtual ~concrete_parser(); virtual typename ParsePolicyT::match_t do_parse_virtual(IteratorT& first, IteratorT const& last) const; }; template inline concrete_parser::concrete_parser( ParserT const& parser) : ParserT(parser) {} template concrete_parser::~concrete_parser() {} template typename ParsePolicyT::match_t concrete_parser:: do_parse_virtual(IteratorT& first, IteratorT const& last) const { return ParserT::template do_parse(first, last); } template class rule_alias : public abstract_parser { public: rule_alias(base_rule const& alias); virtual ~rule_alias(); virtual typename ParsePolicyT::match_t do_parse_virtual(IteratorT& first, IteratorT const& last) const; private: base_rule const& alias; }; template inline rule_alias::rule_alias( base_rule const& alias_) : alias(alias_) {} template rule_alias::~rule_alias() {} template typename ParsePolicyT::match_t rule_alias:: do_parse_virtual(IteratorT& first, IteratorT const& last) const { return alias.template do_parse(first, last); } template class alt_parser : public abstract_parser { public: alt_parser(abstract_parser* left, ParserT const& right); virtual ~alt_parser(); virtual typename ParsePolicyT::match_t do_parse_virtual(IteratorT& first, IteratorT const& last) const; private: abstract_parser* left; ParserT right; }; template inline alt_parser::alt_parser( abstract_parser* left_, ParserT const& right_) : left(left_), right(right_) {} template alt_parser::~alt_parser() { delete left; } template typename ParsePolicyT::match_t alt_parser:: do_parse_virtual(IteratorT& first, IteratorT const& last) const { if (typename ParsePolicyT::match_t hit = left->do_parse_virtual(first, last)) return hit; return right.template do_parse(first, last); } } template inline base_rule::base_rule() : meta(0), id(this) {} template inline base_rule::base_rule(rule_id const& id_) : meta(0), id(id_) {} template inline base_rule::~base_rule() { delete meta; } template inline void base_rule ::reset() { delete meta; meta = 0; } template inline base_rule ::base_rule(base_rule const& other) : parser() , meta(new impl::rule_alias(other)) , id(this) { } template template inline base_rule ::base_rule(parser const& parser) : meta(new impl::concrete_parser(parser.derived())) , id(this) { } template inline base_rule& base_rule ::operator = (base_rule const& other) { if (this != &other) { if (meta == 0) meta = new impl::rule_alias(other); else meta = new impl::alt_parser(meta, other); } return *this; } template template inline base_rule& base_rule ::operator = (ParserT const& parser) { if (meta == 0) meta = new impl::concrete_parser( parser); else meta = new impl::alt_parser(meta, parser); return *this; } template template inline typename ParsePolicyT2::match_t base_rule::do_parse(IteratorT2& first, IteratorT2 const& last) const { # 318 "/usr/include/boost/spirit/rule/impl/rule.ipp" 3 if (meta) { IteratorT s(first); typename ParsePolicyT::match_t hit = meta->do_parse_virtual(first, last); tree_policy::set_id_and_group(hit, id, s, first); return hit; } else return ParsePolicyT::no_match(); } template inline rule_id base_rule::set_id(rule_id id_) { rule_id sav(id); id = id_; return sav; } template inline rule::rule() { } template inline rule::rule(rule_id const& id) : base_rule > (id) { } template inline rule::rule(rule const& other) : base_rule > (static_cast(other)) { } template template inline rule::rule(parser const& parser) : base_rule >(parser) { } template inline rule& rule::operator = (rule const& other) { if (this != &other) { *static_cast(this) = static_cast(other); } return *this; } template template inline rule& rule::operator=(ParserT const& parser) { *static_cast(this) = parser; return *this; } template template inline skipper::skipper( ParserT const& skip_rule_, IteratorT const& last_) : last(last_), skip_rule(skip_rule_) { } template inline skipper::skipper(IteratorT const& last_) : last(last_), skip_rule(space) { } template inline void skipper::skip(IteratorT& current) const { while (skip_rule.template do_parse(current, last)) {} } template parse_info parse( IteratorT const& first_, IteratorT const& last_, parser const& parser, SkipT const& skip_) { skipper skip(skip_, last_); scanner first(first_, &skip); scanner last(last_, &skip); match hit = parser.derived().template do_parse, match_policy>( first, last); parse_info info; info.stop = first.iterator(); info.match = hit; info.full = hit && (first == last); info.length = hit.length(); return info; } template parse_info parse( CharT const* str, parser const& parser, SkipT const& skip) { CharT const* last = str; while (*last) last++; return parse(str, last, parser, skip); } } # 264 "/usr/include/boost/spirit/rule/rule.hpp" 2 3 # 57 "/usr/include/boost/spirit/spirit_rule.hpp" 2 3 # 1 "/usr/include/boost/spirit/rule/iterators.hpp" 1 3 namespace spirit { namespace impl { template struct iterator_kind { }; template <> struct iterator_kind { typedef std::forward_iterator_tag T; }; template <> struct iterator_kind { typedef std::forward_iterator_tag T; }; template <> struct iterator_kind { typedef std::forward_iterator_tag T; }; } template class scanner { public: typedef IteratorT iterator_type; typedef SkipT skip_type; typedef std::iterator_traits iterator_traits; typedef typename impl::iterator_kind ::T iterator_category; typedef typename iterator_traits::difference_type difference_type; typedef typename iterator_traits::value_type value_type; typedef typename iterator_traits::pointer pointer; typedef typename iterator_traits::reference reference; scanner(iterator_type const& iter, SkipT const* skip); scanner& operator=(iterator_type const& iter_); IteratorT iterator() const; value_type operator*() const; pointer operator->() const; scanner& operator++(); scanner operator++(int); bool operator==(scanner const& other) const; bool operator!=(scanner const& other) const; private: void next() const; IteratorT get() const; SkipT const* skip; mutable IteratorT iter; mutable bool dirty; }; template class nocase_iterator { public: typedef IteratorT iterator_type; typedef std::iterator_traits iterator_traits; typedef typename impl::iterator_kind ::T iterator_category; typedef typename iterator_traits::difference_type difference_type; typedef typename iterator_traits::value_type value_type; typedef typename iterator_traits::pointer pointer; typedef typename iterator_traits::reference reference; nocase_iterator(IteratorT const& iter_); template nocase_iterator& operator=(nocase_iterator const& iter_); nocase_iterator& operator=(IteratorT const& iter_); IteratorT iterator() const; reference operator*(); pointer operator->() const; nocase_iterator& operator++(); nocase_iterator operator++(int); bool operator==(nocase_iterator const& other) const; bool operator!=(nocase_iterator const& other) const; private: iterator_type iter; value_type next; }; namespace impl { template struct strip_scanner > { typedef IteratorT iterator_type; static IteratorT get(scanner const& scanner); }; template struct strip_scanner > > { typedef nocase_iterator iterator_type; static iterator_type get(nocase_iterator > const& nocase_iter); }; template struct strip_nocase { typedef T iterator_type; static T get(T ptr); }; template struct strip_nocase > { typedef IteratorT iterator_type; static IteratorT get(nocase_iterator const& nocase); }; } } # 1 "/usr/include/boost/spirit/rule/impl/iterators.ipp" 1 3 namespace spirit { namespace impl { template inline IteratorT strip_scanner >:: get(scanner const& scanner) { return scanner.iterator(); } template inline nocase_iterator strip_scanner > >:: get(nocase_iterator > const& nocase_iter) { return strip_scanner >:: get(nocase_iter.iterator()); } template inline T strip_nocase::get(T ptr) { return ptr; } template inline IteratorT strip_nocase >:: get(nocase_iterator const& nocase) { return nocase.iterator(); } } template inline scanner::scanner( IteratorT const& iter_, SkipT const* skip_) : skip(skip_), iter(iter_), dirty(true) { } template inline scanner& scanner::operator = (IteratorT const& iter_) { dirty = true; iter = iter_; return *this; } template inline void scanner::next() const { if (dirty) { dirty = false; skip->skip(iter); } } template inline IteratorT scanner::get() const { next(); return iter; } template inline IteratorT scanner::iterator() const { next(); dirty = true; return iter; } template inline typename scanner::value_type scanner::operator*() const { return *get(); } template inline typename scanner::pointer scanner::operator->() const { return get(); } template inline scanner& scanner::operator++() { ++iter; dirty = true; return *this; } template inline scanner scanner::operator++(int) { scanner sc(*this); ++iter; dirty = true; return sc; } template inline bool scanner::operator==(scanner const& other) const { return iter == other.iter; } template inline bool scanner::operator!=(scanner const& other) const { return !(*this == other); } template inline nocase_iterator::nocase_iterator(IteratorT const& iter_) : iter(iter_), next(std::tolower(*iter)) { } template template inline nocase_iterator& nocase_iterator::operator=(nocase_iterator const& iter_) { iter = iter_.iterator(); return *this; } template inline nocase_iterator& nocase_iterator::operator=(IteratorT const& iter_) { iter = iter_; return *this; } template inline IteratorT nocase_iterator::iterator() const { return iter; } template inline typename nocase_iterator::reference nocase_iterator::operator*() { return next; } template inline typename nocase_iterator::pointer nocase_iterator::operator->() const { return &next; } template inline nocase_iterator& nocase_iterator::operator++() { next = std::tolower(*(++iter)); return *this; } template inline nocase_iterator nocase_iterator::operator++(int) { nocase_iterator t(*this); next = std::tolower(*(++iter)); return t; } template inline bool nocase_iterator::operator==(nocase_iterator const& other) const { return iter == other.iter; } template inline bool nocase_iterator::operator!=(nocase_iterator const& other) const { return !(*this == other); } } # 225 "/usr/include/boost/spirit/rule/iterators.hpp" 2 3 # 58 "/usr/include/boost/spirit/spirit_rule.hpp" 2 3 # 1 "/usr/include/boost/spirit/rule/directives.hpp" 1 3 namespace spirit { template class chlit; template class strlit; template class cstring; template struct alternative; template struct contiguous : public unary, public parser > { contiguous(S const& a); template typename ParsePolicyT::match_t do_parse(IteratorT& first, IteratorT const& last) const; }; struct lexeme_parser_gen { template contiguous operator[](parser const& subject) const { return contiguous(subject.derived()); } }; const lexeme_parser_gen lexeme_d = lexeme_parser_gen(); template struct inhibit_case : public unary, public parser > { inhibit_case(S const& a); template typename ParsePolicyT::match_t do_parse(IteratorT& first, IteratorT const& last) const; }; struct inhibit_case_parser_gen { template inhibit_case operator[](parser const& subject) const { return inhibit_case(subject.derived()); } inhibit_case > operator[](char ch) const; inhibit_case > operator[](wchar_t ch) const; inhibit_case > > operator[](char const* str) const; inhibit_case > > operator[](wchar_t const* str) const; }; const inhibit_case_parser_gen nocase_d = inhibit_case_parser_gen(); template struct longest_alternative : public binary, public parser > { longest_alternative(A const& a, B const& b); template typename ParsePolicyT::match_t do_parse(IteratorT& first, IteratorT const& last) const; }; namespace impl { template struct to_longest_alternative; template struct to_longest_alternative >; } struct longest_parser_gen { template typename impl::to_longest_alternative >::return_t operator[](alternative const& alt) const { return impl::to_longest_alternative >::convert(alt); } }; const longest_parser_gen longest_d = longest_parser_gen(); template struct shortest_alternative : public binary, public parser > { shortest_alternative(A const& a, B const& b); template typename ParsePolicyT::match_t do_parse(IteratorT& first, IteratorT const& last) const; }; namespace impl { template struct to_shortest_alternative; template struct to_shortest_alternative >; } struct shortest_parser_gen { template typename impl::to_shortest_alternative >::return_t operator[](alternative const& alt) const { return impl::to_shortest_alternative >::convert(alt); } }; const shortest_parser_gen shortest_d = shortest_parser_gen(); } # 1 "/usr/include/boost/spirit/rule/impl/directives.ipp" 1 3 namespace spirit { template inline contiguous::contiguous(S const& a) : unary(a) { } template template inline typename ParsePolicyT::match_t contiguous::do_parse(IteratorT& first, IteratorT const& last) const { typedef typename impl::strip_scanner ::iterator_type plain_iter; plain_iter i1 = impl::strip_scanner::get(first); plain_iter i2 = impl::strip_scanner::get(last); typename ParsePolicyT::match_t hit = this->subject().template do_parse(i1, i2); if (hit) first = i1; return hit; } template inline inhibit_case::inhibit_case(S const& a) : unary(a) { } template template inline typename ParsePolicyT::match_t inhibit_case::do_parse(IteratorT& first, IteratorT const& last) const { nocase_iterator i1(first); nocase_iterator i2(last); typename ParsePolicyT::match_t hit = this->subject().template do_parse, ParsePolicyT>(i1, i2); if (hit) first = i1.iterator(); return hit; } inline inhibit_case > inhibit_case_parser_gen::operator[](char ch) const { return inhibit_case >(chlit(ch)); } inline inhibit_case > inhibit_case_parser_gen::operator[](wchar_t ch) const { return inhibit_case >(chlit(ch)); } inline inhibit_case > > inhibit_case_parser_gen::operator[](char const* str) const { return inhibit_case > > (strlit >(str)); } inline inhibit_case > > inhibit_case_parser_gen::operator[](wchar_t const* str) const { return inhibit_case > > (strlit >(str)); } template inline longest_alternative::longest_alternative(A const& a, B const& b) : binary(a, b) { } template template inline typename ParsePolicyT::match_t longest_alternative::do_parse(IteratorT& first, IteratorT const& last) const { IteratorT ls = first; IteratorT rs = first; typename ParsePolicyT::match_t l = this->left().template do_parse(ls, last); typename ParsePolicyT::match_t r = this->right().template do_parse(rs, last); if (l || r) { bool less = l.length() < r.length(); first = less ? rs : ls; return less ? r : l; } return ParsePolicyT::no_match(); } namespace impl { template struct to_longest_alternative { typedef T return_t; static return_t const& convert(T const& a) { return a; } }; template struct to_longest_alternative > { typedef typename to_longest_alternative::return_t a_t; typedef typename to_longest_alternative::return_t b_t; typedef longest_alternative return_t; static return_t convert(alternative const& alt) { return return_t( to_longest_alternative::convert(alt.left()), to_longest_alternative::convert(alt.right())); } }; } template inline shortest_alternative::shortest_alternative(A const& a, B const& b) : binary(a, b) { } template template inline typename ParsePolicyT::match_t shortest_alternative::do_parse(IteratorT& first, IteratorT const& last) const { IteratorT ls = first; IteratorT rs = first; typename ParsePolicyT::match_t l = this->left().template do_parse(ls, last); typename ParsePolicyT::match_t r = this->right().template do_parse(rs, last); if (l || r) { bool less = l.length() < r.length(); first = less ? ls : rs; return less ? l : r; } return ParsePolicyT::no_match(); } namespace impl { template struct to_shortest_alternative { typedef T return_t; static return_t const& convert(T const& a) { return a; } }; template struct to_shortest_alternative > { typedef typename to_shortest_alternative::return_t a_t; typedef typename to_shortest_alternative::return_t b_t; typedef shortest_alternative return_t; static return_t convert(alternative const& alt) { return return_t( to_shortest_alternative::convert(alt.left()), to_shortest_alternative::convert(alt.right())); } }; } } # 277 "/usr/include/boost/spirit/rule/directives.hpp" 2 3 # 59 "/usr/include/boost/spirit/spirit_rule.hpp" 2 3 # 1 "/usr/include/boost/spirit/rule/exceptions.hpp" 1 3 namespace spirit { class parser_error_base { protected: parser_error_base(); ~parser_error_base(); parser_error_base(parser_error_base const&); parser_error_base& operator=(parser_error_base const&); }; template class parser_error : public parser_error_base { public: parser_error(IteratorT where, ErrorDescrT what); IteratorT where() const; ErrorDescrT what() const; private: IteratorT iter; ErrorDescrT info; }; template void throw_(IteratorT where, ErrorDescrT what); template class assertive_parser : public unary, public parser > { public: assertive_parser(ParserT const& parser, ErrorDescrT what); template typename ParsePolicyT::match_t do_parse(IteratorT& first, IteratorT const& last) const; private: ErrorDescrT info; }; template class assertion { public: assertion(ErrorDescrT what); template assertive_parser operator()(ParserT const& parser) const { return assertive_parser(parser, info); } private: ErrorDescrT info; }; template class fallback_parser : public unary, public parser > { public: fallback_parser(ParserT const& parser, HandlerT const& handler); template typename ParsePolicyT::match_t do_parse(IteratorT& first, IteratorT const& last) const; private: HandlerT handler; }; template struct guard { template fallback_parser operator()(ParserT const& parser, HandlerT const& handler) { return fallback_parser(parser, handler); } }; } # 1 "/usr/include/boost/spirit/rule/impl/exceptions.ipp" 1 3 namespace spirit { inline parser_error_base::parser_error_base() { } inline parser_error_base::~parser_error_base() { } inline parser_error_base::parser_error_base(parser_error_base const&) { } inline parser_error_base& parser_error_base::operator=(parser_error_base const&) { return *this; } template inline parser_error::parser_error( IteratorT where, ErrorDescrT what) : iter(where), info(what) { } template inline IteratorT parser_error::where() const { return iter; } template inline ErrorDescrT parser_error::what() const { return info; } template void throw_(IteratorT where, ErrorDescrT what) { throw parser_error(where, what); } template inline assertive_parser::assertive_parser( ParserT const& parser, ErrorDescrT what) : unary(parser), info(what) { } template template inline typename ParsePolicyT::match_t assertive_parser::do_parse( IteratorT& first, IteratorT const& last) const { typename ParsePolicyT::match_t hit = this->subject().template do_parse(first, last); if (!hit) throw parser_error(first, info); return hit; } template inline assertion::assertion(ErrorDescrT what) : info(what) {} template inline fallback_parser::fallback_parser( ParserT const& parser, HandlerT const& handler_) : unary(parser), handler(handler_) { } # 183 "/usr/include/boost/spirit/rule/impl/exceptions.ipp" 3 template template inline typename ParsePolicyT::match_t fallback_parser::do_parse( IteratorT& first, IteratorT const& last) const { try { return this->subject().template do_parse(first, last); } catch (parser_error error) { return handler(first, last, error.where(), error.what()); } } # 220 "/usr/include/boost/spirit/rule/impl/exceptions.ipp" 3 } # 262 "/usr/include/boost/spirit/rule/exceptions.hpp" 2 3 # 60 "/usr/include/boost/spirit/spirit_rule.hpp" 2 3 # 1 "/usr/include/boost/spirit/rule/loops.hpp" 1 3 namespace spirit { template class fixed_loop : public unary, public parser > { public: fixed_loop(S const& subject, ExactT const& exact); template typename ParsePolicyT::match_t do_parse(IteratorT& first, IteratorT const& last) const; private: ExactT exact; }; template class finite_loop : public unary, public parser > { public: finite_loop(S const& a, MinT const& min, MaxT const& max); template typename ParsePolicyT::match_t do_parse(IteratorT& first, IteratorT const& last) const; private: MinT min; MaxT max; }; template class infinite_loop : public unary, public parser > { public: infinite_loop(S const& subject, MinT const& min, more_t); template typename ParsePolicyT::match_t do_parse(IteratorT& first, IteratorT const& last) const; private: MinT min; }; } # 1 "/usr/include/boost/spirit/rule/impl/loops.ipp" 1 3 namespace spirit { template inline fixed_loop::fixed_loop( S const& subject_, ExactT const& exact_) : unary(subject_), exact(exact_) { } template template inline typename ParsePolicyT::match_t fixed_loop::do_parse(IteratorT& first, IteratorT const& last) const { unsigned n = exact; typename ParsePolicyT::match_t hit(0); for (unsigned i = 0; i < n; ++i) { typename ParsePolicyT::match_t next = this->subject().template do_parse(first, last); if (!next) return ParsePolicyT::no_match(); ParsePolicyT::concat(hit, next); } return hit; } template inline finite_loop::finite_loop( S const& subject_, MinT const& min_, MaxT const& max_) : unary(subject_), min(min_), max(max_) { } template template inline typename ParsePolicyT::match_t finite_loop::do_parse(IteratorT& first, IteratorT const& last) const { unsigned n1 = min; unsigned n2 = max; (( n1 < n2 ) ? (void)0 : __assert("/usr/include/boost/spirit/rule/impl/loops.ipp", 107, "n1 < n2")) ; IteratorT s = first; typename ParsePolicyT::match_t hit(0); for (unsigned i = 0; i < n2; ++i) { typename ParsePolicyT::match_t next = this->subject().template do_parse(s, last); if (!next) if (i >= n1) { break; } else { first = s; return ParsePolicyT::no_match(); } ParsePolicyT::concat(hit, next); } first = s; return hit; } template inline infinite_loop::infinite_loop( S const& subject_, MinT const& min_, more_t) : unary(subject_), min(min_) { } template template inline typename ParsePolicyT::match_t infinite_loop::do_parse(IteratorT& first, IteratorT const& last) const { unsigned n = min; typename ParsePolicyT::match_t hit(0); for (unsigned i = 0;; ++i) { IteratorT s = first; typename ParsePolicyT::match_t next = this->subject().template do_parse(s, last); if (!next) if (i >= n) break; else return ParsePolicyT::no_match(); ParsePolicyT::concat(hit, next); first = s; } return hit; } } # 159 "/usr/include/boost/spirit/rule/loops.hpp" 2 3 # 61 "/usr/include/boost/spirit/spirit_rule.hpp" 2 3 # 55 "/usr/include/boost/spirit/spirit.hpp" 2 3 # 1 "/usr/include/boost/spirit/spirit_attr.hpp" 1 3 # 1 "/usr/include/boost/spirit/attr/closure.hpp" 1 3 # 1 "/usr/include/boost/spirit/spirit_attr_fwd.hpp" 1 3 # 1 "/usr/include/boost/tuple/tuple.hpp" 1 3 # 1 "/usr/include/boost/static_assert.hpp" 1 3 namespace boost{ template struct STATIC_ASSERTION_FAILURE; template <> struct STATIC_ASSERTION_FAILURE{}; template struct static_assert_test{}; } # 22 "/usr/include/boost/tuple/tuple.hpp" 2 3 # 1 "/usr/include/boost/ref.hpp" 1 3 namespace boost { template class reference_wrapper { public: explicit reference_wrapper(T & t): t_(t) {} operator T & () const { return t_; } T & get() const { return t_; } private: T & t_; reference_wrapper & operator= (reference_wrapper const &); }; template inline reference_wrapper ref(T & t) { return reference_wrapper(t); } template inline reference_wrapper cref(T const & t) { return reference_wrapper(t); } } # 30 "/usr/include/boost/tuple/tuple.hpp" 2 3 # 1 "/usr/include/boost/tuple/detail/tuple_basic.hpp" 1 3 namespace boost { namespace tuples { struct null_type {}; namespace detail { inline const null_type cnull_type() { return null_type(); } } template struct cons; template < class T0 = null_type, class T1 = null_type, class T2 = null_type, class T3 = null_type, class T4 = null_type, class T5 = null_type, class T6 = null_type, class T7 = null_type, class T8 = null_type, class T9 = null_type> class tuple; template struct length; namespace detail { template class generate_error; template struct default_arg { static typename boost::remove_cv::type f() { return T(); } }; template struct default_arg { static T* f() { return generate_error::arrays_are_not_valid_tuple_elements; } }; template struct default_arg { static T& f() { return generate_error::no_default_values_for_reference_types; } }; template< int N > struct get_class { template inline static RET get(const cons& t) { return get_class::template get(t.tail); } template inline static RET get(cons& t) { return get_class::template get(t.tail); } }; template<> struct get_class<0> { template inline static RET get(const cons& t) { return t.head; } template inline static RET get(cons& t) { return t.head; } }; } template struct element { private: typedef typename T::tail_type Next; public: typedef typename element::type type; }; template struct element<0,T> { typedef typename T::head_type type; }; template struct access_traits { typedef const T& const_type; typedef T& non_const_type; typedef const typename boost::remove_cv::type& parameter_type; }; template struct access_traits { typedef T& const_type; typedef T& non_const_type; typedef T& parameter_type; }; template inline typename access_traits< typename element >::type >::non_const_type get(cons& c) { return detail::get_class::template get< typename access_traits< typename element >::type >::non_const_type>(c); } template inline typename access_traits< typename element >::type >::const_type get(const cons& c) { return detail::get_class::template get< typename access_traits< typename element >::type >::const_type>(c); } template struct cons { typedef HT head_type; typedef TT tail_type; head_type head; tail_type tail; typename access_traits::non_const_type get_head() { return head; } typename access_traits::non_const_type get_tail() { return tail; } typename access_traits::const_type get_head() const { return head; } typename access_traits::const_type get_tail() const { return tail; } cons() : head(detail::default_arg::f()), tail() {} cons(typename access_traits::parameter_type h, const tail_type& t) : head (h), tail(t) {} template cons( T1& t1, T2& t2, T3& t3, T4& t4, T5& t5, T6& t6, T7& t7, T8& t8, T9& t9, T10& t10 ) : head (t1), tail (t2, t3, t4, t5, t6, t7, t8, t9, t10, detail::cnull_type()) {} template cons( const cons& u ) : head(u.head), tail(u.tail) {} template cons& operator=( const cons& u ) { head=u.head; tail=u.tail; return *this; } cons& operator=(const cons& u) { head = u.head; tail = u.tail; return *this; } template cons& operator=( const std::pair& u ) { typedef ::boost::static_assert_test< sizeof(::boost::STATIC_ASSERTION_FAILURE< (bool)( length::value == 2 ) >)> boost_static_assert_typedef_282 ; head = u.first; tail.head = u.second; return *this; } template typename access_traits< typename element >::type >::non_const_type get() { return boost::tuples::get(*this); } template typename access_traits< typename element >::type >::const_type get() const { return boost::tuples::get(*this); } }; template struct cons { typedef HT head_type; typedef null_type tail_type; head_type head; typename access_traits::non_const_type get_head() { return head; } null_type get_tail() { return null_type(); } typename access_traits::const_type get_head() const { return head; } const null_type get_tail() const { return null_type(); } cons() : head(detail::default_arg::f()) {} cons(typename access_traits::parameter_type h, const null_type& = null_type()) : head (h) {} template cons(T1& t1, const null_type&, const null_type&, const null_type&, const null_type&, const null_type&, const null_type&, const null_type&, const null_type&, const null_type&) : head (t1) {} template cons( const cons& u ) : head(u.head) {} template cons& operator=(const cons& u ) { head = u.head; return *this; } cons& operator=(const cons& u) { head = u.head; return *this; } template typename access_traits< typename element::type >::non_const_type get() { return boost::tuples::get(*this); } template typename access_traits< typename element::type >::const_type get() const { return boost::tuples::get(*this); } }; template struct length { static const int value = 1 + length::value ; }; template<> struct length { static const int value = 0 ; }; namespace detail { template struct map_tuple_to_cons { typedef cons::type > type; }; template <> struct map_tuple_to_cons { typedef null_type type; }; } template class tuple : public detail::map_tuple_to_cons::type { public: typedef typename detail::map_tuple_to_cons::type inherited; typedef typename inherited::head_type head_type; typedef typename inherited::tail_type tail_type; explicit tuple( typename access_traits::parameter_type t0 = detail::default_arg::f(), typename access_traits::parameter_type t1 = detail::default_arg::f(), typename access_traits::parameter_type t2 = detail::default_arg::f(), typename access_traits::parameter_type t3 = detail::default_arg::f(), typename access_traits::parameter_type t4 = detail::default_arg::f(), typename access_traits::parameter_type t5 = detail::default_arg::f(), typename access_traits::parameter_type t6 = detail::default_arg::f(), typename access_traits::parameter_type t7 = detail::default_arg::f(), typename access_traits::parameter_type t8 = detail::default_arg::f(), typename access_traits::parameter_type t9 = detail::default_arg::f()) : inherited(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9) {} template tuple(const cons& p) : inherited(p) {} template tuple& operator=(const cons& k) { inherited::operator=(k); return *this; } template tuple& operator=(const std::pair& k) { typedef ::boost::static_assert_test< sizeof(::boost::STATIC_ASSERTION_FAILURE< (bool)( length::value == 2 ) >)> boost_static_assert_typedef_449 ; this->head = k.first; this->tail.head = k.second; return *this; } }; template <> class tuple : public null_type { public: typedef null_type inherited; }; namespace detail { struct swallow_assign { template swallow_assign& operator=(const T&) { return *this; } }; } namespace { detail::swallow_assign ignore; } template struct make_tuple_traits { typedef T type; }; template struct make_tuple_traits { typedef typename detail::generate_error:: do_not_use_with_reference_type error; }; template struct make_tuple_traits { typedef const T (&type)[n]; }; template struct make_tuple_traits { typedef const T (&type)[n]; }; template struct make_tuple_traits { typedef const volatile T (&type)[n]; }; template struct make_tuple_traits { typedef const volatile T (&type)[n]; }; template struct make_tuple_traits >{ typedef T& type; }; template struct make_tuple_traits >{ typedef T& type; }; namespace detail { template < class T0 = null_type, class T1 = null_type, class T2 = null_type, class T3 = null_type, class T4 = null_type, class T5 = null_type, class T6 = null_type, class T7 = null_type, class T8 = null_type, class T9 = null_type