Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r68916 - in sandbox/local/libs/local/params_name/aux_/preprocessor/sign: params parse parse/params_ parsed_ parsed_/params
From: lorcaminiti_at_[hidden]
Date: 2011-02-15 12:09:59


Author: lcaminiti
Date: 2011-02-15 12:09:54 EST (Tue, 15 Feb 2011)
New Revision: 68916
URL: http://svn.boost.org/trac/boost/changeset/68916

Log:
Params macro parsers.
Added:
   sandbox/local/libs/local/params_name/aux_/preprocessor/sign/params/
   sandbox/local/libs/local/params_name/aux_/preprocessor/sign/params/bind.hpp (contents, props changed)
   sandbox/local/libs/local/params_name/aux_/preprocessor/sign/params/const_bind.hpp (contents, props changed)
   sandbox/local/libs/local/params_name/aux_/preprocessor/sign/params/error.hpp (contents, props changed)
   sandbox/local/libs/local/params_name/aux_/preprocessor/sign/params/unbind.hpp (contents, props changed)
   sandbox/local/libs/local/params_name/aux_/preprocessor/sign/parse/
   sandbox/local/libs/local/params_name/aux_/preprocessor/sign/parse/params.cpp (contents, props changed)
   sandbox/local/libs/local/params_name/aux_/preprocessor/sign/parse/params_/
   sandbox/local/libs/local/params_name/aux_/preprocessor/sign/parse/params_/is_void.hpp (contents, props changed)
   sandbox/local/libs/local/params_name/aux_/preprocessor/sign/parse/params_/seq.hpp (contents, props changed)
   sandbox/local/libs/local/params_name/aux_/preprocessor/sign/parse/params_/seq_valid.hpp (contents, props changed)
   sandbox/local/libs/local/params_name/aux_/preprocessor/sign/parse/params_/seq_validate_defaults.hpp (contents, props changed)
   sandbox/local/libs/local/params_name/aux_/preprocessor/sign/parsed_/
   sandbox/local/libs/local/params_name/aux_/preprocessor/sign/parsed_/params/
   sandbox/local/libs/local/params_name/aux_/preprocessor/sign/parsed_/params/append_bind.hpp (contents, props changed)
   sandbox/local/libs/local/params_name/aux_/preprocessor/sign/parsed_/params/append_const_bind.hpp (contents, props changed)
   sandbox/local/libs/local/params_name/aux_/preprocessor/sign/parsed_/params/append_unbind.hpp (contents, props changed)
   sandbox/local/libs/local/params_name/aux_/preprocessor/sign/parsed_/params/inc_bind_this_count.hpp (contents, props changed)
   sandbox/local/libs/local/params_name/aux_/preprocessor/sign/parsed_/params/inc_const_bind_this_count.hpp (contents, props changed)
   sandbox/local/libs/local/params_name/aux_/preprocessor/sign/parsed_/params/index.hpp (contents, props changed)
   sandbox/local/libs/local/params_name/aux_/preprocessor/sign/parsed_/params/nil.hpp (contents, props changed)
   sandbox/local/libs/local/params_name/aux_/preprocessor/sign/parsed_/params/set_error.cpp (contents, props changed)
   sandbox/local/libs/local/params_name/aux_/preprocessor/sign/parsed_/params/validate.hpp (contents, props changed)

Added: sandbox/local/libs/local/params_name/aux_/preprocessor/sign/params/bind.hpp
==============================================================================
--- (empty file)
+++ sandbox/local/libs/local/params_name/aux_/preprocessor/sign/params/bind.hpp 2011-02-15 12:09:54 EST (Tue, 15 Feb 2011)
@@ -0,0 +1,19 @@
+
+#ifndef BOOST_LOCAL_AUX_PP_SIGN_PARAMS_BIND_HPP_
+#define BOOST_LOCAL_AUX_PP_SIGN_PARAMS_BIND_HPP_
+
+#include "../parsed_/params/index.hpp"
+#include <boost/preprocessor/tuple/elem.hpp>
+
+#define BOOST_LOCAL_AUX_PP_SIGN_PARAMS_BIND(params) \
+ BOOST_PP_TUPLE_ELEM(BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_INDEX_MAX, \
+ BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_INDEX_BIND, \
+ params)
+
+#define BOOST_LOCAL_AUX_PP_SIGN_PARAMS_BIND_THIS_COUNT(params) \
+ BOOST_PP_TUPLE_ELEM(BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_INDEX_MAX, \
+ BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_INDEX_BIND_THIS_COUNT, \
+ params)
+
+#endif // #include guard
+

Added: sandbox/local/libs/local/params_name/aux_/preprocessor/sign/params/const_bind.hpp
==============================================================================
--- (empty file)
+++ sandbox/local/libs/local/params_name/aux_/preprocessor/sign/params/const_bind.hpp 2011-02-15 12:09:54 EST (Tue, 15 Feb 2011)
@@ -0,0 +1,19 @@
+
+#ifndef BOOST_LOCAL_AUX_PP_SIGN_PARAMS_CONST_BIND_HPP_
+#define BOOST_LOCAL_AUX_PP_SIGN_PARAMS_CONST_BIND_HPP_
+
+#include "../parsed_/params/index.hpp"
+#include <boost/preprocessor/tuple/elem.hpp>
+
+#define BOOST_LOCAL_AUX_PP_SIGN_PARAMS_CONST_BIND(params) \
+ BOOST_PP_TUPLE_ELEM(BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_INDEX_MAX, \
+ BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_INDEX_CONST_BIND, \
+ params)
+
+#define BOOST_LOCAL_AUX_PP_SIGN_PARAMS_CONST_BIND_THIS_COUNT(params) \
+ BOOST_PP_TUPLE_ELEM(BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_INDEX_MAX, \
+ BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_INDEX_CONST_BIND_THIS_COUNT, \
+ params)
+
+#endif // #include guard
+

