Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-19 09:47:50

0001 // internals.hpp
0002 // Copyright (c) 2009 Ben Hanson (http://www.benhanson.net/)
0003 //
0004 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0005 // file licence_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 #ifndef BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_INTERNALS_HPP
0007 #define BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_INTERNALS_HPP
0008 
0009 #include "containers/ptr_vector.hpp"
0010 
0011 namespace boost
0012 {
0013 namespace lexer
0014 {
0015 namespace detail
0016 {
0017 struct internals
0018 {
0019     typedef std::vector<std::size_t> size_t_vector;
0020     typedef ptr_vector<size_t_vector> size_t_vector_vector;
0021 
0022     size_t_vector_vector _lookup;
0023     size_t_vector _dfa_alphabet;
0024     size_t_vector_vector _dfa;
0025     bool _seen_BOL_assertion;
0026     bool _seen_EOL_assertion;
0027 
0028     internals () :
0029         _seen_BOL_assertion (false),
0030         _seen_EOL_assertion (false)
0031     {
0032     }
0033 
0034     void clear ()
0035     {
0036         _lookup.clear ();
0037         _dfa_alphabet.clear ();
0038         _dfa.clear ();
0039         _seen_BOL_assertion = false;
0040         _seen_EOL_assertion = false;
0041     }
0042 
0043     void swap (internals &internals_)
0044     {
0045         _lookup->swap (*internals_._lookup);
0046         _dfa_alphabet.swap (internals_._dfa_alphabet);
0047         _dfa->swap (*internals_._dfa);
0048         std::swap (_seen_BOL_assertion, internals_._seen_BOL_assertion);
0049         std::swap (_seen_EOL_assertion, internals_._seen_EOL_assertion);
0050     }
0051 
0052 private:
0053     internals (const internals &); // No copy construction.
0054     internals &operator = (const internals &); // No assignment.
0055 };
0056 }
0057 }
0058 }
0059 
0060 #endif