...one of the most highly
regarded and expertly designed C++ library projects in the
world. — Herb Sutter and Andrei
Syntactic predicates assert a certain conditional syntax to be satisfied
before evaluating another production. Similar to semantic predicates,
syntactic predicates do not consume any input. The and-predicate,
is a positive syntactic predicate that returns a zero length match only
if its predicate matches.
// forwards to <boost/spirit/home/qi/operator/and_predicate.hpp> #include <boost/spirit/include/qi_and_predicate.hpp>
Also, see Include Structure.
Semantics of an expression is defined only where it differs from, or
is not defined in
If the predicate
See Compound Attribute Notation.
The complexity is defined by the complexity of the predicate,
The test harness for the example(s) below is presented in the Basics Examples section.
Some using declarations:
Basic look-ahead example: make sure that the last character is a semicolon, but don't consume it, just peek at the next character:
test_phrase_parser("Hello ;", lit("Hello") >> &lit(';'), false);