[spirit] need advise for parsing a set of integer alternatives
28 Feb
2010
28 Feb
'10
7:48 a.m.
say I am parsing a message in this format: 2-byte message length + 2-byte instruction code + message body, where the 2-byte instruction code is a predefined set of constants, e.g. 0x01, 0x01234 etc. I could use this parser: short_>>short_>>*char_. and resort to the attributes of short_in a post-check to check whether the instruction code is legal or not . what if I want to embed the legal instruction code set in the parser itself, and determine whether this is a legal message at one go? .i.e. short_>>(what to put here)>>*char? Thanks.
5369
Age (days ago)
5369
Last active (days ago)
0 comments
1 participants
participants (1)
-
Zhi Tan