1 /*============================================================================= 2 Copyright (c) 2001-2011 Hartmut Kaiser 3 4 Distributed under the Boost Software License, Version 1.0. (See accompanying 5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 =============================================================================*/ 7 #if !defined(BOOST_SPIRIT_CONJURE_LEXER_CONFIG_HPP) 8 #define BOOST_SPIRIT_CONJURE_LEXER_CONFIG_HPP 9 10 /////////////////////////////////////////////////////////////////////////////// 11 // The conjure lexer example can be built in 3 different variations: 12 // 13 // - With a lexer using runtime generated DFA tables 14 // - With a lexer using pre-generated (static) DFA tables 15 // - With a lexer using a pre-generated custom switch based state machine 16 // 17 // Use one of the following preprocessor constants to define, which of those 18 // will be built: 19 20 /////////////////////////////////////////////////////////////////////////////// 21 // Use the lexer based on runtime generated DFA tables 22 // #define CONJURE_LEXER_DYNAMIC_TABLES 1 23 24 /////////////////////////////////////////////////////////////////////////////// 25 // Use the lexer based on pre-generated static DFA tables 26 // #define CONJURE_LEXER_STATIC_TABLES 1 27 28 /////////////////////////////////////////////////////////////////////////////// 29 // Use the lexer based on runtime generated DFA tables 30 // #define CONJURE_LEXER_STATIC_SWITCH 1 31 32 /////////////////////////////////////////////////////////////////////////////// 33 // The default is to use the dynamic table driven lexer 34 #if CONJURE_LEXER_DYNAMIC_TABLES == 0 && \ 35 CONJURE_LEXER_STATIC_TABLES == 0 && \ 36 CONJURE_LEXER_STATIC_SWITCH == 0 37 38 #define CONJURE_LEXER_DYNAMIC_TABLES 1 39 #endif 40 41 /////////////////////////////////////////////////////////////////////////////// 42 // Make sure we have only one lexer type selected 43 #if (CONJURE_LEXER_DYNAMIC_TABLES != 0 && CONJURE_LEXER_STATIC_TABLES != 0) || \ 44 (CONJURE_LEXER_DYNAMIC_TABLES != 0 && CONJURE_LEXER_STATIC_SWITCH != 0) || \ 45 (CONJURE_LEXER_STATIC_TABLES != 0 && CONJURE_LEXER_STATIC_SWITCH != 0) 46 47 #error "Configuration problem: please select exactly one type of lexer to build" 48 #endif 49 50 #endif 51 52