Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r63277 - in trunk/libs/spirit/example/qi: calc6 calc7 mini_c
From: joel_at_[hidden]
Date: 2010-06-23 22:02:58


Author: djowel
Date: 2010-06-23 22:02:56 EDT (Wed, 23 Jun 2010)
New Revision: 63277
URL: http://svn.boost.org/trac/boost/changeset/63277

Log:
removed hack and used straight template instantiation
Text files modified:
   trunk/libs/spirit/example/qi/calc6/calc6b.cpp | 12 ++----------
   trunk/libs/spirit/example/qi/calc6/calc6c.cpp | 12 ++++--------
   trunk/libs/spirit/example/qi/calc7/calc7b.cpp | 12 +++---------
   trunk/libs/spirit/example/qi/calc7/calc7c.cpp | 10 ++--------
   trunk/libs/spirit/example/qi/mini_c/mini_cb.cpp | 12 ++----------
   trunk/libs/spirit/example/qi/mini_c/mini_cc.cpp | 11 ++---------
   trunk/libs/spirit/example/qi/mini_c/mini_cd.cpp | 10 ++--------
   7 files changed, 17 insertions(+), 62 deletions(-)

Modified: trunk/libs/spirit/example/qi/calc6/calc6b.cpp
==============================================================================
--- trunk/libs/spirit/example/qi/calc6/calc6b.cpp (original)
+++ trunk/libs/spirit/example/qi/calc6/calc6b.cpp 2010-06-23 22:02:56 EDT (Wed, 23 Jun 2010)
@@ -6,13 +6,5 @@
 =============================================================================*/
 #include "calc6b.hpp"
 
-// This is not really called. Its only purpose is to
-// instantiate the constructor of the grammar.
-void instantiate_expression()
-{
- typedef std::string::const_iterator iterator_type;
- qi::symbols<char, int> vars;
- std::vector<int> code;
- expression<iterator_type> g(code, vars);
-}
-
+typedef std::string::const_iterator iterator_type;
+template struct expression<iterator_type>;

Modified: trunk/libs/spirit/example/qi/calc6/calc6c.cpp
==============================================================================
--- trunk/libs/spirit/example/qi/calc6/calc6c.cpp (original)
+++ trunk/libs/spirit/example/qi/calc6/calc6c.cpp 2010-06-23 22:02:56 EDT (Wed, 23 Jun 2010)
@@ -6,11 +6,7 @@
 =============================================================================*/
 #include "calc6c.hpp"
 
-// This is not really called. Its only purpose is to
-// instantiate the constructor of the grammar.
-void instantiate_statement()
-{
- typedef std::string::const_iterator iterator_type;
- std::vector<int> code;
- statement<iterator_type> g(code);
-}
+typedef std::string::const_iterator iterator_type;
+template struct statement<iterator_type>;
+
+

Modified: trunk/libs/spirit/example/qi/calc7/calc7b.cpp
==============================================================================
--- trunk/libs/spirit/example/qi/calc7/calc7b.cpp (original)
+++ trunk/libs/spirit/example/qi/calc7/calc7b.cpp 2010-06-23 22:02:56 EDT (Wed, 23 Jun 2010)
@@ -6,12 +6,6 @@
 =============================================================================*/
 #include "calc7b.hpp"
 
-// This is not really called. Its only purpose is to
-// instantiate the constructor of the grammar.
-void instantiate_expression()
-{
- typedef std::string::const_iterator iterator_type;
- qi::symbols<char, int> vars;
- std::vector<int> code;
- expression<iterator_type> g(code, vars);
-}
+typedef std::string::const_iterator iterator_type;
+template struct expression<iterator_type>;
+

Modified: trunk/libs/spirit/example/qi/calc7/calc7c.cpp
==============================================================================
--- trunk/libs/spirit/example/qi/calc7/calc7c.cpp (original)
+++ trunk/libs/spirit/example/qi/calc7/calc7c.cpp 2010-06-23 22:02:56 EDT (Wed, 23 Jun 2010)
@@ -6,11 +6,5 @@
 =============================================================================*/
 #include "calc7c.hpp"
 
-// This is not really called. Its only purpose is to
-// instantiate the constructor of the grammar.
-void instantiate_statement()
-{
- typedef std::string::const_iterator iterator_type;
- std::vector<int> code;
- statement<iterator_type> g(code);
-}
+typedef std::string::const_iterator iterator_type;
+template struct statement<iterator_type>;

Modified: trunk/libs/spirit/example/qi/mini_c/mini_cb.cpp
==============================================================================
--- trunk/libs/spirit/example/qi/mini_c/mini_cb.cpp (original)
+++ trunk/libs/spirit/example/qi/mini_c/mini_cb.cpp 2010-06-23 22:02:56 EDT (Wed, 23 Jun 2010)
@@ -6,14 +6,6 @@
 =============================================================================*/
 #include "mini_cb.hpp"
 
-// This is not really called. Its only purpose is to
-// instantiate the constructor of the grammar.
-void instantiate_expression()
-{
- typedef std::string::const_iterator iterator_type;
- symbols<char, function_info> functions;
- symbols<char, int> vars;
- std::vector<int> code;
- expression<iterator_type> g(code, vars, functions);
-}
+typedef std::string::const_iterator iterator_type;
+template struct expression<iterator_type>;
 

Modified: trunk/libs/spirit/example/qi/mini_c/mini_cc.cpp
==============================================================================
--- trunk/libs/spirit/example/qi/mini_c/mini_cc.cpp (original)
+++ trunk/libs/spirit/example/qi/mini_c/mini_cc.cpp 2010-06-23 22:02:56 EDT (Wed, 23 Jun 2010)
@@ -6,12 +6,5 @@
 =============================================================================*/
 #include "mini_cc.hpp"
 
-// This is not really called. Its only purpose is to
-// instantiate the constructor of the grammar.
-void instantiate_statement()
-{
- typedef std::string::const_iterator iterator_type;
- symbols<char, function_info> functions;
- std::vector<int> code;
- statement<iterator_type> g(code, functions);
-}
+typedef std::string::const_iterator iterator_type;
+template struct statement<iterator_type>;

Modified: trunk/libs/spirit/example/qi/mini_c/mini_cd.cpp
==============================================================================
--- trunk/libs/spirit/example/qi/mini_c/mini_cd.cpp (original)
+++ trunk/libs/spirit/example/qi/mini_c/mini_cd.cpp 2010-06-23 22:02:56 EDT (Wed, 23 Jun 2010)
@@ -6,11 +6,5 @@
 =============================================================================*/
 #include "mini_cd.hpp"
 
-// This is not really called. Its only purpose is to
-// instantiate the constructor of the grammar.
-void instantiate_program()
-{
- typedef std::string::const_iterator iterator_type;
- std::vector<int> code;
- program<iterator_type> g(code);
-}
+typedef std::string::const_iterator iterator_type;
+template struct program<iterator_type>;


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