Thread overview | |||||
---|---|---|---|---|---|
|
March 26, 2013 how to parse mangled/demangled name into function name, arguments etc. | ||||
---|---|---|---|---|
| ||||
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! |
March 27, 2013 Re: how to parse mangled/demangled name into function name, arguments etc. | ||||
---|---|---|---|---|
| ||||
Posted in reply to Timothee Cour | 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 |
March 27, 2013 Re: how to parse mangled/demangled name into function name, arguments etc. | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jacob Carlborg | 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 |
Copyright © 1999-2021 by the D Language Foundation