mirror of
https://github.com/boostorg/spirit.git
synced 2026-01-19 04:42:11 +00:00
-- tab -> spaces
[SVN r17123]
This commit is contained in:
@@ -114,7 +114,7 @@ namespace boost { namespace spirit {
|
||||
|
||||
public:
|
||||
|
||||
typedef nil_t attr_t;
|
||||
typedef nil_t attr_t;
|
||||
|
||||
match()
|
||||
: len(-1) {}
|
||||
|
||||
@@ -20,8 +20,8 @@ namespace boost { namespace spirit {
|
||||
|
||||
namespace impl
|
||||
{
|
||||
struct is_parser_helper
|
||||
{
|
||||
struct is_parser_helper
|
||||
{
|
||||
typedef struct { char dummy[1]; } no;
|
||||
typedef struct { no dummy[2]; } yes;
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace impl
|
||||
static yes test(parser<T> const *);
|
||||
|
||||
static no test(...);
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
|
||||
@@ -30,30 +30,30 @@ namespace boost { namespace spirit {
|
||||
template <int N, typename ListT>
|
||||
struct get_subrule_chooser
|
||||
{
|
||||
static ListT t();
|
||||
static char test(nil_t);
|
||||
static int test(...);
|
||||
static ListT t();
|
||||
static char test(nil_t);
|
||||
static int test(...);
|
||||
|
||||
// Set value to
|
||||
// 0: ListT is empty
|
||||
// 1: ListT's first item has same ID
|
||||
// 2: ListT's first item has a different ID
|
||||
// Set value to
|
||||
// 0: ListT is empty
|
||||
// 1: ListT's first item has same ID
|
||||
// 2: ListT's first item has a different ID
|
||||
|
||||
enum
|
||||
{
|
||||
enum
|
||||
{
|
||||
id = ListT::first_t::id,
|
||||
is_same_id = N == id,
|
||||
is_nil_t = sizeof(char) == sizeof(test(t())),
|
||||
value = is_nil_t ? 0 : (is_same_id ? 1 : 2)
|
||||
};
|
||||
};
|
||||
is_nil_t = sizeof(char) == sizeof(test(t())),
|
||||
value = is_nil_t ? 0 : (is_same_id ? 1 : 2)
|
||||
};
|
||||
};
|
||||
|
||||
template <int N>
|
||||
struct subrule_chooser;
|
||||
template <int N>
|
||||
struct subrule_chooser;
|
||||
|
||||
template <>
|
||||
struct subrule_chooser<0>
|
||||
{
|
||||
template <>
|
||||
struct subrule_chooser<0>
|
||||
{
|
||||
// First case. ListT is empty
|
||||
|
||||
template <int N, typename ListT>
|
||||
@@ -61,27 +61,27 @@ namespace boost { namespace spirit {
|
||||
{ typedef nil_t type; };
|
||||
};
|
||||
|
||||
template <>
|
||||
struct subrule_chooser<1>
|
||||
{
|
||||
template <>
|
||||
struct subrule_chooser<1>
|
||||
{
|
||||
// Second case. ListT is non-empty and the list's
|
||||
// first item has the ID we are looking for.
|
||||
|
||||
template <int N, typename ListT>
|
||||
struct result
|
||||
{ typedef typename ListT::first_t::def_t type; };
|
||||
};
|
||||
};
|
||||
|
||||
template <>
|
||||
struct subrule_chooser<2>
|
||||
{
|
||||
template <>
|
||||
struct subrule_chooser<2>
|
||||
{
|
||||
// Third case. ListT is non-empty but the list's
|
||||
// first item does not have the ID we are looking for.
|
||||
|
||||
template <int N, typename ListT>
|
||||
struct result
|
||||
{ typedef typename get_subrule<N, ListT::rest_t>::type type; };
|
||||
};
|
||||
};
|
||||
|
||||
template <int N, typename ListT>
|
||||
struct get_subrule
|
||||
|
||||
@@ -108,7 +108,7 @@ namespace boost { namespace spirit {
|
||||
template <typename ScannerT, typename ListT>
|
||||
struct subrules_scanner_finder
|
||||
{
|
||||
typedef subrules_scanner<ScannerT, ListT> type;
|
||||
typedef subrules_scanner<ScannerT, ListT> type;
|
||||
};
|
||||
|
||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
@@ -120,7 +120,7 @@ namespace boost { namespace spirit {
|
||||
template <typename ScannerT, typename ListT>
|
||||
struct subrules_scanner_finder<subrules_scanner<ScannerT, ListT>, ListT>
|
||||
{
|
||||
typedef subrules_scanner<ScannerT, ListT> type;
|
||||
typedef subrules_scanner<ScannerT, ListT> type;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -151,8 +151,8 @@ namespace boost { namespace spirit {
|
||||
typename parser_result<self_t, ScannerT>::type
|
||||
parse(ScannerT const& scan) const
|
||||
{
|
||||
typedef typename subrules_scanner_finder<ScannerT, self_t>::type
|
||||
subrules_scanner_t;
|
||||
typedef typename subrules_scanner_finder<ScannerT, self_t>::type
|
||||
subrules_scanner_t;
|
||||
subrules_scanner_t g_arg(scan, *this);
|
||||
return first.rhs.parse(g_arg);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace boost
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Parser categories
|
||||
// Parser categories
|
||||
//
|
||||
// Helper template classes to distinguish different types of
|
||||
// parsers. The following categories are the most generic. More
|
||||
|
||||
@@ -249,8 +249,8 @@ public:
|
||||
iter_param_t last_,
|
||||
PoliciesT const& policies = PoliciesT())
|
||||
: PoliciesT(policies), first(first_), last(last_) {
|
||||
at_end();
|
||||
}
|
||||
at_end();
|
||||
}
|
||||
|
||||
scanner(scanner const& other)
|
||||
: PoliciesT(other), first(other.first), last(other.last) {}
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace impl {
|
||||
BOOST_SPIRIT_DEBUG_OUT << " \"\n";
|
||||
}
|
||||
}
|
||||
#endif // BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_NODES
|
||||
#endif // BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_NODES
|
||||
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ namespace impl {
|
||||
scan.last);
|
||||
}
|
||||
scan.get_level()++;
|
||||
#endif // BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_NODES
|
||||
#endif // BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_NODES
|
||||
}
|
||||
|
||||
template <typename ResultT, typename ParserT, typename ScannerT>
|
||||
@@ -135,7 +135,7 @@ namespace impl {
|
||||
scan.first,
|
||||
scan.last);
|
||||
}
|
||||
#endif // BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_NODES
|
||||
#endif // BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_NODES
|
||||
|
||||
return this->base_t::post_parse(hit, p, scan);
|
||||
}
|
||||
|
||||
@@ -254,7 +254,7 @@ class inner
|
||||
#else
|
||||
private:
|
||||
#endif
|
||||
typedef std::deque<ValueT> queue_type;
|
||||
typedef std::deque<ValueT> queue_type;
|
||||
queue_type* queuedElements;
|
||||
mutable typename queue_type::size_type queuePosition;
|
||||
|
||||
@@ -581,7 +581,7 @@ class inner
|
||||
{
|
||||
public:
|
||||
typedef int value_type;
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
typedef int* pointer;
|
||||
typedef int& reference;
|
||||
|
||||
@@ -656,7 +656,7 @@ class inner
|
||||
typedef typename FunctorT::result_type result_type;
|
||||
public:
|
||||
typedef result_type value_type;
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
typedef result_type* pointer;
|
||||
typedef result_type& reference;
|
||||
|
||||
@@ -769,7 +769,7 @@ class multi_pass
|
||||
typedef typename InputPolicy::template inner<InputT> IP;
|
||||
|
||||
public:
|
||||
typedef std::forward_iterator_tag iterator_category;
|
||||
typedef std::forward_iterator_tag iterator_category;
|
||||
typedef typename IP::value_type value_type;
|
||||
typedef typename IP::difference_type difference_type;
|
||||
typedef typename IP::pointer pointer;
|
||||
@@ -1211,7 +1211,7 @@ namespace impl {
|
||||
inline void mp_swap(T& t1, T& t2)
|
||||
{
|
||||
using std::swap;
|
||||
using boost::spirit::swap;
|
||||
using boost::spirit::swap;
|
||||
swap(t1, t2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,9 +41,9 @@ struct file_position {
|
||||
file_position(std::string const& file_ = std::string(),
|
||||
int line_ = 1, int column_ = 1):
|
||||
file (file_),
|
||||
line (line_),
|
||||
column (column_)
|
||||
{}
|
||||
line (line_),
|
||||
column (column_)
|
||||
{}
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -408,8 +408,8 @@ namespace impl {
|
||||
template <typename T>
|
||||
struct as_ptr {
|
||||
|
||||
typedef T* pointer_type;
|
||||
|
||||
typedef T* pointer_type;
|
||||
|
||||
static T* get(T& ref)
|
||||
{ return &ref; }
|
||||
};
|
||||
@@ -418,8 +418,8 @@ namespace impl {
|
||||
template <typename T>
|
||||
struct as_ptr<T*> {
|
||||
|
||||
typedef T* pointer_type;
|
||||
|
||||
typedef T* pointer_type;
|
||||
|
||||
static T* get(T* ptr)
|
||||
{ return ptr; }
|
||||
};
|
||||
|
||||
@@ -338,10 +338,10 @@ private:
|
||||
closure_frame_ref(closure_frame_t** frame_ = 0)
|
||||
{
|
||||
#ifdef PHOENIX_THREADSAFE
|
||||
static boost::thread_specific_ptr<closure_frame_t **> tsp_frame;
|
||||
if (!tsp_frame.get())
|
||||
tsp_frame.reset(new closure_frame_t **(0));
|
||||
closure_frame_t **& frame = *tsp_frame;
|
||||
static boost::thread_specific_ptr<closure_frame_t **> tsp_frame;
|
||||
if (!tsp_frame.get())
|
||||
tsp_frame.reset(new closure_frame_t **(0));
|
||||
closure_frame_t **& frame = *tsp_frame;
|
||||
#else
|
||||
static closure_frame_t** frame = 0;
|
||||
#endif
|
||||
|
||||
@@ -188,7 +188,7 @@ namespace boost { namespace spirit {
|
||||
return result;
|
||||
}
|
||||
|
||||
typedef typename ScannerT::iterator_t iterator_t;
|
||||
typedef typename ScannerT::iterator_t iterator_t;
|
||||
node_t* np = root;
|
||||
CharT ch = *scan;
|
||||
iterator_t save = scan.first;
|
||||
|
||||
@@ -114,8 +114,8 @@ public:
|
||||
typename parser_result<self_t, ScannerT>::type
|
||||
parse_main(ScannerT const& scan) const
|
||||
{
|
||||
typedef typename ScannerT::iterator_t iterator_t;
|
||||
iterator_t first = scan.first;
|
||||
typedef typename ScannerT::iterator_t iterator_t;
|
||||
iterator_t first = scan.first;
|
||||
typename SetT::search_info result = SetT::find(scan);
|
||||
|
||||
if (result.data)
|
||||
@@ -127,7 +127,7 @@ public:
|
||||
scan.first);
|
||||
else
|
||||
return scan.no_match();
|
||||
}
|
||||
}
|
||||
|
||||
template <typename ScannerT>
|
||||
typename parser_result<self_t, ScannerT>::type
|
||||
|
||||
@@ -556,10 +556,10 @@ public:
|
||||
typedef typename container_t::iterator tree_iterator;
|
||||
typedef typename container_t::const_iterator const_tree_iterator;
|
||||
|
||||
typedef T attr_t;
|
||||
typedef typename boost::call_traits<T>::param_type param_type;
|
||||
typedef typename boost::call_traits<T>::reference reference;
|
||||
typedef typename boost::call_traits<T>::const_reference const_reference;
|
||||
typedef T attr_t;
|
||||
typedef typename boost::call_traits<T>::param_type param_type;
|
||||
typedef typename boost::call_traits<T>::reference reference;
|
||||
typedef typename boost::call_traits<T>::const_reference const_reference;
|
||||
|
||||
tree_match()
|
||||
: len(-1), trees(), val(impl::tree_match_attr<T>::get_default())
|
||||
|
||||
@@ -59,7 +59,7 @@ private:
|
||||
|
||||
public:
|
||||
void push (tree_t const &target, const_tree_iterator_t iter);
|
||||
void adjust_forward();
|
||||
void adjust_forward();
|
||||
void go_up(); // goes up, 'till the next parse_node is found
|
||||
void go_down(); // goes down, 'till a leaf node is found
|
||||
|
||||
@@ -80,11 +80,11 @@ public:
|
||||
parse_tree_iterator& operator++();
|
||||
parse_tree_iterator operator++(int);
|
||||
|
||||
bool operator==(tree_iterator_t const &rhs) const;
|
||||
bool operator!=(tree_iterator_t const &rhs) const;
|
||||
bool operator==(tree_iterator_t const &rhs) const;
|
||||
bool operator!=(tree_iterator_t const &rhs) const;
|
||||
|
||||
bool operator==(parse_tree_iterator const &rhs) const;
|
||||
bool operator!=(parse_tree_iterator const &rhs) const;
|
||||
bool operator==(parse_tree_iterator const &rhs) const;
|
||||
bool operator!=(parse_tree_iterator const &rhs) const;
|
||||
|
||||
private:
|
||||
node_stack nodes;
|
||||
|
||||
@@ -52,8 +52,8 @@ struct escape_char_action
|
||||
{
|
||||
typedef escape_char_action
|
||||
<ParserT, ActionT, Flags, CharT> self_t;
|
||||
typedef action_parser_category parser_category_t;
|
||||
typedef unary<ParserT, parser<self_t> > base_t;
|
||||
typedef action_parser_category parser_category_t;
|
||||
typedef unary<ParserT, parser<self_t> > base_t;
|
||||
|
||||
template <typename ScannerT>
|
||||
struct result
|
||||
@@ -74,7 +74,7 @@ struct escape_char_action
|
||||
parse(scan, *this);
|
||||
}
|
||||
|
||||
ActionT const& predicate() const { return actor; }
|
||||
ActionT const& predicate() const { return actor; }
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@@ -93,8 +93,8 @@ inline chset<CharT>::chset(anychar_parser arg)
|
||||
{
|
||||
ptr->set(
|
||||
std::numeric_limits<CharT>::min(),
|
||||
std::numeric_limits<CharT>::max()
|
||||
);
|
||||
std::numeric_limits<CharT>::max()
|
||||
);
|
||||
}
|
||||
|
||||
template <typename CharT>
|
||||
@@ -138,8 +138,8 @@ chset<CharT>::operator=(anychar_parser rhs)
|
||||
impl::detach_clear(ptr);
|
||||
ptr->set(
|
||||
std::numeric_limits<CharT>::min(),
|
||||
std::numeric_limits<CharT>::max()
|
||||
);
|
||||
std::numeric_limits<CharT>::max()
|
||||
);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
@@ -70,12 +70,12 @@ template <typename CharT>
|
||||
inline void
|
||||
basic_chset<CharT>::inverse()
|
||||
{
|
||||
basic_chset inv;
|
||||
inv.set(
|
||||
std::numeric_limits<CharT>::min(),
|
||||
std::numeric_limits<CharT>::max()
|
||||
);
|
||||
inv -= *this;
|
||||
basic_chset inv;
|
||||
inv.set(
|
||||
std::numeric_limits<CharT>::min(),
|
||||
std::numeric_limits<CharT>::max()
|
||||
);
|
||||
inv -= *this;
|
||||
swap(inv);
|
||||
}
|
||||
|
||||
@@ -101,13 +101,13 @@ template <typename CharT>
|
||||
inline basic_chset<CharT>&
|
||||
basic_chset<CharT>::operator&=(basic_chset<CharT> const& x)
|
||||
{
|
||||
basic_chset inv;
|
||||
inv.set(
|
||||
std::numeric_limits<CharT>::min(),
|
||||
std::numeric_limits<CharT>::max()
|
||||
);
|
||||
inv -= x;
|
||||
*this -= inv;
|
||||
basic_chset inv;
|
||||
inv.set(
|
||||
std::numeric_limits<CharT>::min(),
|
||||
std::numeric_limits<CharT>::max()
|
||||
);
|
||||
inv -= x;
|
||||
*this -= inv;
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -127,10 +127,10 @@ template <typename CharT>
|
||||
inline basic_chset<CharT>&
|
||||
basic_chset<CharT>::operator^=(basic_chset<CharT> const& x)
|
||||
{
|
||||
basic_chset bma = x;
|
||||
bma -= *this;
|
||||
*this -= x;
|
||||
*this |= bma;
|
||||
basic_chset bma = x;
|
||||
bma -= *this;
|
||||
*this -= x;
|
||||
*this |= bma;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user