pysemco provides tools to tokenize source code in C++, Python, and x86-64 assembly in Intel syntax using Pygments for basic tokens together with clangd (C++) or basedpyright (Python) for semantic tokens.
The language servers are downloaded and updated automatically upon their use.
Currently, there are three converters into different formats, each with a demo in the demo subfolder:
- LaTeX: The demo in
demo.texand the definitions inSemanticCode.sty(a variant of the file found inlatex-packages) are based onpysemco_tex,pysemco’s only executable. This code has been tested withpdflatexandlualatex, but needs to be compiled from the root of the project for the paths to work. - HTML: Used for
displayoutput in the Jupyter notebookdemo.ipynb. - ANSI escape codes: Used in
demo_ansi.py.