#include <boost/spirit/include/classic_grammar_def.hpp>
using namespace BOOST_SPIRIT_CLASSIC_NS;
-///////////////////////////////////////////////////////////////////////////////
-// This feature is disabled on non compliant compilers (e.g. Borland 5.5.1
-// VC6 and VC7)
-#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && \
- !BOOST_WORKAROUND(__BORLANDC__, <= 0x551) && \
- !BOOST_WORKAROUND(__GNUC__, < 3)
-# define BOOST_SPIRIT_USE_GRAMMARDEF
-#endif
-
//////////////////////////////////////////////////////////////////////////////
//
// Grammar tests
template <typename ScannerT>
struct definition
-#if defined(BOOST_SPIRIT_USE_GRAMMARDEF)
: public grammar_def<rule<ScannerT>, same>
-#endif
{
definition(num_list const& /*self*/)
{
num = int_p;
r = num >> *(',' >> num);
-#if defined(BOOST_SPIRIT_USE_GRAMMARDEF)
this->start_parsers(r, num);
-#endif
+
BOOST_SPIRIT_DEBUG_RULE(num);
BOOST_SPIRIT_DEBUG_RULE(r);
}
rule<ScannerT> r, num;
-#if !defined(BOOST_SPIRIT_USE_GRAMMARDEF)
rule<ScannerT> const& start() const { return r; }
-#endif
};
};
template <typename ScannerT>
struct definition
-#if defined(BOOST_SPIRIT_USE_GRAMMARDEF)
: public grammar_def<rule<ScannerT>, same, int_parser<int, 10, 1, -1> >
-#endif
{
definition(num_list_ex const& /*self*/)
{
num = integer;
r = num >> *(',' >> num);
-#if defined(BOOST_SPIRIT_USE_GRAMMARDEF)
this->start_parsers(r, num, integer);
-#endif
+
BOOST_SPIRIT_DEBUG_RULE(num);
BOOST_SPIRIT_DEBUG_RULE(r);
}
rule<ScannerT> r, num;
int_parser<int, 10, 1, -1> integer;
-#if !defined(BOOST_SPIRIT_USE_GRAMMARDEF)
rule<ScannerT> const& start() const { return r; }
-#endif
};
};
BOOST_TEST(pi.hit);
BOOST_TEST(pi.full);
-#if defined(BOOST_SPIRIT_USE_GRAMMARDEF)
num_list_ex nlistex;
BOOST_SPIRIT_DEBUG_GRAMMAR(nlistex);
space_p);
BOOST_TEST(pi.hit);
BOOST_TEST(pi.full);
-#endif // defined(BOOST_SPIRIT_USE_GRAMMARDEF)
}
///////////////////////////////////////////////////////////////////////////////