token_primitives.qbk 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. [/==============================================================================
  2. Copyright (C) 2001-2011 Hartmut Kaiser
  3. Copyright (C) 2001-2011 Joel de Guzman
  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. [section:primitives Token definition Primitives]
  8. This module includes different primitives allowing you to create token definitions.
  9. It includes `char_`, character literals, `string`, and string literals.
  10. [heading Module Headers]
  11. // forwards to <boost/spirit/home/lex/primitives.hpp>
  12. #include <boost/spirit/include/lex_primitives.hpp>
  13. Also, see __include_structure__.
  14. [/////////////////////////////////////////////////////////////////////////////]
  15. [section:char_tokendef Tokens Matching Single Characters]
  16. [heading Description]
  17. The character based token definitions described in this section are:
  18. The `char_` creates token definitions matching single characters. The `char_`
  19. token definition is associated `standard` encoding namespace. This is
  20. needed when doing basic operations such as forcing lower or upper case and
  21. dealing with character ranges.
  22. [heading Header]
  23. [heading Module Headers]
  24. // forwards to <boost/spirit/home/lex/lexer/char_token_def.hpp>
  25. #include <boost/spirit/include/lex_char_token_def.hpp>
  26. Also, see __include_structure__.
  27. [heading Namespace]
  28. [table
  29. [[Name]]
  30. [[`lex::char_`]]
  31. ]
  32. [heading Model of]
  33. [:__primitive_lexer_concept__]
  34. [variablelist Notation
  35. [[`ch`] [Character-class specific character from `standard` character
  36. set.]]
  37. ]
  38. [heading Expression Semantics]
  39. Semantics of an expression is defined only where it differs from, or is not
  40. defined in __primitive_lexer_concept__.
  41. [table
  42. [[Expression] [Description]]
  43. [[`ch`] [Create a token definition matching the character
  44. literal `ch`. ]]
  45. [[`lex::char_(ch)`] [Create a token definition matching the character
  46. `ch`.]]
  47. ]
  48. [heading Example]
  49. [endsect] [/ char]
  50. [endsect] [/ Module]