Added: sandbox/local/libs/local/params_name/aux_/preprocessor/sign/params/error.hpp
==============================================================================
--- (empty file)
+++ sandbox/local/libs/local/params_name/aux_/preprocessor/sign/params/error.hpp 2011-02-15 12:09:54 EST (Tue, 15 Feb 2011)
@@ -0,0 +1,15 @@
+
+#ifndef BOOST_LOCAL_AUX_PP_SIGN_PARAMS_ERROR_HPP_
+#define BOOST_LOCAL_AUX_PP_SIGN_PARAMS_ERROR_HPP_
+
+#include "../parsed_/params/index.hpp"
+#include <boost/preprocessor/tuple/elem.hpp>
+
+// Expand to `EMPTY` if no error, to `ERROR_message_text EMPTY` otherwise.
+#define BOOST_LOCAL_AUX_PP_SIGN_PARAMS_ERROR(params) \
+ BOOST_PP_TUPLE_ELEM(BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_INDEX_MAX, \
+ BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_INDEX_ERROR, \
+ params)
+
+#endif // #include guard
+

Added: sandbox/local/libs/local/params_name/aux_/preprocessor/sign/params/unbind.hpp
==============================================================================
--- (empty file)
+++ sandbox/local/libs/local/params_name/aux_/preprocessor/sign/params/unbind.hpp 2011-02-15 12:09:54 EST (Tue, 15 Feb 2011)
@@ -0,0 +1,38 @@
+
+#ifndef BOOST_LOCAL_AUX_PP_SIGN_PARAMS_UNBIND_HPP_
+#define BOOST_LOCAL_AUX_PP_SIGN_PARAMS_UNBIND_HPP_
+
+#include "../parsed_/params/index.hpp"
+#include <boost/preprocessor/tuple/elem.hpp>
+
+// Private API.
+
+// Param 2-tuple `([auto | register] type name, default_value)`.
+#define BOOST_LOCAL_AUX_PP_SIGN_PARAMS_UNBIND_PARAM_INDEX_DECL_ 0
+#define BOOST_LOCAL_AUX_PP_SIGN_PARAMS_UNBIND_PARAM_INDEX_DEFAULT_ 1
+#define BOOST_LOCAL_AUX_PP_SIGN_PARAMS_UNBIND_PARAM_INDEX_MAX_ 2
+
+// Public API.
+
+// Expand to param declaration: [auto | register] type name.
+#define BOOST_LOCAL_AUX_PP_SIGN_PARAMS_UNBIND_PARAM_DECL(param) \
+ BOOST_PP_TUPLE_ELEM(BOOST_LOCAL_AUX_SIGN_PARAMS_UNBIND_PARAM_INDEX_MAX_, \
+ BOOST_LOCAL_AUX_SIGN_PARAMS_UNBIND_PARAM_INDEX_DECL_, param)
+
+// Expand to param default value (empty if none).
+#define BOOST_LOCAL_AUX_PP_SIGN_PARAMS_UNBIND_PARAM_DEFAULT(param) \
+ BOOST_PP_TUPLE_ELEM(BOOST_LOCAL_AUX_SIGN_PARAMS_UNBIND_PARAM_INDEX_MAX_, \
+ BOOST_LOCAL_AUX_SIGN_PARAMS_UNBIND_PARAM_INDEX_DEFAULT_, param)
+
+// Expand to 1 if param has default value, 0 otherwise.
+#define BOOST_LOCAL_AUX_PP_SIGN_PARAMS_UNBIND_PARAM_HAS_DEFAULT(param) \
+ BOOST_PP_IF_EMPTY(BOOST_LOCAL_AUX_PP_SIGN_PARAMS_UNBIND_PARAM_DEFAULT( \
+ param) (/* expand empty */) )
+
+// Expand to nil-seq of ALL unbind params.
+#define BOOST_LOCAL_AUX_PP_SIGN_PARAMS_UNBIND(params) \
+ BOOST_PP_TUPLE_ELEM(BOOST_LOCAL_AUX_PP_SIGN_PARAMS_INDEX_MAX_, \
+ BOOST_LOCAL_AUX_PP_SIGN_PARAMS_INDEX_UNBIND_, params)
+
+#endif // #include guard
+

Added: sandbox/local/libs/local/params_name/aux_/preprocessor/sign/parse/params.cpp
==============================================================================
--- (empty file)
+++ sandbox/local/libs/local/params_name/aux_/preprocessor/sign/parse/params.cpp 2011-02-15 12:09:54 EST (Tue, 15 Feb 2011)
@@ -0,0 +1,29 @@
+
+#ifndef BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_HPP_
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_HPP_
+
+#include "params_/is_void.hpp"
+#include "params_/seq.hpp"
+#include <boost/preprocessor/control/iif.hpp>
+
+// Private API.
+
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSSE_PARAMS_NONE_(unused) \
+ BOOST_LOCAL_AUX_PP_SIGN_PARAMS_NIL
+
+// Public API.
+
+// parenthesized_params: Empty ``, or `void`, or `(void)` for no params
+// Or, `{([auto | register] param_type param_name)[(default default_value)]
+// | ([const] bind [&] bind_name}+` where `bind_name` can be `this` (but not
+// `&this` as usual in C++).
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS(parenthesized_params) \
+ BOOST_PP_IIF(BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_IS_VOID( \
+ parenthesized_params), \
+ BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_NONE_ \
+ , \
+ BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_SEQ \
+ )(parenthesized_params)
+
+#endif // #include guard
+

