• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*=============================================================================
2     Boost.Wave: A Standard compliant C++ preprocessor library
3 
4     Definition of the abstract lexer interface
5 
6     http://www.boost.org/
7 
8     Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
9     Software License, Version 1.0. (See accompanying file
10     LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
11 =============================================================================*/
12 
13 #if !defined(BOOST_CPP_LEX_INTERFACE_HPP_E83F52A4_90AC_4FBE_A9A7_B65F7F94C497_INCLUDED)
14 #define BOOST_CPP_LEX_INTERFACE_HPP_E83F52A4_90AC_4FBE_A9A7_B65F7F94C497_INCLUDED
15 
16 #include <boost/wave/wave_config.hpp>
17 #include <boost/wave/util/file_position.hpp>
18 #include <boost/wave/language_support.hpp>
19 
20 // this must occur after all of the includes and before any code appears
21 #ifdef BOOST_HAS_ABI_HEADERS
22 #include BOOST_ABI_PREFIX
23 #endif
24 
25 // suppress warnings about dependent classes not being exported from the dll
26 #ifdef BOOST_MSVC
27 #pragma warning(push)
28 #pragma warning(disable : 4251 4231 4660)
29 #endif
30 
31 ///////////////////////////////////////////////////////////////////////////////
32 namespace boost {
33 namespace wave {
34 namespace cpplexer {
35 
36 ///////////////////////////////////////////////////////////////////////////////
37 //
38 //  The lex_input_interface decouples the lex_iterator_shim from the actual
39 //  lexer. This is done to allow compile time reduction.
40 //  Thanks to JCAB for having this idea.
41 //
42 ///////////////////////////////////////////////////////////////////////////////
43 
44 template <typename TokenT>
45 struct lex_input_interface
46 {
47     typedef typename TokenT::position_type position_type;
48 
lex_input_interfaceboost::wave::cpplexer::lex_input_interface49     lex_input_interface() {}
~lex_input_interfaceboost::wave::cpplexer::lex_input_interface50     virtual ~lex_input_interface() {}
51 
52     virtual TokenT& get(TokenT&) = 0;
53     virtual void set_position(position_type const &pos) = 0;
54 #if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0
55     virtual bool has_include_guards(std::string& guard_name) const = 0;
56 #endif
57 };
58 
59 ///////////////////////////////////////////////////////////////////////////////
60 }   // namespace cpplexer
61 }   // namespace wave
62 }   // namespace boost
63 
64 #ifdef BOOST_MSVC
65 #pragma warning(pop)
66 #endif
67 
68 // the suffix header occurs after all of the code
69 #ifdef BOOST_HAS_ABI_HEADERS
70 #include BOOST_ABI_SUFFIX
71 #endif
72 
73 #endif // !defined(BOOST_CPP_LEX_INTERFACE_HPP_E83F52A4_90AC_4FBE_A9A7_B65F7F94C497_INCLUDED)
74