-2

As the title suggests, I'm hoping for a static code visualization tool that can support any language.

I'm hoping there is some tool which can be given some information about the language, and generate a graph (I believe it's called "control flow graph" - a graph of which function calls which)

For the language I have in mind, for example, it seems relatively easy, since the language isn't very complex, and I can think of nothing I'm familiar with from languages such as C/C++ that would make it particularly difficult to analyze said language.

user1999728
  • 913
  • 1
  • 8
  • 25
  • Which language do you want to visualize? – Double M Aug 16 '18 at 18:37
  • @DoubleM in my specific case, JASS. Not the kind of language that would have a code visualization tool made for it, which is why I'm looking for something which can accept something such as a parser for bison/yacc, which I do have. – user1999728 Aug 16 '18 at 18:52
  • You won't find a tool that will magically recognize and parse any random language. To understand a language's syntax, every tool needs a formally defined grammar to work with. From there, you can analyze and extract function definitions/calls and build a dependency graph. Many languages will require you to maintain a symbol table as well to resolve variable types etc. Check my revised answer for projects to get started. – Double M Aug 16 '18 at 19:01
  • @DoubleM I don't expect any "magic", that's why I said "given some infromation about the language", by which I meant something like a yacc parser, which I have – user1999728 Aug 16 '18 at 19:15
  • 1
    Ahh alright. Well if you have a parser or use the one suggested below, you can build a graph and visualize it with one of the many tools out there. I'm not aware of any specific `JASS` tool that would be ready off the shelf, but it should be an easy enough task to accomplish in half a day combining 2 more generic tools. – Double M Aug 16 '18 at 19:20

1 Answers1

1

divine statically analyzes and visualizes your code base. You may link a git repo or upload code directly. At the current beta state, Java binaries are supported. It will be expanded to also support languages such as JavaScript, C, C++, C#, Swift, Objective-C and PHP. Visualizations are interactive and you may follow the control flow in a tangle-free hive plot.

https://divine.engineering/for-engineers#code

Single projects are free.

Disclaimer: I am directly affiliated with this product.


Edit Here are tools specifically for JASS.

This one will give you function definitions and calls. It would be an easy task to assemble a call graph from it and visualize it using e.g. Treeviz or d3. https://github.com/jfhs/php-jass-parser

This one is a bit more abstract, but might be helpful as well: https://github.com/lep/jassjass

Double M
  • 1,449
  • 1
  • 12
  • 29