Added: sandbox/local/libs/local/params_name/aux_/preprocessor/sign/parse/params_/is_void.hpp
==============================================================================
--- (empty file)
+++ sandbox/local/libs/local/params_name/aux_/preprocessor/sign/parse/params_/is_void.hpp 2011-02-15 12:09:54 EST (Tue, 15 Feb 2011)
@@ -0,0 +1,40 @@
+
+#ifndef BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_IS_VOID_HPP_
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_IS_VOID_HPP_
+
+#include <boost/detail/preprocessor/keyword/void.hpp>
+#include <boost/preprocessor/detail/is_unary.hpp>
+#include <boost/preprocessor/control/iif.hpp>
+#include <boost/preprocessor/facilities/is_empty.hpp>
+#include <boost/preprocessor/facilities/empty.hpp>
+#include <boost/preprocessor/seq.hpp> // For `SEQ_HEAD`.
+
+// Private API.
+
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_IS_VOID_TOKEN_(token) \
+ BOOST_PP_IIF(BOOST_PP_IS_EMPTY(token), \
+ 1 /* handles empty params `()` as no params (C99 only) */ \
+ BOOST_PP_EMPTY \
+ , \
+ BOOST_DETAIL_PP_KEYWORD_IS_VOID_FRONT \
+ )(token)
+
+#define BOOST_LOCLAL_AUX_PP_SIGN_PARSE_PARAMS_IS_VOID_SEQ_(params_seq) \
+ BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_IS_VOID_TOKEN_( \
+ BOOST_PP_SEQ_HEAD(params_seq))
+
+// Public API.
+
+// Check is specified parenthesized params are empty (or void) list.
+// Expand to 1 iff params_seq is empty (C99 only), or `void` (supported also
+// for C++ but similar to unparenthesized paramter syntax for C99), or `(void)`
+// (parenthesized parameter syntax for C++).
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_IS_VOID(parenthesized_params) \
+ BOOST_PP_IIF(BOOST_PP_IS_UNARY(parenthesized_params), \
+ BOOST_LOCLAL_AUX_PP_SIGN_PARSE_PARAMS_IS_VOID_SEQ_ \
+ , /* else, it's a sequence */ \
+ BOOST_LOCAL_AUX_PP_SIGN_PRASE_PARAMS_IS_VOID_TOKEN_ \
+ )(parenthesized_params)
+
+#endif // #include guard
+

Added: sandbox/local/libs/local/params_name/aux_/preprocessor/sign/parse/params_/seq.hpp
==============================================================================
--- (empty file)
+++ sandbox/local/libs/local/params_name/aux_/preprocessor/sign/parse/params_/seq.hpp 2011-02-15 12:09:54 EST (Tue, 15 Feb 2011)
@@ -0,0 +1,37 @@
+
+#ifndef BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_SEQ_HPP_
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_SEQ_HPP_
+
+#include "seq_validate_defaults.hpp"
+#include "validate_this_count.hpp"
+#include "../parsed_/params/set_error.hpp"
+#include <boost/preprocessor/control.iif>
+#include <boost/preprocessor/facilities/is_empty.iif>
+
+// Private API.
+
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_SEQ_YES_(params_seq, unused) \
+ BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_VALIDATE_THIS_COUNT( \
+ BOOST_LOCAL_AUX_PP_SIGN_PARAMS_SEQ_VALID_(params_seq))
+
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_SEQ_NO_(unused, error) \
+ BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_SET_ERROR( \
+ BOOST_LOCAL_AUX_PP_SIGN_PARAMS_NIL, error)
+
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_SEQ_( \
+ params_seq, defaults_error) \
+ BOOST_PP_IIF(BOOST_PP_IS_EMPTY(defaults_error (/* expand empty */)), \
+ BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_SEQ_YES_ \
+ , \
+ BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_SEQ_NO_ \
+ )(params_seq, defaults_error)
+
+// Public API.
+
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_SEQ(params_seq) \
+ BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_SEQ_(params_seq, \
+ BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_SEQ_VALIDATE_DEFAULTS( \
+ params_seq))
+
+#endif // #include guard
+

