standardsbnfabnf

What does "strict order" of sequence groups mean?


3.5. Sequence Group section says

Elements enclosed in parentheses are treated as a single element, whose contents are strictly ordered. Thus,

    elem (foo / bar) blat

matches (elem foo blat) or (elem bar blat), and

Given exactly one element is allowed what exact payload does the "strictly ordered" part carry?


Solution

  • The sequence group (a b c) is just for grouping the given elements. This is used for repetitions like

    *(a b c)
    

    The entries inside the sequence group must appear in the given order. Then the sequence group itself can appear/match based on other operators (like the * operator above).

    The example shown in 3.5 Sequence Group is only for shown the issue between

    elem (foo / bar) blat
    

    and

    elem foo / bar blat
    

    that the () is needed when you want a matching of elem foo blat or elem bar blat.