How can I do modeling in reverse by parsing a C program and turning it in to a circuit diagram to be displayed.
Example
Except this is psedocode.
How can I do modeling in reverse by parsing a C program and turning it in to a circuit diagram to be displayed.
Example
Except this is psedocode.
At a first guess I would say you need to construct a C compiler from scratch (or co-opt one) and inspect the parse tree looking for constructs that you can represent with your list of simple symbols. Once you have done that you need a rendering engine to take the list of detected constructs and lay them out in a pretty picture.
Some random observations:
There are many C concepts that can't be rendered in a simplistic manner (ie pointers)
Making your pic look pretty will be a bitch
Doxygen would be a good place to look for ideas (the do a nice function call structure graph)
Going off on a tangent you might like to look at IEC 61131-3 programming languages for PLCs. These are graphically laid out languages that provide 5 different ways of describing program control and focus heavily on representations of logic