Added: sandbox/local/libs/local/params_name/aux_/preprocessor/sign/parse/params_/seq_valid.hpp
==============================================================================
--- (empty file)
+++ sandbox/local/libs/local/params_name/aux_/preprocessor/sign/parse/params_/seq_valid.hpp 2011-02-15 12:09:54 EST (Tue, 15 Feb 2011)
@@ -0,0 +1,88 @@
+
+#ifndef BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_SEQ_VALID_HPP_
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_SEQ_VALID_HPP_
+
+#include "../../../parsed_/params/unbind.hpp"
+#include "../../../parsed_/params/bind.hpp"
+#include "../../../parsed_/params/const_bind.hpp"
+#include "../../../../keyword/const_bind.hpp"
+#include "../../../../keyword/bind.hpp"
+#include <boost/detail/preprocessor/keyword/default.hpp>
+#include <boost/detail/preprocessor/keyword/this.hpp>
+#include <boost/preprocessor/control/iif.hpp>
+
+// Private: Unbound.
+
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_SEQ_VALID_UNBIND_DEFAULT_( \
+ params, elem) \
+ BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_APPEND_UNBIND_DEFAULT(params, \
+ BOOST_DETAIL_PP_KEYWORD_DEFAULT_REMOVE_FRONT(elem))
+
+#define BOOST_LOCAL_AUX_PP_PARSE_SIGN_PARAMS_SEQ_VALID_UNBIND_(params, elem) \
+ BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_APPEND_UNBIND(params, elem)
+
+// Private: Parse const binds.
+
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_SEQ_VALID_CONST_BIND_THIS_( \
+ params, elem) \
+ BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_INC_CONST_BIND_THIS_COUNT(params)
+
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_SEQ_VALID_CONST_BIND_VAR_( \
+ params, elem) \
+ BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_APPEND_CONST_BIND(params, \
+ BOOST_LOCAL_AUX_PP_KEYWORD_CONST_BIND_REMOVE_FRONT(elem))
+
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_SEQ_VALID_CONST_BIND_( \
+ params, elem) \
+ /* check from back because non `this` bounds might have `&` in front */ \
+ BOOST_PP_IIF(BOOST_DETAIL_PP_KEYWORD_IS_THIS_BACK( \
+ BOOST_LOCAL_AUX_PP_KEYWORD_CONST_BIND_REMOVE_FRONT(elem)), \
+ BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_SEQ_VALID_CONST_BIND_THIS_ \
+ , \
+ BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_SEQ_VALID_CONST_BIND_VAR_ \
+ )(params, elem)
+
+// Private: Parse binds.
+
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_SEQ_VALID_BIND_VAR_(params, elem) \
+ BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_APPEND_BIND(params, \
+ BOOST_LOCAL_AUX_PP_KEYWORD_BIND_REMOVE_FRONT(elem))
+
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_SEQ_VALID_BIND_THIS_( \
+ params, elem) \
+ BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_INC_BIND_THIS_COUNT(params)
+
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_SEQ_VALID_BIND_(params, elem) \
+ /* check from back because non `this` bounds might have `&` in front */ \
+ BOOST_PP_IIF(BOOST_DETAIL_PP_KEYWORD_IS_THIS_BACK( \
+ BOOST_LOCAL_AUX_PP_KEYWORD_BIND_REMOVE_FRONT(elem)), \
+ BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_SEQ_VALID_BIND_THIS_ \
+ , \
+ BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_SEQ_VALID_BIND_VAR_ \
+ )(params, elem)
+
+// Private: Parse all elements.
+
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_SEQ_VALID_(s, params, elem) \
+ BOOST_PP_IIF(BOOST_LOCAL_AUX_PP_KEYWORD_IS_BIND_FRONT(elem), \
+ BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_SEQ_VALID_BIND_ \
+ , BOOST_PP_IIF(BOOST_LOCAL_AUX_PP_KEYWORD_IS_CONST_BIND_FRONT(elem), \
+ BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_SEQ_VALID_CONST_BIND_ \
+ , BOOST_PP_IIF(BOOST_DETAIL_PP_KEYWORD_IS_DEFAULT_FRONT(elem), \
+ BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_SEQ_VALID_UNBIND_DEFAULT_ \
+ , \
+ BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_SEQ_VALID_UNBIND_ \
+ )))(params, elem)
+
+// Public API.
+
+// Parse param seq after following precondition has been validated by caller.
+// Precondition: If seq contains a default param value `... (default ...) ...`,
+// the default value element is never 1st (it always has a previous elem) and
+// its previous element is a unbind param (no const-bind and no bind).
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_SEQ_VALID(params_seq) \
+ BOOST_PP_SEQ_FOLD_LEFT(BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_SEQ_VALID_, \
+ BOOST_LOCAL_AUX_PP_SIGN_PARAMS_NIL, params_seq)
+
+#endif // #include guard
+

