digitalmars.D.learn - how to parse mangled/demangled name into function name, arguments etc.
- Timothee Cour (9/9) Mar 26 2013 demangle D15bootstrap_utils4util15replace_macros2FKHAyaAyaAyaZAya
- Jacob Carlborg (8/16) Mar 27 2013 There's core.demangle, but that won't give you an AST and it will
- Jacob Carlborg (5/10) Mar 27 2013 I actually started to work on that a couple of years ago. I wonder if I
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? thanks!
Mar 26 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
Mar 27 2013
On 2013-03-27 08:17, Jacob Carlborg wrote: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/I actually started to work on that a couple of years ago. I wonder if I have the code left, somewhere. -- /Jacob Carlborg
Mar 27 2013