0

I use uint_parser to parse at most 2 consecutive digits. However I would like parsing to fail if the parsed integer is outside of the range [1,31]? For now, I take care of that in the semantic action.

Are there recommendations re detecting errors at parsing level vs at semantic action user code level?

MMM
  • 910
  • 1
  • 9
  • 25
  • Btw, I will try to use _pass = false inside the semantic action to indicate parse failure when the number parsed is outside the desired range – MMM Sep 23 '14 at 11:50
  • Another alternative is to explicitly parse with char_. Ie, char_(0) followed by char_('1','9') or char_('1','2') followed by char_('0','9') or char_('3') followed by char_('0','1') or char_('1','9') – MMM Sep 24 '14 at 11:12

0 Answers0