Post reply

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.
Name:
Email:
Subject:
Message icon:

Verification:
Type the letters shown in the picture
Listen to the letters / Request another image

Type the letters shown in the picture:
What is the last letter in the word "SlickEdit":
How many LETTERS are in the following? "a1b2c3":
Which number is missing?  "12345689":

shortcuts: hit alt+s to submit/post or alt+p to preview


Topic Summary

Posted by: warnerrs
« on: October 29, 2015, 09:39:36 PM »

Thanks. I'll have a look at it.

I'll probably have to make it "methodology aware", and make it ignore the non-interesting things. Maybe I can slurp the associated comment blocks, and look for a pragma which I use to indicate whether or not to draw something. I'm really just trying to map out object handles and class inheritance, I don't really want to see any methods.
Posted by: patrick
« on: October 29, 2015, 08:35:05 PM »

Sure.  I've always thought the hardest problem with automated extraction like that is deciding what public methods to include in the diagram. Unless you're lucky enough to have classes with particularly small interfaces, some of the class nodes end up looking like skyscrapers.

I had a .e file for just doing class relationships, where the arrow points to the subclasses that I've hacked up to pull methods and generate something close enough to what you posted to be a starting point. I can only guarantee that it probably won't set your computer on fire.   I've attached the .e file.  Load it from the command line, and then if you run the "graph_classes" command, it will make a graph of all of the classes in the currently open project.
 
Posted by: warnerrs
« on: October 29, 2015, 07:30:05 PM »

Syntax for the dot files is pretty straight forward. Writing them by hand would get confusing, but they look like they'd be easy to generate. You just need a traversable AST to start from.

Code: [Select]
dot -Tpng input.dot > output.png
Quote from: input.dot
Code: [Select]
digraph hierarchy {
size="5,5"
node[shape=record,style=filled,fillcolor=gray95]
edge[dir=back, arrowtail=empty]


2[label = "{AbstractSuffixTree|+ text\n+ root|...}"]
3[label = "{SimpleSuffixTree|...| + constructTree()\l...}"]
4[label = "{CompactSuffixTree|...| + compactNodes()\l...}"]
5[label = "{SuffixTreeNode|...|+ addSuffix(...)\l...}"]
6[label = "{SuffixTreeEdge|...|+ compactLabel(...)\l...}"]


2->3
2->4
5->5[constraint=false, arrowtail=odiamond]
4->3[constraint=false, arrowtail=odiamond]
2->5[constraint=false, arrowtail=odiamond]
5->6[arrowtail=odiamond]
}
Posted by: patrick
« on: October 29, 2015, 06:05:38 PM »

Do you have some tool that you use to generate UML from graphviz dot files, or do you just do it by hand?
Posted by: warnerrs
« on: October 29, 2015, 03:11:47 PM »

SystemVerilog lacks many tools that can extract class diagrams from the source. With a little consideration in how you write your SystemVerilog source files, SE does a pretty good job of tagging class relationships. So, I've wondered if I could maybe crawl through SE's tag database and spit out dot files I could generate UML from.

Has anyone written any SlickC that traverse the tag database for a similar purpose? Would you care to share?

Thanks,
Ryan