|
|
| Syntactic Confectionery Delight | |
| PerlMonks |
Re^2: Looking for ideas: Converting a binary 'flags' field into something human readableby locked_user sundialsvc4 (Abbot) |
| on Jul 09, 2015 at 00:47 UTC ( [id://1133847]=note: print w/replies, xml ) | Need Help?? |
|
That seems to me to be a “at least fairly genius” suggestion: to encode the value as the bit-field which it is, but then to document the meaning of the field to the human reader. (The computer wouldn’t care.) Promptly upvoted. The parser-grammar could fairly easily be made to include a descriptor that, one way or another, maps to a (hard-coded) Perl subroutine within the parser ... which generates the comment-entries to describe the field. (Personally, I think I’d do it as a table, including the starting byte/bit number, the number of bits, and the interpretation. “ASCII Art” could be unmanageable.)
In Section
Seekers of Perl Wisdom
|
|