boost::spirit快速参考

来源:互联网 发布:淘宝诈骗报警能找回 编辑:程序博客网 时间:2024/05/29 12:17
简单C++boost中文手册目录
 Quick Reference 快速参考
 

This isn't intended to be a full, detailed reference; nor is it intended to be of any use to readers who aren't already familiar with Spirit. It's just a brief reminder of the syntax and behaviour of each component, with links to the full documentation.
本章的目的不是给出一个完整、详尽的参考手册;也不是给那些对Spirit还不熟悉的读者使用的。它只是对语法及各个组件行为的简要提醒,以及到完整文档的链接。

  • Primitive parser generators (action arguments are listed on the right) 基本分析器生成器(动作参数在右侧列出)
    • Null parsers 空分析器
    • Character parsers 字符分析器
    • Number parsers 数字分析器
    • Other lexeme parsers 其它词位分析器
    • Text parsers 文本分析器

  • Other parser elements 其它分析器元素
    • Compound parsers 复合分析器
    • General directives 通用指示符
    • Tree-specific directives 树专用的指示符

  • Operators 操作符
    • Unary operators 单参操作符
    • Binary operators (in order of precedence)二元操作符(按优先级顺序排)
Null parsers 空分析器end_pMatches EOF
匹配EOFiter,itereps_p
eps_p(P)
Matches without consuming text
匹配且不消耗文本iter,iterepsilon_p
epsilon_p(P)
Synonym for eps_p
eps_p
的同义词iter,iternothing_pAlways fails
总是匹配失败iter,iterCharacter parsers 字符分析器alnum_pMatches any alphanumeric character
匹配任意字母和数字charalpha_pMatches any letter
匹配任意字母charanychar_pMatches any character
匹配任意字符charblank_pMatches a space or tab
匹配一个空格或制表符charch_p(char)Matches a character
匹配一个字符charchset_p(charset)Matches a character in the set
匹配字符集中的某个字符charcntrl_pMatches any control character
匹配任意控制字符chardigit_pMatches any digit
匹配任意数字charf_ch_p(func)Matches a character
匹配一个字符charf_range_p(func1, func2)Matches any character in the inclusive range
匹配闭区间内的任意字符chargraph_pMatches any non-space printable character
匹配任意非空可打印字符charlower_pMatches any lower-case letter
匹配任意小写字母charprint_pMatches any printable character
匹配任意可打印字符charpunct_pMatches any punctuation mark
匹配任意标点符号charrange_p(char1, char2)Matches any character in the inclusive range
匹配闭区间内的任意字符charsign_pMatches a plus or minus sign
匹配正号或负号boolspace_pMatches any whitespace character
匹配任意空白字符charupper_pMatches any upper-case letter
匹配任意大写字母charxdigit_pMatches any hexadecimal digit
匹配任意十六进制数字charNumber parsers 数字分析器bin_pMatches an unsigned binary integer
匹配一个无符号二进制整数numerichex_pMatches an unsigned hexadecimal integer
匹配一个无符号十六进制整数numericint_pMatches a signed decimal integer
匹配一个有符号十进制整数numericint_parser<type, base, min, max>Matches a signed integer with min to max digits
匹配 minmax 间的有符号整数numericoct_pMatches an unsigned octal integer
匹配一个无符号八进制整数numericreal_pMatches a floating point number
匹配一个浮点数numericreal_parser<type, policy>Matches a floating point number
匹配一个浮点数numericstrict_real_pMatches a floating point number (requires decimal point)
匹配一个浮点数(要求小数点)numericstrict_ureal_pMatches an unsigned FP number (requires decimal point)
匹配一个无符号浮点数(要求小数点)numericuint_pMatches an unsigned decimal integernumericuint_parser<type, base, min, max>Matches an unsigned integer with min to max digits
匹配 minmax 间的无符号整数numericureal_pMatches an unsigned FP number
匹配一个无符号浮点数numericOther lexeme parsers 其它词位分析器c_escape_ch_pMatches a C escape code
匹配一个C的转义代码charcomment_p(string)
comment_p (string1, string2)
Matches C++ or C-style comments
匹配C++或C风格的注释iter,itereol_pMatches CR, LF, or any combination
匹配 CR, LF 或其任意组合iter,iterf_str_p(func1, func2)Matches a string
匹配一个字符串iter,iterlex_escape_ch_pMatches a C escape code or any backslash escape
匹配一个C的转义代码或任意反斜杠转义charregex_p(regex)Matches a regular expression
匹配一个正则表达式iter,iterstr_p(string)
str_p(iter1, iter2)
Matches a string
匹配一个字符串iter,iterText parsers 文本分析器chseq_p(string)
chseq_p(iter1, iter2)
Matches a string, possibly with embedded whitespace
匹配一个字符串,可以带有内嵌的空白iter,iterf_chseq_p(func1, func2)Matches a string, possibly with embedded whitespace
匹配一个字符串,可以带有内嵌的空白iter,iter Compound parsers 复合分析器confix_p(open, exp, close)Matches open >> (exp - close) >> close
匹配 open >> (exp - close) >> closedo_p[P].while_p(cond)Matches while a condition is true (at least once)
当条件为真时匹配(至少一次)for_p(init, cond, step)[P]