scanner.hpp 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*=============================================================================
  2. Boost.Wave: A Standard compliant C++ preprocessor library
  3. http://www.boost.org/
  4. Copyright (c) 2001 Daniel C. Nuffer.
  5. Copyright (c) 2001-2012 Hartmut Kaiser.
  6. Distributed under the Boost Software License, Version 1.0. (See accompanying
  7. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  8. =============================================================================*/
  9. #if !defined(SCANNER_HPP_F4FB01EB_E75C_4537_A146_D34B9895EF37_INCLUDED)
  10. #define SCANNER_HPP_F4FB01EB_E75C_4537_A146_D34B9895EF37_INCLUDED
  11. #include <boost/wave/wave_config.hpp>
  12. #include <boost/wave/cpplexer/re2clex/aq.hpp>
  13. // this must occur after all of the includes and before any code appears
  14. #ifdef BOOST_HAS_ABI_HEADERS
  15. #include BOOST_ABI_PREFIX
  16. #endif
  17. ///////////////////////////////////////////////////////////////////////////////
  18. namespace boost {
  19. namespace wave {
  20. namespace cpplexer {
  21. namespace re2clex {
  22. struct Scanner;
  23. typedef unsigned char uchar;
  24. typedef int (* ReportErrorProc)(struct Scanner const *, int errorcode,
  25. char const *, ...);
  26. typedef struct Scanner {
  27. uchar* first; /* start of input buffer */
  28. uchar* act; /* act position of input buffer */
  29. uchar* last; /* end (one past last char) of input buffer */
  30. uchar* bot; /* beginning of the current buffer */
  31. uchar* top; /* top of the current buffer */
  32. uchar* eof; /* when we read in the last buffer, will point 1 past the
  33. end of the file, otherwise 0 */
  34. uchar* tok; /* points to the beginning of the current token */
  35. uchar* ptr; /* used for YYMARKER - saves backtracking info */
  36. uchar* cur; /* saves the cursor (maybe is redundant with tok?) */
  37. uchar* lim; /* used for YYLIMIT - points to the end of the buffer */
  38. /* (lim == top) except for the last buffer, it points to
  39. the end of the input (lim == eof - 1) */
  40. std::size_t line; /* current line being lex'ed */
  41. std::size_t column; /* current token start column position */
  42. std::size_t curr_column; /* current column position */
  43. ReportErrorProc error_proc; /* must be != 0, this function is called to
  44. report an error */
  45. char const *file_name; /* name of the lex'ed file */
  46. aq_queue eol_offsets;
  47. bool enable_ms_extensions; /* enable MS extensions */
  48. bool act_in_c99_mode; /* lexer works in C99 mode */
  49. bool detect_pp_numbers; /* lexer should prefer to detect pp-numbers */
  50. bool enable_import_keyword; /* recognize import as a keyword */
  51. bool single_line_only; /* don't report missing eol's in C++ comments */
  52. bool act_in_cpp0x_mode; /* lexer works in C++11 mode */
  53. } Scanner;
  54. ///////////////////////////////////////////////////////////////////////////////
  55. } // namespace re2clex
  56. } // namespace cpplexer
  57. } // namespace wave
  58. } // namespace boost
  59. // the suffix header occurs after all of the code
  60. #ifdef BOOST_HAS_ABI_HEADERS
  61. #include BOOST_ABI_SUFFIX
  62. #endif
  63. #endif // !defined(SCANNER_HPP_F4FB01EB_E75C_4537_A146_D34B9895EF37_INCLUDED)