how to parse mangled/demangled name into function name, arguments etc.

Jacob Carlborg doob at me.com
Wed Mar 27 00:17:56 PDT 2013


On 2013-03-26 22:17, Timothee Cour wrote:
> demangle D15bootstrap_utils4util15replace_macros2FKHAyaAyaAyaZAya
>
> immutable(char)[] bootstrap_utils.util.replace_macros2(ref
> immutable(char)[][immutable(char)[]], immutable(char)[])
>
> I want to obtain function name, arguments, etc (eg AST as  json output
> would show)
> is there a reliable library solution that works in the potentially
> complex cases where the involved arguments / template arguments are
> relatively complex themselves?

There's core.demangle, but that won't give you an AST and it will 
probably fail in some cases. I would try and modify core.demangle to 
produce an AST instead of a string. Perhaps this old project has 
something useful:

http://flectioned.kuehne.cn/

-- 
/Jacob Carlborg


More information about the Digitalmars-d-learn mailing list