Added: sandbox/local/libs/local/params_name/aux_/preprocessor/sign/parse/params_/seq_validate_defaults.hpp
==============================================================================
--- (empty file)
+++ sandbox/local/libs/local/params_name/aux_/preprocessor/sign/parse/params_/seq_validate_defaults.hpp 2011-02-15 12:09:54 EST (Tue, 15 Feb 2011)
@@ -0,0 +1,111 @@
+
+#ifndef BOOST_LOCAL_AUX_PP_PARSE_PARAMS_SEQ_VALIDATE_DEFAULTS_HPP_
+#define BOOST_LOCAL_AUX_PP_PARSE_PARAMS_SEQ_VALIDATE_DEFAULTS_HPP_
+
+#include "../../../keyword/const_bind.hpp"
+#include "../../../keyword/bind.hpp"
+#include <boost/detail/preprocessor/keyword/default.hpp>
+#include <boost/preprocessor/tuple/elem.hpp>
+#include <boost/preprocessor/control/while.hpp>
+#include <boost/preprocessor/control/iif.hpp>
+#include <boost/preprocessor/control/if.hpp>
+#include <boost/preprocessor/facilities/empty.hpp>
+#include <boost/preprocessor/facilities/is_empty.hpp>
+#include <boost/preprocessor/logical/bitand.hpp>
+#include <boost/preprocessor/logical/bitor.hpp>
+#include <boost/preprocessor/logical/not.hpp>
+#include <boost/preprocessor/arithmetic/less.hpp>
+#include <boost/preprocessor/arithmetic/inc.hpp>
+#include <boost/preprocessor/arithmetic/dec.hpp>
+#include <boost/preprocessor/seq/size.hpp>
+#include <boost/preprocessor/seq/elem.hpp>
+#include <boost/preprocessor/tuple/eat.hpp>
+#include <boost/preprocessor/cat.hpp>
+
+// Private API.
+
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_SEQ_VALIDATE_DEFAULTS_UNBIND_( \
+ elem) \
+ BOOST_PP_NOT(BOOST_PP_BITOR( \
+ BOOST_DETAIL_PP_KEYWORD_IS_DEFAULT_FRONT(elem) \
+ , BOOST_PP_BITOR( \
+ BOOST_LOCAL_AUX_PP_KEYWORD_IS_CONST_BIND_FRONT(elem) \
+ , BOOST_LOCAL_AUX_PP_KEYWORD_IS_BIND_FRONT(elem) \
+ ) \
+ ))
+
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_SEQ_VALIDATE_DEFAULTS_PREV_( \
+ params_seq, index, error) \
+ BOOST_PP_IIF( \
+ BOOST_LOCAL_AUX_PP_SIGN_PARAMS_SEQ_VALIDATE_DEFAULTS_UNBIND_(\
+ BOOST_PP_SEQ_ELEM(BOOST_PP_DEC(index), params_seq)), \
+ error /* no err, fwd existing one if any */ \
+ , \
+ BOOST_PP_CAT( \
+ ERROR_default_must_follow_an_unbound_parameter_at_element_number_, \
+ BOOST_PP_INC(index)) \
+ )
+
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_SEQ_VALIDATE_DEFAULTS_INDEX_( \
+ params_seq, index, error) \
+ BOOST_PP_IF(index, /* can't use IIF because index can be any number */ \
+ BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_SEQ_VALIDATE_DEFAULTS_PREV_ \
+ , \
+ ERROR_default_value_cannot_be_specified_as_the_first_element \
+ BOOST_PP_TUPLE_EAT(3) \
+ )(params_seq, index, error)
+
+// Private: While's operation.
+
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_SEQ_VALIDATE_DEFAULTS_OP_DATA_( \
+ params_seq, index, error) \
+ ( \
+ params_seq \
+ , \
+ BOOST_PP_INC(index) \
+ , \
+ BOOST_PP_IIF(BOOST_DETAIL_PP_KEYWORD_IS_DEFAULT_FRONT( \
+ BOOST_PP_SEQ_ELEM(index, params_seq)), \
+ BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_SEQ_VALIDATE_DEFAULTS_INDEX_ \
+ , \
+ error BOOST_PP_TUPLE_EAT(3) /* no err, fwd existing one if any */\
+ )(params_seq, index, error) \
+ )
+
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_SEQ_VALIDATE_DEFAULTS_OP_(d, \
+ params_index_error) \
+ BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_SEQ_VALIDATE_DEFAULTS_OP_DATA_( \
+ BOOST_PP_TUPLE_ELEM(3, 0, params_index_error), \
+ BOOST_PP_TUPLE_ELEM(3, 1, params_index_error), \
+ BOOST_PP_TUPLE_ELEM(3, 2, params_index_error))
+
+// Private: While's predicate.
+
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_SEQ_VALIDATE_DEFAULTS_PRED_DATA_( \
+ params_seq, index, error) \
+ BOOST_PP_BITAND( \
+ BOOST_PP_IS_EMPTY(error (/* expand empty */) ) \
+ , BOOST_PP_LESS(index, BOOST_PP_SEQ_SIZE(params_seq)) \
+ )
+
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_SEQ_VALIDATE_DEFAULTS_PRED_(d, \
+ params_index_error) \
+ BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_SEQ_VALIDATE_DEFAULTS_PRED_DATA_( \
+ BOOST_PP_TUPLE_ELEM(3, 0, params_index_error), \
+ BOOST_PP_TUPLE_ELEM(3, 1, params_index_error), \
+ BOOST_PP_TUPLE_ELEM(3, 2, params_index_error))
+
+// Public API.
+
+// Validate parameter sequence's default values: `default ...` cannot be 1st
+// element and it must follow an unbind param.
+// Expand to `EMPTY` if no error, or `ERROR_message EMPTY` if error.
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_SEQ_VALIDATE_DEFAULTS( \
+ params_seq) \
+ BOOST_PP_TUPLE_ELEM(3, 2, BOOST_PP_WHILE( \
+ BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_SEQ_VALIDATE_DEFAULTS_PRED_, \
+ BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_SEQ_VALIDATE_DEFAULTS_OP_, \
+ (params_seq, 0, BOOST_PP_EMPTY)))
+
+#endif // #include guard
+

Added: sandbox/local/libs/local/params_name/aux_/preprocessor/sign/parsed_/params/append_bind.hpp
==============================================================================
--- (empty file)
+++ sandbox/local/libs/local/params_name/aux_/preprocessor/sign/parsed_/params/append_bind.hpp 2011-02-15 12:09:54 EST (Tue, 15 Feb 2011)
@@ -0,0 +1,28 @@
+
+#ifndef BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_APPEND_BIND_HPP_
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_APPEND_BIND_HPP_
+
+#include "../../params/unbind.hpp"
+#include "../../params/bind.hpp"
+#include "../../params/const_bind.hpp"
+
+// bind_qualified_name: [&] name
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_APPEND_BIND( \
+ params, bind_qualified_name) \
+ ( /* unbind params and defaults */ \
+ BOOST_LOCAL_AUX_PP_SIGN_PARAMS_UNBIND(params) \
+ , /* const-bind names */ \
+ BOOST_LOCAL_AUX_PP_SIGN_PARAMS_CONST_BIND(params) \
+ , /* const-bind `this` count */ \
+ BOOST_LOCAL_AUX_PP_SIGN_PARAMS_CONST_BIND_THIS_COUNT(params) \
+ , /* bind names */ \
+ BOOST_LOCAL_AUX_PP_SIGN_PARAMS_BIND(params) \
+ (bind_qualified_name) /* append */ \
+ , /* bind `this` count */ \
+ BOOST_LOCAL_AUX_PP_SIGN_PARAMS_BIND_THIS_COUNT(params) \
+ , /* error message (if any) */ \
+ BOOST_LOCAL_AUX_PP_SIGN_PARAMS_ERROR(params) \
+ )
+
+#endif // #include guard
+

