Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:02:17

0001 /*=============================================================================
0002     Boost.Wave: A Standard compliant C++ preprocessor library
0003 
0004     Definition of the abstract lexer interface
0005 
0006     http://www.boost.org/
0007 
0008     Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
0009     Software License, Version 1.0. (See accompanying file
0010     LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0011 =============================================================================*/
0012 
0013 #if !defined(BOOST_WAVE_LEX_INTERFACE_GENERATOR_HPP_INCLUDED)
0014 #define BOOST_WAVE_LEX_INTERFACE_GENERATOR_HPP_INCLUDED
0015 
0016 #include <boost/wave/wave_config.hpp>
0017 #include <boost/wave/util/file_position.hpp>
0018 #include <boost/wave/language_support.hpp>
0019 #include <boost/wave/cpplexer/cpp_lex_interface.hpp>
0020 #include <boost/wave/cpplexer/cpp_lex_token.hpp>      // lex_token
0021 
0022 // this must occur after all of the includes and before any code appears
0023 #ifdef BOOST_HAS_ABI_HEADERS
0024 #include BOOST_ABI_PREFIX
0025 #endif
0026 
0027 // suppress warnings about dependent classes not being exported from the dll
0028 #ifdef BOOST_MSVC
0029 #pragma warning(push)
0030 #pragma warning(disable : 4251 4231 4660)
0031 #endif
0032 
0033 ///////////////////////////////////////////////////////////////////////////////
0034 namespace boost {
0035 namespace wave {
0036 namespace cpplexer {
0037 
0038 #if BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION != 0
0039 #define BOOST_WAVE_NEW_LEXER_DECL BOOST_WAVE_DECL
0040 #else
0041 #define BOOST_WAVE_NEW_LEXER_DECL
0042 #endif
0043 
0044 ///////////////////////////////////////////////////////////////////////////////
0045 //
0046 //  new_lexer_gen: generates a new instance of the required C++ lexer
0047 //
0048 ///////////////////////////////////////////////////////////////////////////////
0049 template <
0050     typename IteratorT,
0051     typename PositionT = boost::wave::util::file_position_type,
0052     typename TokenT = lex_token<PositionT>
0053 >
0054 struct BOOST_WAVE_NEW_LEXER_DECL new_lexer_gen
0055 {
0056     //  The NewLexer function allows the opaque generation of a new lexer object.
0057     //  It is coupled to the token type to allow to decouple the lexer/token
0058     //  configurations at compile time.
0059     static lex_input_interface<TokenT> *
0060     new_lexer(IteratorT const &first, IteratorT const &last,
0061         PositionT const &pos, boost::wave::language_support language);
0062 };
0063 
0064 #undef BOOST_WAVE_NEW_LEXER_DECL
0065 
0066 ///////////////////////////////////////////////////////////////////////////////
0067 //
0068 //  The lex_input_interface_generator helps to instantiate a concrete lexer
0069 //  to be used by the Wave preprocessor module.
0070 //  This is done to allow compile time reduction.
0071 //
0072 ///////////////////////////////////////////////////////////////////////////////
0073 
0074 template <typename TokenT>
0075 struct lex_input_interface_generator
0076 :   lex_input_interface<TokenT>
0077 {
0078     typedef typename lex_input_interface<TokenT>::position_type position_type;
0079 
0080     lex_input_interface_generator() {}
0081     ~lex_input_interface_generator() {}
0082 
0083     //  The new_lexer function allows the opaque generation of a new lexer object.
0084     //  It is coupled to the token type to allow to distinguish different
0085     //  lexer/token configurations at compile time.
0086     template <typename IteratorT>
0087     static lex_input_interface<TokenT> *
0088     new_lexer(IteratorT const &first, IteratorT const &last,
0089         position_type const &pos, boost::wave::language_support language)
0090     {
0091         return new_lexer_gen<IteratorT, position_type, TokenT>::new_lexer (
0092             first, last, pos, language);
0093     }
0094 };
0095 
0096 ///////////////////////////////////////////////////////////////////////////////
0097 }   // namespace cpplexer
0098 }   // namespace wave
0099 }   // namespace boost
0100 
0101 #ifdef BOOST_MSVC
0102 #pragma warning(pop)
0103 #endif
0104 
0105 // the suffix header occurs after all of the code
0106 #ifdef BOOST_HAS_ABI_HEADERS
0107 #include BOOST_ABI_SUFFIX
0108 #endif
0109 
0110 #endif // !defined(BOOST_WAVE_LEX_INTERFACE_GENERATOR_HPP_INCLUDED)