annotate DEPENDENCIES/generic/include/boost/spirit/home/classic/dynamic/lazy.hpp @ 133:4acb5d8d80b6 tip

Don't fail environmental check if README.md exists (but .txt and no-suffix don't)
author Chris Cannam
date Tue, 30 Jul 2019 12:25:44 +0100
parents 2665513ce2d3
children
rev   line source
Chris@16 1 /*=============================================================================
Chris@16 2 Copyright (c) 2003 Joel de Guzman
Chris@16 3 Copyright (c) 2003 Vaclav Vesely
Chris@16 4 http://spirit.sourceforge.net/
Chris@16 5
Chris@16 6 Distributed under the Boost Software License, Version 1.0. (See accompanying
Chris@16 7 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
Chris@16 8 =============================================================================*/
Chris@16 9 #ifndef BOOST_SPIRIT_LAZY_HPP
Chris@16 10 #define BOOST_SPIRIT_LAZY_HPP
Chris@16 11
Chris@16 12 ////////////////////////////////////////////////////////////////////////////////
Chris@16 13 #include <boost/spirit/home/classic/namespace.hpp>
Chris@16 14 #include <boost/spirit/home/classic/core/parser.hpp>
Chris@16 15 #include <boost/spirit/home/classic/phoenix/actor.hpp>
Chris@16 16
Chris@16 17 ////////////////////////////////////////////////////////////////////////////////
Chris@16 18
Chris@16 19 namespace boost { namespace spirit {
Chris@16 20
Chris@16 21 BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
Chris@16 22
Chris@16 23 ////////////////////////////////////////////////////////////////////////////
Chris@16 24 //
Chris@16 25 // lazy_parser, holds phoenix actor which returns a spirit parser.
Chris@16 26 //
Chris@16 27 ////////////////////////////////////////////////////////////////////////////
Chris@16 28
Chris@16 29 template<class ActorT>
Chris@16 30 struct lazy_parser : parser<lazy_parser<ActorT> >
Chris@16 31 {
Chris@16 32 typedef lazy_parser<ActorT> self_t;
Chris@16 33 typedef typename ::phoenix::actor_result<
Chris@16 34 ActorT, ::phoenix::tuple<> >::plain_type actor_result_t;
Chris@16 35
Chris@16 36 template<typename ScannerT>
Chris@16 37 struct result
Chris@16 38 {
Chris@16 39 typedef typename
Chris@16 40 parser_result<actor_result_t, ScannerT>::type
Chris@16 41 type;
Chris@16 42 };
Chris@16 43
Chris@16 44 lazy_parser(ActorT const& actor_)
Chris@16 45 : actor(actor_) {}
Chris@16 46
Chris@16 47 template<typename ScannerT>
Chris@16 48 typename parser_result<self_t, ScannerT>::type
Chris@16 49 parse(ScannerT const& scan) const
Chris@16 50 { return actor().parse(scan); }
Chris@16 51
Chris@16 52 ActorT actor;
Chris@16 53 };
Chris@16 54
Chris@16 55 //////////////////////////////
Chris@16 56 // lazy_p, returns lazy_parser
Chris@16 57 // Usage: lazy_p(actor)
Chris@16 58 template<class ActorT>
Chris@16 59 lazy_parser<ActorT> lazy_p(ActorT const& actor)
Chris@16 60 { return lazy_parser<ActorT>(actor); }
Chris@16 61
Chris@16 62 BOOST_SPIRIT_CLASSIC_NAMESPACE_END
Chris@16 63
Chris@16 64 }} // namespace BOOST_SPIRIT_CLASSIC_NS
Chris@16 65
Chris@16 66 #endif // BOOST_SPIRIT_LAZY_HPP