This should be possible, but as I am a novice with m4, I’m not sure how to go about it, or how to write an algorithm to do so (in m4).
edit:
Just solved it, anyway for future reference, I have a series of characters, they need to be translated to their equivalent ASCII code points, e.g.
ascii(-{COLON}-, -{:}-) => #define TKN_COLON 58
I accomplished this with the following code section
I would greatly appreciate if anyone knows of a better way to do this (e.g. native m4, or more portable shell command).