Hey folks!
I am diving into boost::spirit in order to parse a ASCII-based protocoll. I mananged to extract values from the line using rules like this:
rule<> Speed = uint_parser<unsigned int,10,3,3>()[assign_a(buffer.speed)];
I also succeed to connect these rules in a meaningful manner. What is missing for a perfect day is the following: The data values are integers that need to be transformed to floating point values using a fixed conversion factor (usually powers of 10).
What I do right now is just appying these scalings factors after parsing. However I would really apprechiate to include the scaling factor just inside the rule definition for the field. I imagine something like this:
rule<> Speed = uint_parser<unsigned int,10,3,3>()[assign_a(buffer.speed,100)];
Any suggestions?
Thanks in advance Arne