Re: x3 semantic action and attribute transformation

Seth <[email protected]>
Newsgroups gmane.comp.parsers.spirit.general
Message-ID <[email protected]>
On 08-03-17 10:35, Olaf Peter wrote:
> BTW, why the syntax :
>     auto const integer_def = integer %=
> is there a better one?

Yes, use the third argument to the rule:

   19     typedef x3::rule<struct integer_class, uint, true>
integer_type;                                                                                               


I think your sample is a bit complicated. I'd suggest something like:
http://coliru.stacked-crooked.com/a/df8986cf07f77146

You could do the overflow check by checking each iteration in the loop
makes `r` bigger. If it wraps around there was an overflow.

------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
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.