-2

I would like to develop a visualization tool that able to read c programming syntax. The code will includes some functions call, timing information and some triggering mechanism. By recognizing all these syntax, I will be able to simulate and visualize those "functions calls". The program usually use to perform searching and sorting algorithm.

Some visualization tools such as python Bokeh could be use for visualization (can recommend if there are better tools). The question here is how can the c-syntax to be translated to language such as python, and each items/objects written in C code in the searching/sorting algorithm, can be represented as an visual kind of shape object.

Is anyone does anything similar? appreciate if some suggestion on the tools used and the work flow or steps to realized this task. Thank you

Yeo
  • 41
  • 6
  • 3
    *"Connect the c code"* - what's that supposed to mean? – m02ph3u5 Oct 03 '15 at 16:18
  • @m02ph3u5 sorry wasnt explained well. "Connect the c code" as to able to read the c-code syntax and translate it into the visualization tool like Bokeh or D3.js or Processing.js/py. Rather than re-write the algorithm from c to python or js for the tools, is there a faster way for the translation? Thanks! – Yeo Apr 22 '19 at 02:12

1 Answers1

0

If you want to do it well, you are looking for a C abstract syntax tree (AST) parser that runs under python.

However as it seems you want to interactively run the code as well, an existing opensouce C interpreter might be a better starting point.

This is just giving you some pointers for your own research. There are many existing C AST parsers and C interpreters. Read a bit about them. The subject is not so simple that I could give one simple and clear answer however.

Martijn
  • 101
  • 1
  • 5