17. Boost Spirit の rule Directive (修飾:Parser の挙動を変える) etc. p の N 回の繰り返し repeat(N)[p] p 内部で大文字、小文字を区別しない no_case[p] p の N 回以上の繰り返し repeat(N,inf)[p] p の N ~ M 回の繰り返し repeat(N,M)[p] p 先頭で空白をスキップ、 p 内部では空白をスキップしない lexeme[p]
18. Boost Spirit の rule Operator (結合) etc. p が 0 or 1 回 -a b でない a a - b p の 0 回以上の繰り返し *a 選択( a あるいは b ) a | b b で区切られた a の繰り返し a % b p の 1 回以上の繰り返し +a 連接(普通に繋げる) a >> b
28. 拡張性 Spirit (の変態性)を支える重要な要素 後から拡張できるような仕掛けがしてある Proto を使っているので自前のコンポーネント(Parser等)を作成できる ->Directive の自作 処理にフックが用意してある ->Customization point
29. Boost Spirit の rule (再掲) Directive (修飾:Parser の挙動を変える) etc. p の N 回の繰り返し repeat(N)[p] p 内部で大文字、小文字を区別しない no_case[p] p の N 回以上の繰り返し repeat(N,inf)[p] p の N ~ M 回の繰り返し repeat(N,M)[p] p 先頭で空白をスキップ、 p 内部では空白をスキップしない lexeme[p]
52. ケース 1. static_assert エラーメッセージ spirit7.cpp:30: instantiated from here /usr/local/include/boost/spirit/home/qi/nonterminal/grammar.hpp:75: error: no matching function for call to ‘assertion_failed( mpl_::failed************ (boost::spirit::qi::grammar<Iterator, T1, T2, T3, T4>::grammar(const boost::spirit::qi::rule<Iterator_, T1_, T2_, T3_, T4_>&, const std::string&) [ 何か一杯 ]:: incompatible_start_rule::************ )( 何か一杯 ))’ Spirit Qi とうまく付き合うために
53. ケース 2. コメント エラーメッセージ spirit7.cpp:39: instantiated from here /usr/local/include/boost/spirit/home/qi/nonterminal/rule.hpp:277: error: no match for call to ‘ 何か一杯’ /usr/local/include/boost/spirit/home/qi/nonterminal/rule.hpp // If you are seeing a compilation error here stating that the // forth parameter can't be converted to a required target type // then you are probably trying to use a rule or a grammar with // an incompatible skipper type. if (f(first, last, context, skipper)) Spirit Qi とうまく付き合うために 277 行目