itanium-demangler


Nameitanium-demangler JSON
Version 1.1 PyPI version JSON
download
home_pagehttps://github.com/whitequark/python-itanium_demangler
SummaryPure Python parser for mangled itanium symbols
upload_time2022-08-20 14:32:54
maintainer
docs_urlNone
authorwhitequark
requires_python
licenseBSD
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Itanium Demangler

The *Python Itanium Demangler* is a pure Python parser for the [Itanium C++ ABI symbol mangling language][manglang]. Note that MSVC mangling language is not supported.

This demangler generates an abstract syntax tree from mangled symbols, which can be used for directly extracting type information, as opposed to having to interpret the C++ source code corresponding to the demangled symbol

 There is also a built-in AST stringifier, so the demangler can be used as a replacement for `c++filt` or for formatting backtraces.

[manglang]: https://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangling

## Requirements

The demangler runs on Python 2.7 and 3.3+ and has no dependencies.

## Installation

Installing via PyPI:

    pip install itanium_demangler

Using a local repository for development:

    git clone https://github.com/whitequark/python-itanium_demangler
    cd python-itanium_demangler
    python setup.py develop --user

## Usage

```python
from itanium_demangler import parse as demangle

ast = demangle("_ZN5boost6chrono24process_system_cpu_clock3nowEv")

print(repr(ast))
# <FuncNode func <Node qual_name (<Node name 'boost'>, <Node name 'chrono'>, <Node name 'process_system_cpu_clock'>, <Node name 'now'>)> (<Node builtin 'void'>,) None>

print(ast)
# boost::chrono::process_system_cpu_clock::now()
```

## Future considerations

A similar (i.e. also parsing to an AST) implementation of a demangler for the MSVC mangling language would be useful to have.

## License

[0-clause BSD](LICENSE-0BSD.txt)



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/whitequark/python-itanium_demangler",
    "name": "itanium-demangler",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "whitequark",
    "author_email": "whitequark@whitequark.org",
    "download_url": "",
    "platform": null,
    "description": "# Itanium Demangler\n\nThe *Python Itanium Demangler* is a pure Python parser for the [Itanium C++ ABI symbol mangling language][manglang]. Note that MSVC mangling language is not supported.\n\nThis demangler generates an abstract syntax tree from mangled symbols, which can be used for directly extracting type information, as opposed to having to interpret the C++ source code corresponding to the demangled symbol\n\n There is also a built-in AST stringifier, so the demangler can be used as a replacement for `c++filt` or for formatting backtraces.\n\n[manglang]: https://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangling\n\n## Requirements\n\nThe demangler runs on Python 2.7 and 3.3+ and has no dependencies.\n\n## Installation\n\nInstalling via PyPI:\n\n    pip install itanium_demangler\n\nUsing a local repository for development:\n\n    git clone https://github.com/whitequark/python-itanium_demangler\n    cd python-itanium_demangler\n    python setup.py develop --user\n\n## Usage\n\n```python\nfrom itanium_demangler import parse as demangle\n\nast = demangle(\"_ZN5boost6chrono24process_system_cpu_clock3nowEv\")\n\nprint(repr(ast))\n# <FuncNode func <Node qual_name (<Node name 'boost'>, <Node name 'chrono'>, <Node name 'process_system_cpu_clock'>, <Node name 'now'>)> (<Node builtin 'void'>,) None>\n\nprint(ast)\n# boost::chrono::process_system_cpu_clock::now()\n```\n\n## Future considerations\n\nA similar (i.e. also parsing to an AST) implementation of a demangler for the MSVC mangling language would be useful to have.\n\n## License\n\n[0-clause BSD](LICENSE-0BSD.txt)\n\n\n",
    "bugtrack_url": null,
    "license": "BSD",
    "summary": "Pure Python parser for mangled itanium symbols",
    "version": "1.1",
    "project_urls": {
        "Homepage": "https://github.com/whitequark/python-itanium_demangler"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "780dfba3dcefcfcbc9da4e97e55427a5a739e920430ac53d770d98b7a5203500",
                "md5": "07fce95a59a5f5d05e1c1b9212e3e6fc",
                "sha256": "5bc2ba4d2f2e3e3b8aa201e4384433fd09a57f512a7717ca3849f93ee34f8189"
            },
            "downloads": -1,
            "filename": "itanium_demangler-1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "07fce95a59a5f5d05e1c1b9212e3e6fc",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 8827,
            "upload_time": "2022-08-20T14:32:54",
            "upload_time_iso_8601": "2022-08-20T14:32:54.134626Z",
            "url": "https://files.pythonhosted.org/packages/78/0d/fba3dcefcfcbc9da4e97e55427a5a739e920430ac53d770d98b7a5203500/itanium_demangler-1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-08-20 14:32:54",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "whitequark",
    "github_project": "python-itanium_demangler",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "itanium-demangler"
}
        
Elapsed time: 0.08064s