parsing.qbk
来自「Boost provides free peer-reviewed portab」· QBK 代码 · 共 49 行
QBK
49 行
[/============================================================================== Copyright (C) 2001-2008 Joel de Guzman Copyright (C) 2001-2008 Hartmut Kaiser Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)===============================================================================/][section Parsing]Central to the library is the parser. The parser does the actualwork of recognizing a linear input stream of data read sequentiallyfrom start to end by the supplied iterators. The parser attempts tomatch the input following a well-defined set of specifications knownas grammar rules. The parser returns a `bool` to report the success orfailure. When successful, the parser calls a client-supplied semanticaction, if there is one. The semantic action extracts structuralinformation depending on the data passed by the parser and thehierarchical context of the parser it is attached to.Parsers come in different flavors. The Spirit library comes bundled with an extensive set of pre-defined parsers that perform various parsing tasks from the trivial to the complex. The parser, as a concept, has a public conceptual interface contract. Following the contract, anyone can write a conforming parser that will play along well with the library's predefined components. We shall provide a blueprint detailing the conceptual interface of the parser later.Clients of the library generally do not need to write their own hand-coded parsers at all. Spirit has an immense repertoire of pre-defined parsers covering all aspects of syntax and semantic analysis. We shall examine this repertoire of parsers in the following sections. In the rare case where a specific functionality is not available, it is extremely easy to write a user-defined parser. The ease in writing a parser entity is the main reason for Spirit's extensibility.[heading The API functions exposed by __qi__ ][heading The parse() function][heading The phrase_parse() function][heading The tokenize_and_parse() function][heading The tokenize_and_phrase_parse() function][endsect]
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?