]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/spirit/doc/qi/operator.qbk
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / spirit / doc / qi / operator.qbk
CommitLineData
7c673cae
FG
1[/==============================================================================
2 Copyright (C) 2001-2011 Joel de Guzman
3 Copyright (C) 2001-2011 Hartmut Kaiser
4
5 Distributed under the Boost Software License, Version 1.0. (See accompanying
6 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7===============================================================================/]
8[section:operator Parser Operators]
9
10Operators are used as a means for object composition and embedding.
11Simple parsers may be composed to form composites through operator
12overloading, crafted to approximate the syntax of __peg__ (PEG). An
13expression such as:
14
15 a | b
16
17yields a new parser type which is a composite of its operands, `a` and
18`b`.
19
20This module includes different parsers which get instantiated if one of
21the overloaded operators is used with more primitive parser constructs.
22It includes Alternative (`|`), And-predicate (unary `&`), Difference
23(`-`), Expect (`>`), Kleene star (unary `*`), Lists (`%`), Not-predicate (`!`),
24Optional (unary `-`), Permutation (`^`), Plus (unary
25`+`), Sequence (`>>`), and Sequential-Or (`||`).
26
27[heading Module Header]
28
29 // forwards to <boost/spirit/home/qi/operator.hpp>
30 #include <boost/spirit/include/qi_operator.hpp>
31
32Also, see __include_structure__.
33
34[/------------------------------------------------------------------------------]
35[section:alternative Alternative Parser (`a | b`)]
36
37[heading Description]
38
39The alternative operator, `a | b`, matches one of two or more operands
40(`a`, `b`, ... etc.):
41
42 a | b | ...
43
44Alternative operands are tried one by one on a first-match-wins basis
45starting from the leftmost operand. After a successfully matched
46alternative is found, the parser concludes its search, essentially
47short-circuiting the search for other potentially viable candidates.
48This short-circuiting implicitly gives the highest priority to the
49leftmost alternative.
50
51Short-circuiting is done in the same manner as C or C++'s logical
52expressions; e.g. `if (x < 3 || y < 2)` where, if `x < 3`, the `y < 2`
53test is not done at all. In addition to providing an implicit priority
54rule for alternatives which is necessary, given its non-deterministic
55nature, short-circuiting improves the execution time. If the order of
56your alternatives is logically irrelevant, strive to put the (expected)
57most common choice first for maximum efficiency.
58
59[heading Header]
60
61 // forwards to <boost/spirit/home/qi/operator/alternative.hpp>
62 #include <boost/spirit/include/qi_alternative.hpp>
63
64Also, see __include_structure__.
65
66[heading Model of]
67
68[:__nary_parser_concept__]
69
70[variablelist Notation
71 [[`a`, `b`] [A __parser_concept__]]
72]
73
74[heading Expression Semantics]
75
76Semantics of an expression is defined only where it differs from, or is not
77defined in __nary_parser_concept__.
78
79[table
80 [[Expression] [Semantics]]
81 [[`a | b`] [Match `a` or `b`.]]
82]
83
84[heading Attributes]
85
86See __qi_comp_attr_notation__.
87
88[table
89 [[Expression] [Attribute]]
90 [[`a | b`]
91[``a: A, b: B --> (a | b): variant<A, B>
92a: A, b: Unused --> (a | b): optional<A>
93a: A, b: B, c: Unused --> (a | b | c): optional<variant<A, B> >
94a: Unused, b: B --> (a | b): optional<B>
95a: Unused, b: Unused --> (a | b): Unused
96a: A, b: A --> (a | b): A``]]
97]
98
99[note Alternative parsers do not roll back changes made to the outer attribute
100 because of a failed alternative. If you need to enforce that only the
101 succeeded alternative changes the outer attribute please utilize the
102 directive __qi_hold__`[]`.]
103
104[heading Complexity]
105
106[:The overall complexity of the alternative parser is defined by the sum
107of the complexities of its elements. The complexity of the alternative
108parser itself is O(N), where N is the number of alternatives.]
109
110[heading Example]
111
112[note The test harness for the example(s) below is presented in the
113__qi_basics_examples__ section.]
114
115Some using declarations:
116
117[reference_using_declarations_alternative]
118
119[reference_alternative]
120
121[endsect] [/ Alternative]
122
123[/------------------------------------------------------------------------------]
124[section:and_predicate And-Predicate Parser (`&a`)]
125
126[heading Description]
127
128Syntactic predicates assert a certain conditional syntax to be satisfied
129before evaluating another production. Similar to semantic predicates,
130__qi_eps__, syntactic predicates do not consume any input. The /and-predicate/,
131`&a`, is a positive syntactic predicate that returns a zero
132length match only if its predicate matches.
133
134[heading Header]
135
136 // forwards to <boost/spirit/home/qi/operator/and_predicate.hpp>
137 #include <boost/spirit/include/qi_and_predicate.hpp>
138
139Also, see __include_structure__.
140
141[heading Model of]
142
143[:__unary_parser_concept__]
144
145[variablelist Notation
146 [[`a`] [A __parser_concept__]]
147]
148
149[heading Expression Semantics]
150
151Semantics of an expression is defined only where it differs from, or is
152not defined in __unary_parser_concept__.
153
154[table
155 [[Expression] [Semantics]]
156 [[`&a`] [If the predicate `a` matches, return a zero
157 length match. Otherwise, fail.]]
158]
159
160[heading Attributes]
161
162See __qi_comp_attr_notation__.
163
164[table
165 [[Expression] [Attribute]]
166 [[`&a`] [__unused_type__]]
167]
168
169[heading Complexity]
170
171[:The complexity is defined by the complexity of the predicate, `a`]
172
173[heading Example]
174
175[note The test harness for the example(s) below is presented in the
176__qi_basics_examples__ section.]
177
178[reference_and_predicate]
179
180[endsect] [/ And Predicate]
181
182[/------------------------------------------------------------------------------]
183[section:difference Difference Parser (`a - b`)]
184
185[heading Description]
186
187The difference operator, `a - b`, is a binary operator that matches the
188first (LHS) operand but not the second (RHS). [footnote Unlike classic
189Spirit, with Spirit2, the expression will always fail if the RHS is a
190successful match regardless if the RHS matches less characters. For
191example, the rule `lit("policeman") - "police"` will always fail to
192match. Spirit2 does not count the matching chars while parsing and there
193is no reliable and fast way to check if the LHS matches more than the
194RHS.]
195
196[heading Header]
197
198 // forwards to <boost/spirit/home/qi/operator/difference.hpp>
199 #include <boost/spirit/include/qi_difference.hpp>
200
201Also, see __include_structure__.
202
203[heading Model of]
204
205[:__binary_parser_concept__]
206
207[variablelist Notation
208 [[`a`, `b`] [A __parser_concept__]]
209]
210
211[heading Expression Semantics]
212
213Semantics of an expression is defined only where it differs from, or is
214not defined in __binary_parser_concept__.
215
216[table
217 [[Expression] [Semantics]]
218 [[`a - b`] [Parse `a` but not `b`.]]
219]
220
221[heading Attributes]
222
223See __qi_comp_attr_notation__.
224
225[table
226 [[Expression] [Attribute]]
227 [[`a - b`]
228[``a: A, b: B --> (a - b): A
229a: Unused, b: B --> (a - b): Unused``]]
230]
231
232[heading Complexity]
233
234[:The complexity of the difference parser is defined by the sum of the
235complexities of both operands.]
236
237[heading Example]
238
239[note The test harness for the example(s) below is presented in the
240__qi_basics_examples__ section.]
241
242[reference_difference]
243
244[endsect] [/ Difference]
245
246[/------------------------------------------------------------------------------]
247[section:expect Expectation Parser (`a > b`)]
248
249[heading Description]
250
251There are occasions in which it is expected that the input must match a
252particular parser or the input is invalid. Such cases generally arise
253after matching a portion of a grammar, such that the context is fully
254known. In such a situation, failure to match should result in an
255exception. For example, when parsing an e-mail address, after matching a
256name and "@" there must be a domain name or the address is invalid.
257
258The expectation operator (>) requires that the following parser match
259the input or an exception is emitted. Using on_error(), that exception
260can be handled by calling a handler with the context at which the
261parsing failed can be reported.
262
263By contrast, the follows operator (>>) does not require that the
264following parser match the input, which allows for backtracking or
265simply returning false from the parse() function with no exceptions.
266
267Like the __qi_sequence__, the expectation operator, `a > b`, parses two or
268more operands (`a`, `b`, ... etc.), in sequence:
269
270 a > b > ...
271
272However, while the plain __qi_sequence__ simply returns a no-match
273(returns `false`) when one of the elements fail, the expectation: `>`
274operator throws an __qi_expectation_failure__`<Iter>` when the second or
275succeeding operands (all operands except the first) fail to match.
276
277[heading Header]
278
279 // forwards to <boost/spirit/home/qi/operator/expect.hpp>
280 #include <boost/spirit/include/qi_expect.hpp>
281
282Also, see __include_structure__.
283
284[heading Model of]
285
286[:__nary_parser_concept__]
287
288[variablelist Notation
289 [[`a`, `b`] [A __parser_concept__]]
290 [[`Iter`] [A __fwditer__ type]]
291]
292
293[heading Expectation Failure]
294
295When any operand, except the first, fail to match an
296`expectation_failure<Iter>` is thrown:
297
298 template <typename Iter>
299 struct expectation_failure : std::runtime_error
300 {
301 Iter first; // [first, last) iterator pointing
302 Iter last; // to the error position in the input.
303 __info__ what_; // Information about the nature of the error.
304 };
305
306[heading Expression Semantics]
307
308Semantics of an expression is defined only where it differs from, or is not
309defined in __nary_parser_concept__.
310
311[table
312 [[Expression] [Semantics]]
313 [[`a > b`] [Match `a` followed by `b`. If `a` fails, no-match.
314 If `b` fails, throw an `expectation_failure<Iter>`]]
315]
316
317[heading Attributes]
318
319See __qi_comp_attr_notation__.
320
321[table
322 [[Expression] [Attribute]]
323 [[`a > b`]
324[``a: A, b: B --> (a > b): tuple<A, B>
325a: A, b: Unused --> (a > b): A
326a: Unused, b: B --> (a > b): B
327a: Unused, b: Unused --> (a > b): Unused
328
329a: A, b: A --> (a > b): vector<A>
330a: vector<A>, b: A --> (a > b): vector<A>
331a: A, b: vector<A> --> (a > b): vector<A>
332a: vector<A>, b: vector<A> --> (a > b): vector<A>``]]
333]
334
335[heading Complexity]
336
337[:The overall complexity of the expectation parser is defined by the sum
338of the complexities of its elements. The complexity of the expectation
339operator itself is O(N), where N is the number of elements in the
340sequence.]
341
342[heading Example]
343
344[note The test harness for the example(s) below is presented in the
345__qi_basics_examples__ section.]
346
347Some using declarations:
348
349[reference_using_declarations_expect]
350
351[reference_expect]
352
353[endsect] [/ Expectation]
354
355[/------------------------------------------------------------------------------]
356[section:kleene Kleene Parser (`*a`)]
357
358[heading Description]
359
360The kleene operator, `*a`, is a unary operator that matches its operand
361zero or more times.
362
363[heading Header]
364
365 // forwards to <boost/spirit/home/qi/operator/kleene.hpp>
366 #include <boost/spirit/include/qi_kleene.hpp>
367
368Also, see __include_structure__.
369
370[heading Model of]
371
372[:__unary_parser_concept__]
373
374[variablelist Notation
375 [[`a`] [A __parser_concept__]]
376]
377
378[heading Expression Semantics]
379
380Semantics of an expression is defined only where it differs from, or is not
381defined in __unary_parser_concept__.
382
383[table
384 [[Expression] [Semantics]]
385 [[`*a`] [Match `a` zero or more times.]]
386]
387
388[heading Attributes]
389
390See __qi_comp_attr_notation__.
391
392[table
393 [[Expression] [Attribute]]
394 [[`*a`]
395[``a: A --> *a: vector<A>
396a: Unused --> *a: Unused``]]
397]
398
399[heading Complexity]
400
401[:The overall complexity of the Kleene star is defined by the complexity
402of its subject, `a`, multiplied by the number of repetitions. The
403complexity of the Kleene star itself is O(N), where N is the number
404successful repetitions.]
405
406[heading Example]
407
408[note The test harness for the example(s) below is presented in the
409__qi_basics_examples__ section.]
410
411[reference_kleene]
412
413[endsect] [/ Kleene]
414
415[/------------------------------------------------------------------------------]
416[section:list List Parser (`a % b`)]
417
418[heading Description]
419
420The list operator, `a % b`, is a binary operator that matches a list of
421one or more repetitions of `a` separated by occurrences of `b`. This is
422equivalent to `a >> *(b >> a)`.
423
424[heading Header]
425
426 // forwards to <boost/spirit/home/qi/operator/list.hpp>
427 #include <boost/spirit/include/qi_list.hpp>
428
429Also, see __include_structure__.
430
431[heading Model of]
432
433[:__binary_parser_concept__]
434
435[variablelist Notation
436 [[`a`, `b`] [A __parser_concept__]]
437]
438
439[heading Expression Semantics]
440
441Semantics of an expression is defined only where it differs from, or is
442not defined in __binary_parser_concept__.
443
444[table
445 [[Expression] [Semantics]]
446 [[`a % b`] [Match a list of one or more repetitions of `a`
447 separated by occurrences of `b`. This is equivalent
448 to `a >> *(b >> a)`.]]
449]
450
451[heading Attributes]
452
453See __qi_comp_attr_notation__.
454
455[table
456 [[Expression] [Attribute]]
457 [[`a % b`]
458[``a: A, b: B --> (a % b): vector<A>
459a: Unused, b: B --> (a % b): Unused``]]
460]
461
462[heading Complexity]
463
464[:The overall complexity of the List is defined by the complexity of its
465subject, `a`, multiplied by the number of repetitions. The complexity of
466the List itself is O(N), where N is the number successful repetitions.]
467
468[heading Example]
469
470[note The test harness for the example(s) below is presented in the
471__qi_basics_examples__ section.]
472
473[reference_list]
474
475[endsect] [/ List]
476
477[/------------------------------------------------------------------------------]
478[section:not_predicate Not-Predicate Parser (`!a`)]
479
480[heading Description]
481
482Syntactic predicates assert a certain conditional syntax to be satisfied
483before evaluating another production. Similar to semantic predicates,
484__qi_eps__, syntactic predicates do not consume any input. The /not-predicate/,
485`!a`, is a negative syntactic predicate that returns a zero
486length match only if its predicate fails to match.
487
488[heading Header]
489
490 // forwards to <boost/spirit/home/qi/operator/not_predicate.hpp>
491 #include <boost/spirit/include/qi_not_predicate.hpp>
492
493Also, see __include_structure__.
494
495[heading Model of]
496
497[:__unary_parser_concept__]
498
499[variablelist Notation
500 [[`a`] [A __parser_concept__]]
501]
502
503[heading Expression Semantics]
504
505Semantics of an expression is defined only where it differs from, or is
506not defined in __unary_parser_concept__.
507
508[table
509 [[Expression] [Semantics]]
510 [[`!a`] [If the predicate `a` matches, fail. Otherwise,
511 return a zero length match.]]
512]
513
514[heading Attributes]
515
516See __qi_comp_attr_notation__.
517
518[table
519 [[Expression] [Attribute]]
520 [[`!a`] [__unused_type__]]
521]
522
523[heading Complexity]
524
525[:The complexity is defined by the complexity of the predicate, `a`]
526
527[heading Example]
528
529[note The test harness for the example(s) below is presented in the
530__qi_basics_examples__ section.]
531
532[reference_not_predicate]
533
534[endsect] [/ Not Predicate]
535
536[/------------------------------------------------------------------------------]
537[section:optional Optional Parser (`-a`)]
538
539[heading Description]
540
541The optional operator, `-a`, is a unary operator that matches its
542operand zero or one time.
543
544[heading Header]
545
546 // forwards to <boost/spirit/home/qi/operator/optional.hpp>
547 #include <boost/spirit/include/qi_optional.hpp>
548
549Also, see __include_structure__.
550
551[heading Model of]
552
553[:__unary_parser_concept__]
554
555[variablelist Notation
556 [[`a`] [A __parser_concept__]]
557]
558
559[heading Expression Semantics]
560
561Semantics of an expression is defined only where it differs from, or is not
562defined in __unary_parser_concept__.
563
564[table
565 [[Expression] [Semantics]]
566 [[`-a`] [Match `a` zero or one time.]]
567]
568
569[heading Attributes]
570
571See __qi_comp_attr_notation__.
572
573[table
574 [[Expression] [Attribute]]
575 [[`-a`]
576[``a: A --> -a: optional<A>
577a: Unused --> -a: Unused``]]
578]
579
580[heading Complexity]
581
582[:The complexity is defined by the complexity of the operand, `a`]
583
584[heading Example]
585
586[note The test harness for the example(s) below is presented in the
587__qi_basics_examples__ section.]
588
589[reference_optional]
590
591[endsect] [/ Optional]
592
593[/------------------------------------------------------------------------------]
594[section:permutation Permutation Parser (`a ^ b`)]
595
596[heading Description]
597
598The permutation operator, `a ^ b`, matches one or more operands (`a`, `b`,
599... etc.) in any order:
600
601 a ^ b ^ ...
602
603The operands are the elements in the permutation set. Each element in
604the permutation set may occur at most once, but not all elements of the
605given set need to be present. Note that by this definition, the
606permutation operator is not limited to strict permutations.
607
608For example:
609
610 char_('a') ^ 'b' ^ 'c'
611
612matches:
613
614 "a", "ab", "abc", "cba", "bca" ... etc.
615
616[heading Header]
617
618 // forwards to <boost/spirit/home/qi/operator/permutation.hpp>
619 #include <boost/spirit/include/qi_permutation.hpp>
620
621Also, see __include_structure__.
622
623[heading Model of]
624
625[:__nary_parser_concept__]
626
627[variablelist Notation
628 [[`a`, `b`] [A __parser_concept__]]
629]
630
631[heading Expression Semantics]
632
633Semantics of an expression is defined only where it differs from, or is not
634defined in __nary_parser_concept__.
635
636[table
637 [[Expression] [Semantics]]
638 [[`a ^ b`] [Match `a` or `b` in any order. Each operand
639 may match zero or one time as long as at least
640 one operand matches.]]
641]
642
643[heading Attributes]
644
645See __qi_comp_attr_notation__.
646
647[table
648 [[Expression] [Attribute]]
649 [[`a ^ b`]
650[``a: A, b: B --> (a ^ b): tuple<optional<A>, optional<B> >
651a: A, b: Unused --> (a ^ b): optional<A>
652a: Unused, b: B --> (a ^ b): optional<B>
653a: Unused, b: Unused --> (a ^ b): Unused``]]
654]
655
656[heading Complexity]
657
658[:The overall complexity of the permutation parser is defined by the sum
659of the complexities of its elements, s, multiplied by log s. The
660complexity of the permutation parser itself is O(N log N), where N is
661the number of elements.]
662
663[heading Example]
664
665[note The test harness for the example(s) below is presented in the
666__qi_basics_examples__ section.]
667
668Some using declarations:
669
670[reference_using_declarations_permutation]
671
672[reference_permutation]
673
674[endsect] [/ Permutation]
675
676[/------------------------------------------------------------------------------]
677[section:plus Plus Parser (`+a`)]
678
679[heading Description]
680
681The plus operator, `+a`, is a unary operator that matches its operand one
682or more times.
683
684[heading Header]
685
686 // forwards to <boost/spirit/home/qi/operator/plus.hpp>
687 #include <boost/spirit/include/qi_plus.hpp>
688
689Also, see __include_structure__.
690
691[heading Model of]
692
693[:__unary_parser_concept__]
694
695[variablelist Notation
696 [[`a`] [A __parser_concept__]]
697]
698
699[heading Expression Semantics]
700
701Semantics of an expression is defined only where it differs from, or is not
702defined in __unary_parser_concept__.
703
704[table
705 [[Expression] [Semantics]]
706 [[`+a`] [Match `a` one or more times.]]
707]
708
709[heading Attributes]
710
711See __qi_comp_attr_notation__.
712
713[table
714 [[Expression] [Attribute]]
715 [[`+a`]
716[``a: A --> +a: vector<A>
717a: Unused --> +a: Unused``]]
718]
719
720[heading Complexity]
721
722[:The overall complexity of the Plus is defined by the complexity of its
723subject, `a`, multiplied by the number of repetitions. The complexity of
724the Plus itself is O(N), where N is the number successful repetitions.]
725
726[heading Example]
727
728[note The test harness for the example(s) below is presented in the
729__qi_basics_examples__ section.]
730
731[reference_plus]
732
733[endsect] [/ Plus]
734
735[/------------------------------------------------------------------------------]
736[section:sequence Sequence Parser (`a >> b`)]
737
738[heading Description]
739
740The sequence operator, `a >> b`, parses two or more operands (`a`,
741`b`, ... etc.), in sequence:
742
743 a >> b >> ...
744
745[heading Header]
746
747 // forwards to <boost/spirit/home/qi/operator/sequence.hpp>
748 #include <boost/spirit/include/qi_sequence.hpp>
749
750Also, see __include_structure__.
751
752[heading Model of]
753
754[:__nary_parser_concept__]
755
756[variablelist Notation
757 [[`a`, `b`] [A __parser_concept__]]
758]
759
760[heading Expression Semantics]
761
762Semantics of an expression is defined only where it differs from, or is not
763defined in __nary_parser_concept__.
764
765[table
766 [[Expression] [Semantics]]
767 [[`a >> b`] [Match `a` followed by `b`.]]
768]
769
770[heading Attributes]
771
772See __qi_comp_attr_notation__.
773
774[table
775 [[Expression] [Attribute]]
776 [[`a >> b`]
777[``a: A, b: B --> (a >> b): tuple<A, B>
778a: A, b: Unused --> (a >> b): A
779a: Unused, b: B --> (a >> b): B
780a: Unused, b: Unused --> (a >> b): Unused
781
782a: A, b: A --> (a >> b): vector<A>
783a: vector<A>, b: A --> (a >> b): vector<A>
784a: A, b: vector<A> --> (a >> b): vector<A>
785a: vector<A>, b: vector<A> --> (a >> b): vector<A>``]]
786]
787
788[heading Complexity]
789
790[:The overall complexity of the sequence parser is defined by the sum of
791the complexities of its elements. The complexity of the sequence itself
792is O(N), where N is the number of elements in the sequence.]
793
794[heading Example]
795
796Some using declarations:
797
798[reference_using_declarations_sequence]
799
800[note The test harness for the example(s) below is presented in the
801__qi_basics_examples__ section.]
802
803[reference_sequence]
804
805[endsect] [/ Sequence]
806
807[/------------------------------------------------------------------------------]
808[section:sequential_or Sequential Or Parser (`a || b`)]
809
810[heading Description]
811
812The sequential-or operator, `a || b`, matches `a` or `b` or `a` followed
813by `b`. That is, if both `a` and `b` match, it must be in sequence; this
814is equivalent to `a >> -b | b`:
815
816 a || b || ...
817
818[heading Header]
819
820 // forwards to <boost/spirit/home/qi/operator/sequential_or.hpp>
821 #include <boost/spirit/include/qi_sequential_or.hpp>
822
823Also, see __include_structure__.
824
825[heading Model of]
826
827[:__nary_parser_concept__]
828
829[variablelist Notation
830 [[`a`, `b`] [A __parser_concept__]]
831]
832
833[heading Expression Semantics]
834
835Semantics of an expression is defined only where it differs from, or is not
836defined in __nary_parser_concept__.
837
838[table
839 [[Expression] [Semantics]]
840 [[`a || b`] [Match `a` or `b` in sequence. equivalent to `a >> -b | b`]]
841]
842
843[heading Attributes]
844
845See __qi_comp_attr_notation__.
846
847[table
848 [[Expression] [Attribute]]
849 [[`a || b`]
850[``a: A, b: B --> (a || b): tuple<optional<A>, optional<B> >
851a: A, b: Unused --> (a || b): optional<A>
852a: Unused, b: B --> (a || b): optional<B>
853a: Unused, b: Unused --> (a || b): Unused
854
855a: A, b: A --> (a || b): vector<optional<A> >``]]
856]
857
858[note The sequential-or parser behaves attribute-wise very similar to the
859 plain sequence parser (`a >> b`) in the sense that it exposes the
860 attributes of its elements separately. For instance, if you attach a
861 semantic action to the whole sequential-or:
862 ``
863 (int_ || int_)[print_pair(_1, _2)]
864 ``
865 the function object `print_pair` would be invoked with the
866 attribute of the first `int_` (`boost::optional<int>`) as its first
867 parameter and the attribute of the second `int_` (`boost::optional<int>`
868 as well) as its second parameter.]
869
870[heading Complexity]
871
872[:The overall complexity of the sequential-or parser is defined by the
873sum of the complexities of its elements. The complexity of the
874sequential-or itself is O(N), where N is the number of elements in the
875sequence.]
876
877[heading Example]
878
879[note The test harness for the example(s) below is presented in the
880__qi_basics_examples__ section.]
881
882Some using declarations:
883
884[reference_using_declarations_sequential_or]
885
886[reference_sequential_or]
887
888[endsect] [/ Sequential Or]
889
890[endsect]