[Qi] Phrase parsed but iterator did not reach end
Michael Powell <[email protected]>
| Newsgroups | gmane.comp.parsers.spirit.general |
|---|---|
| Message-ID | <CAMEoF_Er_jSZ_OC3yDQumKPWN6WmOGpKJokjpAieJ081ipZTWA@mail.gmail.com> |
Hello,
Or the iterator backtracked?
Is it possible for a phrase to parse (returns true), but the iterator
does not reach the end, or was backtracked?
Depending on the rule, of course. For which I currently have:
boost::spirit::qi::rule<Iterator> _port_rule;
_port_rule = digit
| (char_('1', '5') >> repeat(1, 4)[digit])
| (char_('7', '9') >> repeat(1, 3)[digit])
| (char_('6')
>> ((char_('0', '4') >> repeat(0, 3)[digit])
| (char_('6', '9') >> repeat(0, 2)[digit])
| (char_('5')
>> ((char_('0', '4') >> repeat(0, 2)[digit])
| (char_('6', '9') >> -digit)
| (char_('5')
>> ((char_('0', '2') >> -digit)
| char_('4', '9')
| (char_('3') >> char_('0', '5'))
)
)
)
)
)
)
;
Where Iterator is a Struct Template argument.
Basically to validate all the patterns from 0-65535 (valid port range).
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