1
0
Fork 0
mirror of https://github.com/bolero-MURAKAMI/Sprout synced 2025-08-03 12:49:50 +00:00

weed::traits::attribute_of をコンテキストに依存するよう変更

This commit is contained in:
bolero-MURAKAMI 2011-11-14 20:48:17 +09:00
parent a7698fa6e9
commit 1c898f8b93
13 changed files with 64 additions and 79 deletions

View file

@ -4,6 +4,7 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/tuple/tuple.hpp>
#include <sprout/weed/unused.hpp>
#include <sprout/weed/eval_result.hpp>
#include <sprout/weed/expr/tag.hpp>
#include <sprout/weed/expr/eval.hpp>
@ -30,7 +31,7 @@ namespace sprout {
private:
typedef sprout::weed::parse_context<Iterator> context_type;
public:
typedef typename sprout::weed::traits::attribute_of<Expr, Iterator, context_type>::type attribute_type;
typedef sprout::weed::unused attribute_type;
typedef sprout::weed::eval_result<context_type, Iterator, attribute_type> result_type;
public:
SPROUT_CONSTEXPR result_type operator()(

View file

@ -7,6 +7,7 @@
#include <sprout/weed/eval_result.hpp>
#include <sprout/weed/expr/tag.hpp>
#include <sprout/weed/expr/eval.hpp>
#include <sprout/weed/attr_cnv/result_of/bitwise_or.hpp>
#include <sprout/weed/attr_cnv/bitwise_or.hpp>
#include <sprout/weed/traits/expr/tag_of.hpp>
#include <sprout/weed/traits/parser/attribute_of.hpp>
@ -35,7 +36,10 @@ namespace sprout {
typedef typename sprout::weed::traits::attribute_of<expr1_type, Iterator, context_type>::type attr1_type;
typedef typename sprout::weed::traits::attribute_of<expr2_type, Iterator, context_type>::type attr2_type;
public:
typedef typename sprout::weed::traits::attribute_of<Expr, Iterator, context_type>::type attribute_type;
typedef typename sprout::weed::attr_cnv::result_of::bitwise_or<
typename sprout::weed::traits::attribute_of<expr1_type, Iterator, context_type>::type,
typename sprout::weed::traits::attribute_of<expr2_type, Iterator, context_type>::type
>::type attribute_type;
typedef sprout::weed::eval_result<context_type, Iterator, attribute_type> result_type;
private:
template<typename Result2>

View file

@ -8,6 +8,7 @@
#include <sprout/weed/limited.hpp>
#include <sprout/weed/expr/tag.hpp>
#include <sprout/weed/expr/eval.hpp>
#include <sprout/weed/attr_cnv/result_of/times.hpp>
#include <sprout/weed/attr_cnv/times.hpp>
#include <sprout/weed/traits/expr/tag_of.hpp>
#include <sprout/weed/traits/parser/attribute_of.hpp>
@ -36,7 +37,10 @@ namespace sprout {
typedef typename sprout::weed::traits::limit_of<expr_type, Iterator, context_type>::type limit;
typedef typename sprout::weed::traits::attribute_of<expr_type, Iterator, context_type>::type attr_type;
public:
typedef typename sprout::weed::traits::attribute_of<Expr, Iterator, context_type>::type attribute_type;
typedef typename sprout::weed::attr_cnv::result_of::times<
limit::value,
typename sprout::weed::traits::attribute_of<expr_type, Iterator, context_type>::type
>::type attribute_type;
typedef sprout::weed::eval_result<context_type, Iterator, attribute_type> result_type;
private:
template<typename Result, typename Head, typename... Attrs>

View file

@ -4,6 +4,7 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/tuple/tuple.hpp>
#include <sprout/weed/unused.hpp>
#include <sprout/weed/eval_result.hpp>
#include <sprout/weed/expr/tag.hpp>
#include <sprout/weed/expr/eval.hpp>
@ -30,7 +31,7 @@ namespace sprout {
private:
typedef sprout::weed::parse_context<Iterator> context_type;
public:
typedef typename sprout::weed::traits::attribute_of<Expr, Iterator, context_type>::type attribute_type;
typedef sprout::weed::unused attribute_type;
typedef sprout::weed::eval_result<context_type, Iterator, attribute_type> result_type;
public:
SPROUT_CONSTEXPR result_type operator()(

View file

@ -29,8 +29,10 @@ namespace sprout {
> {
private:
typedef sprout::weed::parse_context<Iterator> context_type;
typedef typename sprout::tuples::tuple_element<0, typename Expr::args_type>::type expr1_type;
typedef typename sprout::tuples::tuple_element<1, typename Expr::args_type>::type expr2_type;
public:
typedef typename sprout::weed::traits::attribute_of<Expr, Iterator, context_type>::type attribute_type;
typedef typename sprout::weed::traits::attribute_of<expr1_type, Iterator, context_type>::type attribute_type;
typedef sprout::weed::eval_result<context_type, Iterator, attribute_type> result_type;
private:
template<typename Result1>

View file

@ -8,6 +8,7 @@
#include <sprout/weed/limited.hpp>
#include <sprout/weed/expr/tag.hpp>
#include <sprout/weed/expr/eval.hpp>
#include <sprout/weed/attr_cnv/result_of/modulus.hpp>
#include <sprout/weed/attr_cnv/modulus.hpp>
#include <sprout/weed/traits/expr/tag_of.hpp>
#include <sprout/weed/traits/parser/attribute_of.hpp>
@ -37,7 +38,10 @@ namespace sprout {
typedef typename sprout::weed::traits::limit_of<expr1_type, Iterator, context_type>::type limit;
typedef typename sprout::weed::traits::attribute_of<expr1_type, Iterator, context_type>::type attr_type;
public:
typedef typename sprout::weed::traits::attribute_of<Expr, Iterator, context_type>::type attribute_type;
typedef typename sprout::weed::attr_cnv::result_of::modulus<
limit::value,
typename sprout::weed::traits::attribute_of<expr1_type, Iterator, context_type>::type
>::type attribute_type;
typedef sprout::weed::eval_result<context_type, Iterator, attribute_type> result_type;
private:
template<typename Result, typename... Attrs>

View file

@ -7,6 +7,7 @@
#include <sprout/weed/eval_result.hpp>
#include <sprout/weed/expr/tag.hpp>
#include <sprout/weed/expr/eval.hpp>
#include <sprout/weed/attr_cnv/result_of/negate.hpp>
#include <sprout/weed/attr_cnv/negate.hpp>
#include <sprout/weed/traits/expr/tag_of.hpp>
#include <sprout/weed/traits/parser/attribute_of.hpp>
@ -30,8 +31,11 @@ namespace sprout {
> {
private:
typedef sprout::weed::parse_context<Iterator> context_type;
typedef typename sprout::tuples::tuple_element<0, typename Expr::args_type>::type expr_type;
public:
typedef typename sprout::weed::traits::attribute_of<Expr, Iterator, context_type>::type attribute_type;
typedef typename sprout::weed::attr_cnv::result_of::negate<
typename sprout::weed::traits::attribute_of<expr_type, Iterator, context_type>::type
>::type attribute_type;
typedef sprout::weed::eval_result<context_type, Iterator, attribute_type> result_type;
private:
template<typename Result>

View file

@ -7,6 +7,7 @@
#include <sprout/weed/eval_result.hpp>
#include <sprout/weed/expr/tag.hpp>
#include <sprout/weed/expr/eval.hpp>
#include <sprout/weed/attr_cnv/result_of/shift_left.hpp>
#include <sprout/weed/attr_cnv/shift_left.hpp>
#include <sprout/weed/traits/expr/tag_of.hpp>
#include <sprout/weed/traits/parser/attribute_of.hpp>
@ -30,8 +31,13 @@ namespace sprout {
> {
private:
typedef sprout::weed::parse_context<Iterator> context_type;
typedef typename sprout::tuples::tuple_element<0, typename Expr::args_type>::type expr1_type;
typedef typename sprout::tuples::tuple_element<1, typename Expr::args_type>::type expr2_type;
public:
typedef typename sprout::weed::traits::attribute_of<Expr, Iterator, context_type>::type attribute_type;
typedef typename sprout::weed::attr_cnv::result_of::shift_left<
typename sprout::weed::traits::attribute_of<expr1_type, Iterator, context_type>::type,
typename sprout::weed::traits::attribute_of<expr2_type, Iterator, context_type>::type
>::type attribute_type;
typedef sprout::weed::eval_result<context_type, Iterator, attribute_type> result_type;
private:
template<typename Attr1, typename Result2>

View file

@ -8,6 +8,7 @@
#include <sprout/weed/limited.hpp>
#include <sprout/weed/expr/tag.hpp>
#include <sprout/weed/expr/eval.hpp>
#include <sprout/weed/attr_cnv/result_of/times.hpp>
#include <sprout/weed/attr_cnv/times.hpp>
#include <sprout/weed/traits/expr/tag_of.hpp>
#include <sprout/weed/traits/parser/attribute_of.hpp>
@ -36,7 +37,10 @@ namespace sprout {
typedef typename sprout::weed::traits::limit_of<expr_type, Iterator, context_type>::type limit;
typedef typename sprout::weed::traits::attribute_of<expr_type, Iterator, context_type>::type attr_type;
public:
typedef typename sprout::weed::traits::attribute_of<Expr, Iterator, context_type>::type attribute_type;
typedef typename sprout::weed::attr_cnv::result_of::times<
limit::value,
typename sprout::weed::traits::attribute_of<expr_type, Iterator, context_type>::type
>::type attribute_type;
typedef sprout::weed::eval_result<context_type, Iterator, attribute_type> result_type;
private:
template<typename Result, typename Head, typename... Attrs>

View file

@ -35,7 +35,7 @@ namespace sprout {
private:
typedef sprout::weed::parse_context<Iterator> context_type;
public:
typedef typename sprout::weed::traits::attribute_of<Expr, Iterator, context_type>::type attribute_type;
typedef sprout::weed::unused attribute_type;
typedef sprout::weed::eval_result<context_type, Iterator, attribute_type> result_type;
public:
SPROUT_CONSTEXPR result_type operator()(

View file

@ -38,7 +38,11 @@ namespace sprout {
typedef sprout::weed::parse_context<Iterator> context_type;
typedef typename sprout::tuples::tuple_element<0, typename Expr::args_type>::type parser_type;
public:
typedef typename sprout::weed::traits::attribute_of<Expr, Iterator, context_type>::type attribute_type;
typedef typename sprout::weed::traits::attribute_of<
parser_type,
Iterator,
context_type
>::type attribute_type;
typedef sprout::weed::eval_result<context_type, Iterator, attribute_type> result_type;
private:
template<typename Result>

View file

@ -39,7 +39,7 @@ namespace sprout {
private:
typedef sprout::weed::parse_context<Iterator> context_type;
public:
typedef typename sprout::weed::traits::attribute_of<Expr, Iterator, context_type>::type attribute_type;
typedef sprout::weed::unused attribute_type;
typedef sprout::weed::eval_result<context_type, Iterator, attribute_type> result_type;
private:
template<typename Arg>