1 /*=============================================================================
2 Boost.Wave: A Standard compliant C++ preprocessor library
4 Definition of the abstract lexer interface
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 =============================================================================*/
13 #if !defined(CPP_LEX_INTERFACE_HPP_E83F52A4_90AC_4FBE_A9A7_B65F7F94C497_INCLUDED)
14 #define CPP_LEX_INTERFACE_HPP_E83F52A4_90AC_4FBE_A9A7_B65F7F94C497_INCLUDED
16 #include <boost/wave/wave_config.hpp>
17 #include <boost/wave/util/file_position.hpp>
18 #include <boost/wave/language_support.hpp>
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
25 // suppress warnings about dependent classes not being exported from the dll
28 #pragma warning(disable : 4251 4231 4660)
31 ///////////////////////////////////////////////////////////////////////////////
36 ///////////////////////////////////////////////////////////////////////////////
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.
42 ///////////////////////////////////////////////////////////////////////////////
44 template <typename TokenT>
45 struct lex_input_interface
47 typedef typename TokenT::position_type position_type;
49 lex_input_interface() {}
50 virtual ~lex_input_interface() {}
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;
59 ///////////////////////////////////////////////////////////////////////////////
60 } // namespace cpplexer
68 // the suffix header occurs after all of the code
69 #ifdef BOOST_HAS_ABI_HEADERS
70 #include BOOST_ABI_SUFFIX
73 #endif // !defined(CPP_LEX_INTERFACE_HPP_E83F52A4_90AC_4FBE_A9A7_B65F7F94C497_INCLUDED)