C++ compilers mangle names (or signatures rather) because in C++, the same name of a function or variable can be overloaded (e.g. different parameters, different namespace, different template parameters).
Now, we all know and love the c++filt
utility which demangles names (e.g. from standard input) - without using a compiler infrastructure. But can I do the opposite, i.e. mangle the names, without compiling any code?
Assume that I just have the signatures coming in on standard input, one line at a time or whatever is convenient. The input does not contain any macros, or expressions, or any such thing. Unlike in this question, I would like answers that do not involve compiling code, nor using the infrastructure of a compiler to sort-of-compile it.