Added: sandbox/local/libs/local/params_name/aux_/preprocessor/sign/parsed_/params/append_const_bind.hpp
==============================================================================
--- (empty file)
+++ sandbox/local/libs/local/params_name/aux_/preprocessor/sign/parsed_/params/append_const_bind.hpp 2011-02-15 12:09:54 EST (Tue, 15 Feb 2011)
@@ -0,0 +1,28 @@
+
+#ifndef BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_APPEND_CONST_BIND_HPP_
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_APPEND_CONST_BIND_HPP_
+
+#include "../../params/unbind.hpp"
+#include "../../params/bind.hpp"
+#include "../../params/const_bind.hpp"
+
+// const_bind_qualified_name: [&] name (with name != `this`)
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_APPEND_CONST_BIND( \
+ params, const_bind_qualified_name) \
+ ( /* unbind params and defaults */ \
+ BOOST_LOCAL_AUX_PP_SIGN_PARAMS_UNBIND(params) \
+ , /* const-bind names */ \
+ BOOST_LOCAL_AUX_PP_SIGN_PARAMS_CONST_BIND(params) \
+ (const_bind_qualified_name) /* append */ \
+ , /* const-bind `this` count */ \
+ BOOST_LOCAL_AUX_PP_SIGN_PARAMS_CONST_BIND_THIS_COUNT(params) \
+ , /* bind names */ \
+ BOOST_LOCAL_AUX_PP_SIGN_PARAMS_BIND(params) \
+ , /* bind `this` count */ \
+ BOOST_LOCAL_AUX_PP_SIGN_PARAMS_BIND_THIS_COUNT(params) \
+ , /* error message (if any) */ \
+ BOOST_LOCAL_AUX_PP_SIGN_PARAMS_ERROR(params) \
+ )
+
+#endif // #include guard
+

Added: sandbox/local/libs/local/params_name/aux_/preprocessor/sign/parsed_/params/append_unbind.hpp
==============================================================================
--- (empty file)
+++ sandbox/local/libs/local/params_name/aux_/preprocessor/sign/parsed_/params/append_unbind.hpp 2011-02-15 12:09:54 EST (Tue, 15 Feb 2011)
@@ -0,0 +1,71 @@
+
+#ifndef BOOST_LOCAL_AUX_PP_SIGN_PARSED_APPEND_UNBIND_HPP_
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSED_APPEND_UNBIND_HPP_
+
+#include "../../params/unbind.hpp"
+#include "../../params/bind.hpp"
+#include "../../params/const_bind.hpp"
+#include <boost/preprocessor/facilities/empty.hpp>
+#include <boost/preprocessor/tuple/elem.hpp>
+#include <boost/preprocessor/seq/pop_back.hpp>
+#include <boost/preprocessor/seq/elem.hpp>
+#include <boost/preprocessor/seq/size.hpp>
+
+// Private API.
+
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_APPEND_UNBIND_DEFAULT_( \
+ unbind_nilseq, default_value) \
+ BOOST_PP_SEQ_POP_BACK(unbind_nilseq) \
+ (( /* seq of 2-tuple params */ \
+ /* last appended classifier type and name */ \
+ BOOST_LOCAL_AUX_PP_SIGN_PARAMS_UNBIND_PARAM(BOOST_PP_SEQ_ELEM( \
+ /* nil-seq so can always safely decrement size */ \
+ BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(unbind_nilseq)), \
+ unbind_nilseq)) \
+ , \
+ /* trailing EMPTY because defaults are optional */ \
+ default_value BOOST_PP_EMPTY \
+ ))
+
+// Public API.
+
+// default_value: a valid parameter default value (`-1`, etc)
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_APPEND_UNBIND_DEFAULT( \
+ params, default_value) \
+ ( /* unbind params and defaults */ \
+ BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_APPEND_UNBIND_DEFAULT_( \
+ BOOST_LOCAL_AUX_PP_SIGN_PARAMS_UNBIND(params), \
+ default_value) /* append default to last added param */ \
+ , /* const-bind names */ \
+ BOOST_LOCAL_AUX_PP_PARAMS_CONST_BIND(params) \
+ , /* const-bind `this` count */ \
+ BOOST_LOCAL_AUX_PP_PARAMS_CONST_BIND_THIS_COUNT(params) \
+ , /* bind names */ \
+ BOOST_LOCAL_AUX_PP_PARAMS_BIND(params) \
+ , /* bind `this` count */ \
+ BOOST_LOCAL_AUX_PP_PARAMS_BIND_THIS_COUNT(params) \
+ , /* error message (if any) */ \
+ BOOST_LOCAL_AUX_PP_PARAMS_ERROR(params) \
+ )
+
+// unbind_classified_type_and_name: [auto | register] type name
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_APPEND_UNBIND( \
+ params, unbind_classified_type_and_name) \
+ ( /* unbind params and defaults */ \
+ BOOST_LOCAL_AUX_PP_PARAMS_UNBIND(params) \
+ /* append param (with no default -- EMPTY) */ \
+ ((unbind_classified_type_and_name, BOOST_PP_EMPTY)) \
+ , /* const-bind names */ \
+ BOOST_LOCAL_AUX_PP_PARAMS_CONST_BIND(params) \
+ , /* const-bind `this` count */ \
+ BOOST_LOCAL_AUX_PP_PARAMS_CONST_BIND_THIS_COUNT(params) \
+ , /* bind names */ \
+ BOOST_LOCAL_AUX_PP_PARAMS_BIND(params) \
+ , /* bind `this` count */ \
+ BOOST_LOCAL_AUX_PP_PARAMS_BIND_THIS_COUNT(params) \
+ , /* error message (if any) */ \
+ BOOST_LOCAL_AUX_PP_PARAMS_ERROR(params) \
+ )
+
+#endif // #include guard
+

