Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to generate graph for structure/enum #57

Open
Stargateur opened this issue Jul 3, 2020 · 1 comment
Open

Option to generate graph for structure/enum #57

Stargateur opened this issue Jul 3, 2020 · 1 comment

Comments

@Stargateur
Copy link

Stargateur commented Jul 3, 2020

I would like to be able to generate a graph for a structure. I have a heavy numbers of structure for a parsing crate that contains each other a lot, and I would like to generate a visual graph of it. I know this is not the purpose of this repo but I search I didn't find anything.

So I wonder, if anyone know something that do it, or if that could be an additional feature of this crate.

Example:

struct A {
    b: B,
    c: C,
}

struct B {
    c: C,
}

struct C {
    foo: i32,
}

struct D {
    a: A,
    b: B,
}

will produce:

digraph {
  A [shape=record, label="{ struct A | { <b> b| <c> c } }"];
  B [shape=record, label="{ struct B | { <c> c } }"];
  C [shape=record, label="{ struct C | { <foo> foo } }"];
  D [shape=record, label="{ struct D | { <a> a | <b> b } }"];

  A:b -> B;
  A:c -> C;
  B:c -> C;
  C:foo -> i32;
  D:a -> A;
  D:b -> B;
}

and so will produce:

graph

@kvark
Copy link
Contributor

kvark commented Jul 4, 2020

That sounds interesting! Could be out of scope for this crate though.

@regexident regexident changed the title Request/Alternative Have a way to generate graph for structure/enum Option to generate graph for structure/enum Feb 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants