Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r68870 - trunk/boost/spirit/home/support
From: hartmut.kaiser_at_[hidden]
Date: 2011-02-14 14:25:10


Author: hkaiser
Date: 2011-02-14 14:25:09 EST (Mon, 14 Feb 2011)
New Revision: 68870
URL: http://svn.boost.org/trac/boost/changeset/68870

Log:
Spirit: added comptibility macros for older code still using BOOST_SPIRIT_TERMINAL[_EX]
Text files modified:
   trunk/boost/spirit/home/support/common_terminals.hpp | 4 ++--
   trunk/boost/spirit/home/support/terminal.hpp | 34 +++++++++++++++++++++-------------
   2 files changed, 23 insertions(+), 15 deletions(-)

Modified: trunk/boost/spirit/home/support/common_terminals.hpp
==============================================================================
--- trunk/boost/spirit/home/support/common_terminals.hpp (original)
+++ trunk/boost/spirit/home/support/common_terminals.hpp 2011-02-14 14:25:09 EST (Mon, 14 Feb 2011)
@@ -63,7 +63,7 @@
     {};
 
     // Our basic terminals
- BOOST_SPIRIT_DEFINE_TERMINALS(
+ BOOST_SPIRIT_DEFINE_TERMINALS_NAME(
         ( verbatim, verbatim_type )
         ( no_delimit, no_delimit_type )
         ( lexeme, lexeme_type )
@@ -86,7 +86,7 @@
     )
 
     // Our extended terminals
- BOOST_SPIRIT_DEFINE_TERMINALS_EX(
+ BOOST_SPIRIT_DEFINE_TERMINALS_NAME_EX(
         ( lit, lit_type )
         ( bin, bin_type )
         ( oct, oct_type )

Modified: trunk/boost/spirit/home/support/terminal.hpp
==============================================================================
--- trunk/boost/spirit/home/support/terminal.hpp (original)
+++ trunk/boost/spirit/home/support/terminal.hpp 2011-02-14 14:25:09 EST (Mon, 14 Feb 2011)
@@ -504,7 +504,7 @@
 
 #ifndef BOOST_SPIRIT_NO_PREDEFINED_TERMINALS
 
-#define BOOST_SPIRIT_TERMINAL(name, type_name) \
+#define BOOST_SPIRIT_TERMINAL_NAME(name, type_name) \
     namespace tag { struct name {}; } \
     typedef boost::proto::terminal<tag::name>::type type_name; \
     type_name const name = {{}}; \
@@ -513,22 +513,26 @@
 
 #else
 
-#define BOOST_SPIRIT_TERMINAL(name, type_name) \
+#define BOOST_SPIRIT_TERMINAL_NAME(name, type_name) \
     namespace tag { struct name {}; } \
     typedef boost::proto::terminal<tag::name>::type type_name; \
     /***/
 
 #endif
 
-#define BOOST_SPIRIT_DEFINE_TERMINALS_A(r, _, names) \
- BOOST_SPIRIT_TERMINAL( \
+#define BOOST_SPIRIT_TERMINAL(name) \
+ BOOST_SPIRIT_TERMINAL_NAME(name, name ## _type) \
+ /***/
+
+#define BOOST_SPIRIT_DEFINE_TERMINALS_NAME_A(r, _, names) \
+ BOOST_SPIRIT_TERMINAL_NAME( \
         BOOST_PP_TUPLE_ELEM(2, 0, names), \
         BOOST_PP_TUPLE_ELEM(2, 1, names) \
     ) \
     /***/
 
-#define BOOST_SPIRIT_DEFINE_TERMINALS(seq) \
- BOOST_PP_SEQ_FOR_EACH(BOOST_SPIRIT_DEFINE_TERMINALS_A, _, \
+#define BOOST_SPIRIT_DEFINE_TERMINALS_NAME(seq) \
+ BOOST_PP_SEQ_FOR_EACH(BOOST_SPIRIT_DEFINE_TERMINALS_NAME_A, _, \
         BOOST_PP_CAT(BOOST_SPIRIT_TERMINAL_X seq, 0)) \
     /***/
 
@@ -538,31 +542,35 @@
 
 #ifndef BOOST_SPIRIT_NO_PREDEFINED_TERMINALS
 
-#define BOOST_SPIRIT_TERMINAL_EX(name, type_name) \
+#define BOOST_SPIRIT_TERMINAL_NAME_EX(name, type_name) \
     namespace tag { struct name {}; } \
     typedef boost::spirit::terminal<tag::name> type_name; \
- type_name const name = type_name(); \
+ type_name const name = type_name(); \
     inline void BOOST_PP_CAT(silence_unused_warnings_, name)() { (void) name; } \
     /***/
 
 #else
 
-#define BOOST_SPIRIT_TERMINAL_EX(name, type_name) \
+#define BOOST_SPIRIT_TERMINAL_NAME_EX(name, type_name) \
     namespace tag { struct name {}; } \
     typedef boost::spirit::terminal<tag::name> type_name; \
     /***/
 
 #endif
 
-#define BOOST_SPIRIT_DEFINE_TERMINALS_EX_A(r, _, names) \
- BOOST_SPIRIT_TERMINAL_EX( \
+#define BOOST_SPIRIT_TERMINAL_EX(name) \
+ BOOST_SPIRIT_TERMINAL_NAME_EX(name, name ## _type) \
+ /***/
+
+#define BOOST_SPIRIT_DEFINE_TERMINALS_NAME_EX_A(r, _, names) \
+ BOOST_SPIRIT_TERMINAL_NAME_EX( \
         BOOST_PP_TUPLE_ELEM(2, 0, names), \
         BOOST_PP_TUPLE_ELEM(2, 1, names) \
     ) \
     /***/
 
-#define BOOST_SPIRIT_DEFINE_TERMINALS_EX(seq) \
- BOOST_PP_SEQ_FOR_EACH(BOOST_SPIRIT_DEFINE_TERMINALS_EX_A, _, \
+#define BOOST_SPIRIT_DEFINE_TERMINALS_NAME_EX(seq) \
+ BOOST_PP_SEQ_FOR_EACH(BOOST_SPIRIT_DEFINE_TERMINALS_NAME_EX_A, _, \
         BOOST_PP_CAT(BOOST_SPIRIT_TERMINAL_X seq, 0)) \
     /***/
 


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