|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r54896 - in trunk/boost/spirit/repository: home home/qi home/support include
From: hartmut.kaiser_at_[hidden]
Date: 2009-07-11 14:23:58
Author: hkaiser
Date: 2009-07-11 14:23:57 EDT (Sat, 11 Jul 2009)
New Revision: 54896
URL: http://svn.boost.org/trac/boost/changeset/54896
Log:
Spirit: adding flush_multi_pass to the repository
Added:
trunk/boost/spirit/repository/home/qi/flush_multi_pass.hpp (contents, props changed)
trunk/boost/spirit/repository/home/support/flush_multi_pass.hpp (contents, props changed)
trunk/boost/spirit/repository/include/qi.hpp (contents, props changed)
trunk/boost/spirit/repository/include/qi_flush_multi_pass.hpp (contents, props changed)
Text files modified:
trunk/boost/spirit/repository/home/qi.hpp | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
Modified: trunk/boost/spirit/repository/home/qi.hpp
==============================================================================
--- trunk/boost/spirit/repository/home/qi.hpp (original)
+++ trunk/boost/spirit/repository/home/qi.hpp 2009-07-11 14:23:57 EDT (Sat, 11 Jul 2009)
@@ -11,6 +11,7 @@
#pragma once
#endif
+#include <boost/spirit/repository/qi/flush_multi_pass.hpp>
//#include <boost/spirit/repository/qi/confix.hpp>
//#include <boost/spirit/repository/qi/distinct.hpp>
Added: trunk/boost/spirit/repository/home/qi/flush_multi_pass.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/spirit/repository/home/qi/flush_multi_pass.hpp 2009-07-11 14:23:57 EDT (Sat, 11 Jul 2009)
@@ -0,0 +1,108 @@
+// Copyright (c) 2001-2009 Hartmut Kaiser
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+#if !defined(BOOST_SPIRIT_REPOSITORY_QI_FLUSH_MULTI_PASS_JUL_10_2009_0535PM)
+#define BOOST_SPIRIT_REPOSITORY_QI_FLUSH_MULTI_PASS_JUL_10_2009_0535PM
+
+#if defined(_MSC_VER)
+#pragma once
+#endif
+
+#include <boost/spirit/home/qi/domain.hpp>
+#include <boost/spirit/home/qi/meta_compiler.hpp>
+#include <boost/spirit/home/support/common_terminals.hpp>
+#include <boost/spirit/home/support/info.hpp>
+#include <boost/spirit/home/support/unused.hpp>
+#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/support/multi_pass.hpp>
+
+#include <boost/spirit/repository/home/support/flush_multi_pass.hpp>
+
+///////////////////////////////////////////////////////////////////////////////
+namespace boost { namespace spirit
+{
+ ///////////////////////////////////////////////////////////////////////////
+ // Enablers
+ ///////////////////////////////////////////////////////////////////////////
+
+ // enables flush_multi_pass
+ template <>
+ struct use_terminal<qi::domain, repository::tag::flush_multi_pass>
+ : mpl::true_ {};
+
+}}
+
+///////////////////////////////////////////////////////////////////////////////
+namespace boost { namespace spirit { namespace repository { namespace qi
+{
+ using repository::flush_multi_pass_type;
+ using repository::flush_multi_pass;
+
+ namespace detail
+ {
+ // normal iterators require no special handling
+ template <typename Iterator>
+ void clear_queue(Iterator& it)
+ {
+ }
+
+ // where a multi_pass has some means to clear the internal buffers
+ template<typename T, typename Policies>
+ void clear_queue(multi_pass<T, Policies>& it)
+ {
+ it.clear_queue();
+ }
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // for a flush_multi_pass_parser generated parser
+ struct flush_multi_pass_parser
+ : spirit::qi::primitive_parser<flush_multi_pass_parser>
+ {
+ template <typename Context, typename Unused>
+ struct attribute
+ {
+ typedef unused_type type;
+ };
+
+ template <typename Iterator, typename Context
+ , typename Skipper, typename Attribute>
+ bool parse(Iterator& first, Iterator const& last
+ , Context& context, Skipper const& skipper
+ , Attribute& attr) const
+ {
+ repository::qi::detail::clear_queue(first);
+ return true;
+ }
+
+ template <typename Context>
+ info what(Context const& ctx) const
+ {
+ return info("flush_multi_pass");
+ }
+ };
+
+}}}}
+
+///////////////////////////////////////////////////////////////////////////////
+namespace boost { namespace spirit { namespace qi
+{
+ ///////////////////////////////////////////////////////////////////////////
+ // Parser generators: make_xxx function (objects)
+ ///////////////////////////////////////////////////////////////////////////
+ template <typename Modifiers>
+ struct make_primitive<repository::tag::flush_multi_pass, Modifiers>
+ {
+ typedef repository::qi::flush_multi_pass_parser result_type;
+ result_type operator()(unused_type, unused_type) const
+ {
+ return result_type();
+ }
+ };
+
+}}}
+
+#endif
+
Added: trunk/boost/spirit/repository/home/support/flush_multi_pass.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/spirit/repository/home/support/flush_multi_pass.hpp 2009-07-11 14:23:57 EDT (Sat, 11 Jul 2009)
@@ -0,0 +1,22 @@
+// Copyright (c) 2001-2009 Hartmut Kaiser
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+#if !defined(BOOST_SPIRIT_REPOSITORY_SUPPORT_CONFIX_APR_28_2009_0110PM)
+#define BOOST_SPIRIT_REPOSITORY_SUPPORT_CONFIX_APR_28_2009_0110PM
+
+#if defined(_MSC_VER)
+#pragma once
+#endif
+
+#include <boost/spirit/home/support/terminal.hpp>
+
+namespace boost { namespace spirit { namespace repository
+{
+ // The flush_multi_pass extended terminal
+ BOOST_SPIRIT_DEFINE_TERMINALS(( flush_multi_pass ))
+
+}}}
+
+#endif
Added: trunk/boost/spirit/repository/include/qi.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/spirit/repository/include/qi.hpp 2009-07-11 14:23:57 EDT (Sat, 11 Jul 2009)
@@ -0,0 +1,18 @@
+/*=============================================================================
+ Copyright (c) 2001-2009 Joel de Guzman
+ Copyright (c) 2001-2009 Hartmut Kaiser
+ http://spirit.sourceforge.net/
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+=============================================================================*/
+#ifndef BOOST_SPIRIT_INCLUDE_QI_REPOSITORY
+#define BOOST_SPIRIT_INCLUDE_QI_REPOSITORY
+
+#if defined(_MSC_VER)
+#pragma once
+#endif
+
+#include <boost/spirit/repository/home/qi.hpp>
+
+#endif
Added: trunk/boost/spirit/repository/include/qi_flush_multi_pass.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/spirit/repository/include/qi_flush_multi_pass.hpp 2009-07-11 14:23:57 EDT (Sat, 11 Jul 2009)
@@ -0,0 +1,18 @@
+/*=============================================================================
+ Copyright (c) 2001-2009 Joel de Guzman
+ Copyright (c) 2001-2009 Hartmut Kaiser
+ http://spirit.sourceforge.net/
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+=============================================================================*/
+#ifndef BOOST_SPIRIT_INCLUDE_QI_REPOSITORY_FLUSH_MULTI_PASS
+#define BOOST_SPIRIT_INCLUDE_QI_REPOSITORY_FLUSH_MULTI_PASS
+
+#if defined(_MSC_VER)
+#pragma once
+#endif
+
+#include <boost/spirit/repository/home/qi/flush_multi_pass.hpp>
+
+#endif
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk