developing an algorithm visualization/simulation

199 Views Asked by At

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

1

There are 1 best solutions below

0
Martijn On

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.