parser.qbk 860 B

12345678910111213141516171819202122
  1. [#parser]
  2. [section Parser]
  3. A ['parser] is a [link metafunction_class template metafunction class] that
  4. takes the following arguments:
  5. * a suffix of the input text, a [link string `string`]
  6. * a [link source_position source position] describing at which position of the
  7. entire input text the suffix begins at
  8. The function parses a prefix of the input string.
  9. When the parsing is successful, it returns an [link accept `accept`] value.
  10. When there is a parsing error, the parser returns a [link reject `reject`]
  11. value. The [link is_error `is_error`] metafunction can be used to determine
  12. about the result of a parser if it succeeded or failed.
  13. The documentation refers often to the ['result of a parser]. This means that the
  14. parser accepts the input and refers to what [link get_result `get_result`]
  15. returns for the value returned by the parser.
  16. [endsect]