Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r72429 - trunk/libs/spirit/example/qi/compiler_tutorial/conjure_lexer
From: hartmut.kaiser_at_[hidden]
Date: 2011-06-05 22:01:44


Author: hkaiser
Date: 2011-06-05 22:01:43 EDT (Sun, 05 Jun 2011)
New Revision: 72429
URL: http://svn.boost.org/trac/boost/changeset/72429

Log:
Spirit: minor fixes to conjure_lexer
Text files modified:
   trunk/libs/spirit/example/qi/compiler_tutorial/conjure_lexer/conjure_static_lexer_generate.cpp | 3 ---
   trunk/libs/spirit/example/qi/compiler_tutorial/conjure_lexer/lexer.hpp | 11 +++++++----
   2 files changed, 7 insertions(+), 7 deletions(-)

Modified: trunk/libs/spirit/example/qi/compiler_tutorial/conjure_lexer/conjure_static_lexer_generate.cpp
==============================================================================
--- trunk/libs/spirit/example/qi/compiler_tutorial/conjure_lexer/conjure_static_lexer_generate.cpp (original)
+++ trunk/libs/spirit/example/qi/compiler_tutorial/conjure_lexer/conjure_static_lexer_generate.cpp 2011-06-05 22:01:43 EDT (Sun, 05 Jun 2011)
@@ -9,9 +9,6 @@
 #include <fstream>
 #include <iostream>
 
-// Generating the static lexers is done based on the dynamic table based lexer
-#define CONJURE_LEXER_DYNAMIC_TABLES 1
-
 #include "lexer_def.hpp"
 #include <boost/spirit/include/lex_generate_static_lexertl.hpp>
 

Modified: trunk/libs/spirit/example/qi/compiler_tutorial/conjure_lexer/lexer.hpp
==============================================================================
--- trunk/libs/spirit/example/qi/compiler_tutorial/conjure_lexer/lexer.hpp (original)
+++ trunk/libs/spirit/example/qi/compiler_tutorial/conjure_lexer/lexer.hpp 2011-06-05 22:01:43 EDT (Sun, 05 Jun 2011)
@@ -7,6 +7,9 @@
 #if !defined(BOOST_SPIRIT_CONJURE_LEXER_HPP)
 #define BOOST_SPIRIT_CONJURE_LEXER_HPP
 
+#include "config.hpp"
+#include "token_ids.hpp"
+
 #if CONJURE_LEXER_STATIC_TABLES != 0
 #include <boost/spirit/include/lex_static_lexertl.hpp>
 #include "conjure_static_lexer.hpp"
@@ -15,8 +18,6 @@
 #include "conjure_static_switch_lexer.hpp"
 #endif
 
-#include "token_ids.hpp"
-
 namespace client { namespace lexer
 {
     ///////////////////////////////////////////////////////////////////////////
@@ -42,12 +43,14 @@
                 token_type
               , boost::spirit::lex::lexertl::static_::lexer_conjure_static
> type;
-#else // CONJURE_LEXER_STATIC_SWITCH != 0
- // use the lexer based on runtime generated DFA tables
+#elif CONJURE_LEXER_STATIC_SWITCH != 0
+ // use the lexer based on pre-generated static DFA tables
             typedef lex::lexertl::static_actor_lexer<
                 token_type
               , boost::spirit::lex::lexertl::static_::lexer_conjure_static_switch
> type;
+#else
+#error "Configuration problem: please select exactly one type of lexer to build"
 #endif
         };
     }


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