...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
The sequentialor operator, a
 b
,
matches a
or b
or a
followed by b
. That is,
if both a
and b
match, it must be in sequence; this
is equivalent to a >>
b
 b
:
a  b  ...
// forwards to <boost/spirit/home/qi/operator/sequential_or.hpp> #include <boost/spirit/include/qi_sequential_or.hpp>
Also, see Include Structure.
Notation
a
,
b
A Parser
Semantics of an expression is defined only where it differs from, or
is not defined in NaryParser
.
Expression 
Semantics 


Match 
See Compound Attribute Notation.
Expression 
Attribute 


a: A, b: B > (a  b): tuple<A, B> a: A, b: Unused > (a  b): A a: Unused, b: B > (a  b): B a: Unused, b: Unused > (a  b): Unused a: A, b: A > (a  b): vector<A> a: vector<A>, b: A > (a  b): vector<A> a: A, b: vector<A> > (a  b): vector<A> a: vector<A>, b: vector<A> > (a  b): vector<A>

The overall complexity of the sequentialor parser is defined by the sum of the complexities of its elements. The complexity of the sequentialor itself is O(N), where N is the number of elements in the sequence.
Note  

The test harness for the example(s) below is presented in the Basics Examples section. 
Some using declarations:
using boost::spirit::qi::int_;
Correctly parsing a number with optional fractional digits:
test_parser("123.456", int_  ('.' >> int_)); // full test_parser("123", int_  ('.' >> int_)); // just the whole number test_parser(".456", int_  ('.' >> int_)); // just the fraction
A naive but incorrect solution would try to do this using optionals (e.g.):
int_ >> ('.' >> int_) // will not match ".456" int_ >> ('.' >> int_) // will not match "123" int_ >> ('.' >> int_) // will match empty strings! Ooops.