Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r69294 - in trunk/boost/spirit/home/lex: lexer lexer/lexertl qi
From: hartmut.kaiser_at_[hidden]
Date: 2011-02-25 23:12:12


Author: hkaiser
Date: 2011-02-25 23:12:08 EST (Fri, 25 Feb 2011)
New Revision: 69294
URL: http://svn.boost.org/trac/boost/changeset/69294

Log:
Spirit: lexer tweaks
Text files modified:
   trunk/boost/spirit/home/lex/lexer/char_token_def.hpp | 4 +++-
   trunk/boost/spirit/home/lex/lexer/lexertl/generate_static.hpp | 2 +-
   trunk/boost/spirit/home/lex/lexer/lexertl/iterator_tokenizer.hpp | 8 +++++---
   trunk/boost/spirit/home/lex/lexer/string_token_def.hpp | 4 +++-
   trunk/boost/spirit/home/lex/lexer/terminals.hpp | 1 -
   trunk/boost/spirit/home/lex/qi/in_state.hpp | 1 -
   trunk/boost/spirit/home/lex/qi/plain_token.hpp | 3 +++
   trunk/boost/spirit/home/lex/qi/plain_tokenid.hpp | 3 +++
   8 files changed, 18 insertions(+), 8 deletions(-)

Modified: trunk/boost/spirit/home/lex/lexer/char_token_def.hpp
==============================================================================
--- trunk/boost/spirit/home/lex/lexer/char_token_def.hpp (original)
+++ trunk/boost/spirit/home/lex/lexer/char_token_def.hpp 2011-02-25 23:12:08 EST (Fri, 25 Feb 2011)
@@ -49,8 +49,10 @@
 namespace boost { namespace spirit { namespace lex
 {
     // use char_ from standard character set by default
- using spirit::standard::char_type;
+#ifndef BOOST_SPIRIT_NO_PREDEFINED_TERMINALS
     using spirit::standard::char_;
+#endif
+ using spirit::standard::char_type;
 
     ///////////////////////////////////////////////////////////////////////////
     //

Modified: trunk/boost/spirit/home/lex/lexer/lexertl/generate_static.hpp
==============================================================================
--- trunk/boost/spirit/home/lex/lexer/lexertl/generate_static.hpp (original)
+++ trunk/boost/spirit/home/lex/lexer/lexertl/generate_static.hpp 2011-02-25 23:12:08 EST (Fri, 25 Feb 2011)
@@ -548,7 +548,7 @@
         typedef typename boost::lexer::basic_state_machine<Char>::iterator
             iterator_type;
         iterator_type iter_ = sm_.begin();
- std::size_t states_ = iter_->states;
+ std::size_t const states_ = iter_->states;
 
         for (std::size_t state_ = 0; state_ < states_; ++state_)
         {

Modified: trunk/boost/spirit/home/lex/lexer/lexertl/iterator_tokenizer.hpp
==============================================================================
--- trunk/boost/spirit/home/lex/lexer/lexertl/iterator_tokenizer.hpp (original)
+++ trunk/boost/spirit/home/lex/lexer/lexertl/iterator_tokenizer.hpp 2011-02-25 23:12:08 EST (Fri, 25 Feb 2011)
@@ -40,12 +40,14 @@
             }
 
             bool bol = bol_;
+ boost::lexer::detail::internals const& internals_ =
+ state_machine_.data();
 
         again:
- std::size_t const* lookup_ = &state_machine_.data()._lookup[dfa_state_]->
+ std::size_t const* lookup_ = &internals_._lookup[dfa_state_]->
                 front ();
- std::size_t dfa_alphabet_ = state_machine_.data()._dfa_alphabet[dfa_state_];
- std::size_t const* dfa_ = &state_machine_.data()._dfa[dfa_state_]->front ();
+ std::size_t dfa_alphabet_ = internals_._dfa_alphabet[dfa_state_];
+ std::size_t const* dfa_ = &internals_._dfa[dfa_state_]->front ();
 
             std::size_t const* ptr_ = dfa_ + dfa_alphabet_;
             Iterator curr_ = start_token_;

Modified: trunk/boost/spirit/home/lex/lexer/string_token_def.hpp
==============================================================================
--- trunk/boost/spirit/home/lex/lexer/string_token_def.hpp (original)
+++ trunk/boost/spirit/home/lex/lexer/string_token_def.hpp 2011-02-25 23:12:08 EST (Fri, 25 Feb 2011)
@@ -43,8 +43,10 @@
 namespace boost { namespace spirit { namespace lex
 {
     // use string from standard character set by default
- using spirit::standard::string_type;
+#ifndef BOOST_SPIRIT_NO_PREDEFINED_TERMINALS
     using spirit::standard::string;
+#endif
+ using spirit::standard::string_type;
 
     ///////////////////////////////////////////////////////////////////////////
     //

Modified: trunk/boost/spirit/home/lex/lexer/terminals.hpp
==============================================================================
--- trunk/boost/spirit/home/lex/lexer/terminals.hpp (original)
+++ trunk/boost/spirit/home/lex/lexer/terminals.hpp 2011-02-25 23:12:08 EST (Fri, 25 Feb 2011)
@@ -18,7 +18,6 @@
     // Define a more convenient name for an omitted token attribute type
     typedef spirit::omit_type omit;
     using spirit::omit_type;
-
 }}}
 
 #endif

Modified: trunk/boost/spirit/home/lex/qi/in_state.hpp
==============================================================================
--- trunk/boost/spirit/home/lex/qi/in_state.hpp (original)
+++ trunk/boost/spirit/home/lex/qi/in_state.hpp 2011-02-25 23:12:08 EST (Fri, 25 Feb 2011)
@@ -27,7 +27,6 @@
>::type
           , Skipper
>::type {};
-
 }}}
 
 #endif

Modified: trunk/boost/spirit/home/lex/qi/plain_token.hpp
==============================================================================
--- trunk/boost/spirit/home/lex/qi/plain_token.hpp (original)
+++ trunk/boost/spirit/home/lex/qi/plain_token.hpp 2011-02-25 23:12:08 EST (Fri, 25 Feb 2011)
@@ -52,7 +52,10 @@
 
 namespace boost { namespace spirit { namespace qi
 {
+#ifndef BOOST_SPIRIT_NO_PREDEFINED_TERMINALS
     using spirit::token;
+#endif
+ using spirit::token_type;
 
     ///////////////////////////////////////////////////////////////////////////
     template <typename TokenId>

Modified: trunk/boost/spirit/home/lex/qi/plain_tokenid.hpp
==============================================================================
--- trunk/boost/spirit/home/lex/qi/plain_tokenid.hpp (original)
+++ trunk/boost/spirit/home/lex/qi/plain_tokenid.hpp 2011-02-25 23:12:08 EST (Fri, 25 Feb 2011)
@@ -51,7 +51,10 @@
 
 namespace boost { namespace spirit { namespace qi
 {
+#ifndef BOOST_SPIRIT_NO_PREDEFINED_TERMINALS
     using spirit::tokenid;
+#endif
+ using spirit::tokenid_type;
 
     ///////////////////////////////////////////////////////////////////////////
     // The plain_tokenid represents a simple token defined by the lexer inside


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