/usr/include/boost/phoenix/statement
Edit: /usr/include/boost/phoenix/statement/do_while.hpp (1996B)
/*==============================================================================
Copyright (c) 2001-2010 Joel de Guzman
Copyright (c) 2010 Thomas Heller
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_PHOENIX_STATEMENT_DO_WHILE_HPP
#define BOOST_PHOENIX_STATEMENT_DO_WHILE_HPP
#include
#include
#include
#include
BOOST_PHOENIX_DEFINE_EXPRESSION(
(boost)(phoenix)(do_while)
, (meta_grammar) // Cond
(meta_grammar) // Do
)
namespace boost { namespace phoenix
{
struct do_while_eval
{
typedef void result_type;
template
result_type
operator()(Cond const& cond, Do const& do_it, Context const & ctx) const
{
do
boost::phoenix::eval(do_it, ctx);
while (boost::phoenix::eval(cond, ctx));
}
};
template
struct default_actions::when
: call
{};
template
struct do_while_gen
{
do_while_gen(Do const& do_it)
: do_(do_it) {}
template
typename expression::do_while::type const
while_(Cond const& cond) const
{
return expression::do_while::make(cond, do_);
}
Do const& do_;
};
struct do_gen
{
template
do_while_gen const
operator[](Do const& do_) const
{
return do_while_gen(do_);
}
};
#ifndef BOOST_PHOENIX_NO_PREDEFINED_TERMINALS
do_gen const do_ = {};
#endif
}}
#endif