config.hpp 2.2 KB

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