Strength of sequence vs alternative parsers

Michael Powell <[email protected]>
Newsgroups gmane.comp.parsers.spirit.general
Message-ID <CAMEoF_Gr5rB42fbehsSVg1J3TdbW+H7hBRHGnyVOikcQjcBdMg@mail.gmail.com>
Hello,

Am I correct in observing that the Sequence parser (>>) is stronger
than the alternative parser (|)?

i.e.

my_rule = a >> b >> c | d >> e >> f ;

So, in other words, parenthesis are unnecessary, per se?

my_rule = ( a >> b >> c ) | ( d >> e >> f ) ;

Unless those groupings require additional operators, like Optional
(-), let's say.

my_rule = ( a >> b >> c ) | ( d >> -( e >> f ) ) ;

Thanks!

Cheers,

Michael Powell

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.