Added: sandbox/local/libs/local/params_name/aux_/preprocessor/sign/parsed_/params/inc_bind_this_count.hpp
==============================================================================
--- (empty file)
+++ sandbox/local/libs/local/params_name/aux_/preprocessor/sign/parsed_/params/inc_bind_this_count.hpp 2011-02-15 12:09:54 EST (Tue, 15 Feb 2011)
@@ -0,0 +1,27 @@
+
+#ifndef BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_INC_BIND_THIS_COUNT_HPP_
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_INC_BIND_THIS_COUNT_HPP_
+
+#include "../../params/unbind.hpp"
+#include "../../params/bind.hpp"
+#include "../../params/const_bind.hpp"
+#include <boost/preprocessor/arithmentic/inc.hpp>
+
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_INC_BIND_THIS_COUNT(params) \
+ ( /* unbind params and defaults */ \
+ BOOST_LOCAL_AUX_PP_SIGN_PARAMS_UNBIND(params) \
+ , /* const-bind names */ \
+ BOOST_LOCAL_AUX_PP_SIGN_PARAMS_CONST_BIND(params) \
+ , /* const-bind `this` count */ \
+ BOOST_LOCAL_AUX_PP_SIGN_PARAMS_CONST_BIND_THIS_COUNT(params) \
+ , /* bind names */ \
+ BOOST_LOCAL_AUX_PP_SIGN_PARAMS_BIND(params) \
+ , /* bind `this` count */ \
+ BOOST_PP_INC(BOOST_LOCAL_AUX_PP_SIGN_PARAMS_BIND_THIS_COUNT( \
+ params)) /* increment */ \
+ , /* error message (if any) */ \
+ BOOST_LOCAL_AUX_PP_SIGN_PARAMS_ERROR(params) \
+ )
+
+#endif // #include guard
+

Added: sandbox/local/libs/local/params_name/aux_/preprocessor/sign/parsed_/params/inc_const_bind_this_count.hpp
==============================================================================
--- (empty file)
+++ sandbox/local/libs/local/params_name/aux_/preprocessor/sign/parsed_/params/inc_const_bind_this_count.hpp 2011-02-15 12:09:54 EST (Tue, 15 Feb 2011)
@@ -0,0 +1,28 @@
+
+
+#ifndef BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_INC_CONST_BIND_THIS_COUNT_HPP_
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_INC_CONST_BIND_THIS_COUNT_HPP_
+
+#include "../../params/unbind.hpp"
+#include "../../params/bind.hpp"
+#include "../../params/const_bind.hpp"
+#include <boost/preprocessor/arithmetic/inc.hpp>
+
+#define BOOST_LOCAL_AUX_PP_SIGN_PARAMS_INC_CONST_BIND_THIS_COUNT(params) \
+ ( /* unbind params and defaults */ \
+ BOOST_LOCAL_AUX_PP_SIGN_PARAMS_UNBIND(params) \
+ , /* const-bind names */ \
+ BOOST_LOCAL_AUX_PP_SIGN_PARAMS_CONST_BIND(params) \
+ , /* const-bind `this` count */ \
+ BOOST_PP_INC(BOOST_LOCAL_AUX_PP_SIGN_PARAMS_CONST_BIND_THIS_COUNT( \
+ params)) /* increment */ \
+ , /* bind names */ \
+ BOOST_LOCAL_AUX_PP_SIGN_PARAMS_BIND(params) \
+ , /* bind `this` count */ \
+ BOOST_LOCAL_AUX_PP_SIGN_PARAMS_BIND_THIS_COUNT(params) \
+ , /* error message (if any) */ \
+ BOOST_LOCAL_AUX_PP_SIGN_PARAMS_ERROR(params) \
+ )
+
+#endif // #include guard
+

Added: sandbox/local/libs/local/params_name/aux_/preprocessor/sign/parsed_/params/index.hpp
==============================================================================
--- (empty file)
+++ sandbox/local/libs/local/params_name/aux_/preprocessor/sign/parsed_/params/index.hpp 2011-02-15 12:09:54 EST (Tue, 15 Feb 2011)
@@ -0,0 +1,28 @@
+
+#ifndef BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_INDEX_HPP_
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_INDEX_HPP_
+
+// Parameter (unbound, const-bound, and bound) tuple internal representation:
+//
+// ( // Unbound params tuple.
+// ((NIL, NIL EMPTY)) (([auto | register] ptype pname, pdflt EMPTY)) ...
+// , (NIL) ([&] var) ... // Const bound params.
+// , const_bind_this_count // Number of const bound `this`.
+// , (NIL) ([&] var) ... // Bound params (not const).
+// , bind_this_count // Number of bound `this` (not const).
+//
+// )
+//
+// ptype, pname, pdflt: Parameter types, names, and default values.
+// var: Name of a variable in scope.
+
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_INDEX_UNBIND 0
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_INDEX_CONST_BIND 1
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_INDEX_CONST_BIND_THIS_COUNT 2
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_INDEX_BIND 3
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_INDEX_BIND_THIS_COUNT 4
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_INDEX_ERROR 5
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_INDEX_MAX 6
+
+#endif // #include guard
+

Added: sandbox/local/libs/local/params_name/aux_/preprocessor/sign/parsed_/params/nil.hpp
==============================================================================
--- (empty file)
+++ sandbox/local/libs/local/params_name/aux_/preprocessor/sign/parsed_/params/nil.hpp 2011-02-15 12:09:54 EST (Tue, 15 Feb 2011)
@@ -0,0 +1,28 @@
+
+#ifndef BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_NIL_HPP_
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_NIL_HPP_
+
+#include <boost/preprcoessor/facilities/empty.hpp>
+
+// See "index_.hpp".
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_NIL \
+ ( \
+ /* unbound params: nil-seq of 2-tuples */ \
+ /* `((NIL, NIL)) ((classifier_type_name, default)) ...` */ \
+ ( (BOOST_LOCAL_AUX_PP_NIL, BOOST_LOCAL_AUX_PP_NIL BOOST_PP_EMPTY) ) \
+ , \
+ /* const-binds: nil-seq of 1-tuple `(NIL) (ref_name) ...` */ \
+ (BOOST_LOCAL_AUX_PP_NIL) \
+ , \
+ 0 /* number of const-bind `this` */ \
+ , \
+ /* binds: nil-seq of 1-tuple `(NIL) (ref_name) ...` */ \
+ (BOOST_LOCAL_AUX_PP_NIL) \
+ , \
+ 0 /* number of bind `this` */ \
+ , \
+ BOOST_PP_EMPTY /* no error */ \
+ )
+
+#endif // #include guard
+

Added: sandbox/local/libs/local/params_name/aux_/preprocessor/sign/parsed_/params/set_error.cpp
==============================================================================
--- (empty file)
+++ sandbox/local/libs/local/params_name/aux_/preprocessor/sign/parsed_/params/set_error.cpp 2011-02-15 12:09:54 EST (Tue, 15 Feb 2011)
@@ -0,0 +1,26 @@
+
+#ifndef BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_SET_ERROR_HPP_
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_SET_ERROR_HPP_
+
+#include "../../params/unbind.hpp"
+#include "../../params/bind.hpp"
+#include "../../params/const_bind.hpp"
+
+// error: `EMPTY` if no error, `ERROR_message_text EMPTY` if error.
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_SET_ERROR(params, error) \
+ ( /* unbind params and defaults */ \
+ BOOST_LOCAL_AUX_PP_SIGN_PARAMS_UNBIND(params) \
+ , /* const-bind names */ \
+ BOOST_LOCAL_AUX_PP_SIGN_PARAMS_CONST_BIND(params) \
+ , /* const-bind `this` count */ \
+ BOOST_LOCAL_AUX_PP_SIGN_PARAMS_CONST_BIND_THIS_COUNT(params) \
+ , /* bind names */ \
+ BOOST_LOCAL_AUX_PP_SIGN_PARAMS_BIND(params) \
+ , /* bind `this` count */ \
+ BOOST_LOCAL_AUX_PP_SIGN_PARAMS_BIND_THIS_COUNT(params) \
+ , /* error message (if any) */ \
+ error \
+ )
+
+#endif // #include guard
+

Added: sandbox/local/libs/local/params_name/aux_/preprocessor/sign/parsed_/params/validate.hpp
==============================================================================
--- (empty file)
+++ sandbox/local/libs/local/params_name/aux_/preprocessor/sign/parsed_/params/validate.hpp 2011-02-15 12:09:54 EST (Tue, 15 Feb 2011)
@@ -0,0 +1,36 @@
+
+#ifndef BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_VALIDATE_HPP_
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_VALIDATE_HPP_
+
+#include "../params/error.hpp"
+#include "../params/const_bind.hpp"
+#include "../params/bind.hpp"
+#include "../parsed_/params/error.hpp"
+#include <boost/preprocessor/control/iif.hpp>
+#include <boost/preprocessor/facilities/is_empty.hpp>
+#include <boost/preprocessor/tuple/eat.hpp>
+#include <boost/preprocessor/arithmetic/greater.hpp>
+#include <boost/preprocessor/arithmetic/add.hpp>
+
+// Private API.
+
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_VALIDATE_THIS_COUNT_(params) \
+ BOOST_PP_IIF(BOOST_PP_GREATER(BOOST_PP_ADD( \
+ BOOST_LOCAL_AUX_PP_SIGN_PARAMS_CONST_BIND_THIS_COUNT(params), \
+ BOOST_LOCAL_AUX_PP_SIGN_PARAMS_BIND_THIS_COUNT(params)), 1), \
+ BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_SET_ERROR \
+ , \
+ params BOOST_PP_TUPLE_EAT(2) \
+ )(params, ERROR_object_this_cannot_be_bound_multiple_times)
+
+// Public API.
+
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_VALIDATE(params) \
+ BOOST_PP_IIF(BOOST_LOCAL_AUX_PP_SIGN_PARAMS_HAVE_ERROR(params), \
+ BOOST_LOCAL_AUX_PP_SIGN_PARSED_PARAMS_VALIDATE_THIS_COUNT_ \
+ , \
+ params BOOST_PP_TUPLE_EAT(1) /* fwd existing error */ \
+ )(params)
+
+#endif // #include guard
+


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