563 lines
13 KiB
Markdown
563 lines
13 KiB
Markdown
# t00057 - Test case C99/C11 translation units with structs and unions
|
|
## Config
|
|
```yaml
|
|
compilation_database_dir: ..
|
|
output_directory: puml
|
|
diagrams:
|
|
t00057_class:
|
|
type: class
|
|
glob:
|
|
- ../../tests/t00057/t00057.c
|
|
- ../../tests/t00057/src/t00057_impl.c
|
|
```
|
|
## Source code
|
|
File t00057.c
|
|
```cpp
|
|
#include "include/t00057.h"
|
|
|
|
struct t00057_A {
|
|
int a1;
|
|
};
|
|
|
|
typedef struct t00057_B {
|
|
int b1;
|
|
} t00057_B;
|
|
|
|
struct t00057_C {
|
|
int c1;
|
|
};
|
|
|
|
union t00057_D {
|
|
int d1;
|
|
float d2;
|
|
};
|
|
|
|
struct t00057_E {
|
|
int e;
|
|
struct {
|
|
int x;
|
|
int y;
|
|
} coordinates;
|
|
union {
|
|
int z;
|
|
double t;
|
|
} height;
|
|
};
|
|
|
|
typedef struct {
|
|
int g1;
|
|
} t00057_G;
|
|
|
|
struct t00057_R {
|
|
struct t00057_A a;
|
|
t00057_B b;
|
|
struct t00057_C *c;
|
|
union t00057_D d;
|
|
struct t00057_E *e;
|
|
struct t00057_F *f;
|
|
struct t00057_G *g;
|
|
};
|
|
|
|
```
|
|
## Generated UML diagrams
|
|

|
|
## Generated JSON models
|
|
```json
|
|
{
|
|
"diagram_type": "class",
|
|
"elements": [
|
|
{
|
|
"bases": [],
|
|
"display_name": "t00057_A",
|
|
"id": "940295970488928395",
|
|
"is_abstract": false,
|
|
"is_nested": false,
|
|
"is_struct": true,
|
|
"is_template": false,
|
|
"is_union": false,
|
|
"members": [
|
|
{
|
|
"access": "public",
|
|
"is_static": false,
|
|
"name": "a1",
|
|
"source_location": {
|
|
"file": "../../tests/t00057/t00057.c",
|
|
"line": 4
|
|
},
|
|
"type": "int"
|
|
}
|
|
],
|
|
"methods": [],
|
|
"name": "t00057_A",
|
|
"namespace": "",
|
|
"source_location": {
|
|
"file": "../../tests/t00057/t00057.c",
|
|
"line": 3
|
|
},
|
|
"template_parameters": [],
|
|
"type": "class"
|
|
},
|
|
{
|
|
"bases": [],
|
|
"display_name": "t00057_B",
|
|
"id": "1030391494410415852",
|
|
"is_abstract": false,
|
|
"is_nested": false,
|
|
"is_struct": true,
|
|
"is_template": false,
|
|
"is_union": false,
|
|
"members": [
|
|
{
|
|
"access": "public",
|
|
"is_static": false,
|
|
"name": "b1",
|
|
"source_location": {
|
|
"file": "../../tests/t00057/t00057.c",
|
|
"line": 8
|
|
},
|
|
"type": "int"
|
|
}
|
|
],
|
|
"methods": [],
|
|
"name": "t00057_B",
|
|
"namespace": "",
|
|
"source_location": {
|
|
"file": "../../tests/t00057/t00057.c",
|
|
"line": 7
|
|
},
|
|
"template_parameters": [],
|
|
"type": "class"
|
|
},
|
|
{
|
|
"bases": [],
|
|
"display_name": "t00057_C",
|
|
"id": "388213894542327772",
|
|
"is_abstract": false,
|
|
"is_nested": false,
|
|
"is_struct": true,
|
|
"is_template": false,
|
|
"is_union": false,
|
|
"members": [
|
|
{
|
|
"access": "public",
|
|
"is_static": false,
|
|
"name": "c1",
|
|
"source_location": {
|
|
"file": "../../tests/t00057/t00057.c",
|
|
"line": 12
|
|
},
|
|
"type": "int"
|
|
}
|
|
],
|
|
"methods": [],
|
|
"name": "t00057_C",
|
|
"namespace": "",
|
|
"source_location": {
|
|
"file": "../../tests/t00057/t00057.c",
|
|
"line": 11
|
|
},
|
|
"template_parameters": [],
|
|
"type": "class"
|
|
},
|
|
{
|
|
"bases": [],
|
|
"display_name": "t00057_D",
|
|
"id": "784667124248020371",
|
|
"is_abstract": false,
|
|
"is_nested": false,
|
|
"is_struct": false,
|
|
"is_template": false,
|
|
"is_union": true,
|
|
"members": [
|
|
{
|
|
"access": "public",
|
|
"is_static": false,
|
|
"name": "d1",
|
|
"source_location": {
|
|
"file": "../../tests/t00057/t00057.c",
|
|
"line": 16
|
|
},
|
|
"type": "int"
|
|
},
|
|
{
|
|
"access": "public",
|
|
"is_static": false,
|
|
"name": "d2",
|
|
"source_location": {
|
|
"file": "../../tests/t00057/t00057.c",
|
|
"line": 17
|
|
},
|
|
"type": "float"
|
|
}
|
|
],
|
|
"methods": [],
|
|
"name": "t00057_D",
|
|
"namespace": "",
|
|
"source_location": {
|
|
"file": "../../tests/t00057/t00057.c",
|
|
"line": 15
|
|
},
|
|
"template_parameters": [],
|
|
"type": "class"
|
|
},
|
|
{
|
|
"bases": [],
|
|
"display_name": "t00057_E",
|
|
"id": "682873132844345324",
|
|
"is_abstract": false,
|
|
"is_nested": false,
|
|
"is_struct": true,
|
|
"is_template": false,
|
|
"is_union": false,
|
|
"members": [
|
|
{
|
|
"access": "public",
|
|
"is_static": false,
|
|
"name": "e",
|
|
"source_location": {
|
|
"file": "../../tests/t00057/t00057.c",
|
|
"line": 21
|
|
},
|
|
"type": "int"
|
|
},
|
|
{
|
|
"access": "public",
|
|
"is_static": false,
|
|
"name": "coordinates",
|
|
"source_location": {
|
|
"file": "../../tests/t00057/t00057.c",
|
|
"line": 25
|
|
},
|
|
"type": "t00057_E##(anonymous_739)"
|
|
},
|
|
{
|
|
"access": "public",
|
|
"is_static": false,
|
|
"name": "height",
|
|
"source_location": {
|
|
"file": "../../tests/t00057/t00057.c",
|
|
"line": 29
|
|
},
|
|
"type": "t00057_E##(anonymous_807)"
|
|
}
|
|
],
|
|
"methods": [],
|
|
"name": "t00057_E",
|
|
"namespace": "",
|
|
"source_location": {
|
|
"file": "../../tests/t00057/t00057.c",
|
|
"line": 20
|
|
},
|
|
"template_parameters": [],
|
|
"type": "class"
|
|
},
|
|
{
|
|
"bases": [],
|
|
"display_name": "t00057_E::(coordinates)",
|
|
"id": "161676142413826748",
|
|
"is_abstract": false,
|
|
"is_nested": true,
|
|
"is_struct": true,
|
|
"is_template": false,
|
|
"is_union": false,
|
|
"members": [
|
|
{
|
|
"access": "public",
|
|
"is_static": false,
|
|
"name": "x",
|
|
"source_location": {
|
|
"file": "../../tests/t00057/t00057.c",
|
|
"line": 23
|
|
},
|
|
"type": "int"
|
|
},
|
|
{
|
|
"access": "public",
|
|
"is_static": false,
|
|
"name": "y",
|
|
"source_location": {
|
|
"file": "../../tests/t00057/t00057.c",
|
|
"line": 24
|
|
},
|
|
"type": "int"
|
|
}
|
|
],
|
|
"methods": [],
|
|
"name": "t00057_E::(coordinates)",
|
|
"namespace": "",
|
|
"source_location": {
|
|
"file": "../../tests/t00057/t00057.c",
|
|
"line": 22
|
|
},
|
|
"template_parameters": [],
|
|
"type": "class"
|
|
},
|
|
{
|
|
"bases": [],
|
|
"display_name": "t00057_E::(height)",
|
|
"id": "2265335931722752750",
|
|
"is_abstract": false,
|
|
"is_nested": true,
|
|
"is_struct": false,
|
|
"is_template": false,
|
|
"is_union": true,
|
|
"members": [
|
|
{
|
|
"access": "public",
|
|
"is_static": false,
|
|
"name": "z",
|
|
"source_location": {
|
|
"file": "../../tests/t00057/t00057.c",
|
|
"line": 27
|
|
},
|
|
"type": "int"
|
|
},
|
|
{
|
|
"access": "public",
|
|
"is_static": false,
|
|
"name": "t",
|
|
"source_location": {
|
|
"file": "../../tests/t00057/t00057.c",
|
|
"line": 28
|
|
},
|
|
"type": "double"
|
|
}
|
|
],
|
|
"methods": [],
|
|
"name": "t00057_E::(height)",
|
|
"namespace": "",
|
|
"source_location": {
|
|
"file": "../../tests/t00057/t00057.c",
|
|
"line": 26
|
|
},
|
|
"template_parameters": [],
|
|
"type": "class"
|
|
},
|
|
{
|
|
"bases": [],
|
|
"display_name": "t00057_G",
|
|
"id": "1592909736406415155",
|
|
"is_abstract": false,
|
|
"is_nested": false,
|
|
"is_struct": true,
|
|
"is_template": false,
|
|
"is_union": false,
|
|
"members": [
|
|
{
|
|
"access": "public",
|
|
"is_static": false,
|
|
"name": "g1",
|
|
"source_location": {
|
|
"file": "../../tests/t00057/t00057.c",
|
|
"line": 33
|
|
},
|
|
"type": "int"
|
|
}
|
|
],
|
|
"methods": [],
|
|
"name": "t00057_G",
|
|
"namespace": "",
|
|
"source_location": {
|
|
"file": "../../tests/t00057/t00057.c",
|
|
"line": 32
|
|
},
|
|
"template_parameters": [],
|
|
"type": "class"
|
|
},
|
|
{
|
|
"bases": [],
|
|
"display_name": "t00057_R",
|
|
"id": "370583978606928327",
|
|
"is_abstract": false,
|
|
"is_nested": false,
|
|
"is_struct": true,
|
|
"is_template": false,
|
|
"is_union": false,
|
|
"members": [
|
|
{
|
|
"access": "public",
|
|
"is_static": false,
|
|
"name": "a",
|
|
"source_location": {
|
|
"file": "../../tests/t00057/t00057.c",
|
|
"line": 37
|
|
},
|
|
"type": "struct t00057_A"
|
|
},
|
|
{
|
|
"access": "public",
|
|
"is_static": false,
|
|
"name": "b",
|
|
"source_location": {
|
|
"file": "../../tests/t00057/t00057.c",
|
|
"line": 38
|
|
},
|
|
"type": "t00057_B"
|
|
},
|
|
{
|
|
"access": "public",
|
|
"is_static": false,
|
|
"name": "c",
|
|
"source_location": {
|
|
"file": "../../tests/t00057/t00057.c",
|
|
"line": 39
|
|
},
|
|
"type": "struct t00057_C *"
|
|
},
|
|
{
|
|
"access": "public",
|
|
"is_static": false,
|
|
"name": "d",
|
|
"source_location": {
|
|
"file": "../../tests/t00057/t00057.c",
|
|
"line": 40
|
|
},
|
|
"type": "union t00057_D"
|
|
},
|
|
{
|
|
"access": "public",
|
|
"is_static": false,
|
|
"name": "e",
|
|
"source_location": {
|
|
"file": "../../tests/t00057/t00057.c",
|
|
"line": 41
|
|
},
|
|
"type": "struct t00057_E *"
|
|
},
|
|
{
|
|
"access": "public",
|
|
"is_static": false,
|
|
"name": "f",
|
|
"source_location": {
|
|
"file": "../../tests/t00057/t00057.c",
|
|
"line": 42
|
|
},
|
|
"type": "struct t00057_F *"
|
|
},
|
|
{
|
|
"access": "public",
|
|
"is_static": false,
|
|
"name": "g",
|
|
"source_location": {
|
|
"file": "../../tests/t00057/t00057.c",
|
|
"line": 43
|
|
},
|
|
"type": "struct t00057_G *"
|
|
}
|
|
],
|
|
"methods": [],
|
|
"name": "t00057_R",
|
|
"namespace": "",
|
|
"source_location": {
|
|
"file": "../../tests/t00057/t00057.c",
|
|
"line": 36
|
|
},
|
|
"template_parameters": [],
|
|
"type": "class"
|
|
},
|
|
{
|
|
"bases": [],
|
|
"display_name": "t00057_F",
|
|
"id": "85797106299568719",
|
|
"is_abstract": false,
|
|
"is_nested": false,
|
|
"is_struct": true,
|
|
"is_template": false,
|
|
"is_union": false,
|
|
"members": [
|
|
{
|
|
"access": "public",
|
|
"is_static": false,
|
|
"name": "f1",
|
|
"source_location": {
|
|
"file": "../../tests/t00057/src/t00057_impl.c",
|
|
"line": 4
|
|
},
|
|
"type": "int"
|
|
}
|
|
],
|
|
"methods": [],
|
|
"name": "t00057_F",
|
|
"namespace": "",
|
|
"source_location": {
|
|
"file": "../../tests/t00057/include/t00057.h",
|
|
"line": 3
|
|
},
|
|
"template_parameters": [],
|
|
"type": "class"
|
|
}
|
|
],
|
|
"metadata": {
|
|
"clang_uml_version": "0.3.5-2-g7e9944c",
|
|
"llvm_version": "Ubuntu clang version 15.0.6",
|
|
"schema_version": 1
|
|
},
|
|
"name": "t00057_class",
|
|
"relationships": [
|
|
{
|
|
"access": "public",
|
|
"destination": "161676142413826748",
|
|
"label": "coordinates",
|
|
"source": "682873132844345324",
|
|
"type": "aggregation"
|
|
},
|
|
{
|
|
"access": "public",
|
|
"destination": "2265335931722752750",
|
|
"label": "height",
|
|
"source": "682873132844345324",
|
|
"type": "aggregation"
|
|
},
|
|
{
|
|
"access": "public",
|
|
"destination": "940295970488928395",
|
|
"label": "a",
|
|
"source": "370583978606928327",
|
|
"type": "aggregation"
|
|
},
|
|
{
|
|
"access": "public",
|
|
"destination": "1030391494410415852",
|
|
"label": "b",
|
|
"source": "370583978606928327",
|
|
"type": "aggregation"
|
|
},
|
|
{
|
|
"access": "public",
|
|
"destination": "388213894542327772",
|
|
"label": "c",
|
|
"source": "370583978606928327",
|
|
"type": "association"
|
|
},
|
|
{
|
|
"access": "public",
|
|
"destination": "784667124248020371",
|
|
"label": "d",
|
|
"source": "370583978606928327",
|
|
"type": "aggregation"
|
|
},
|
|
{
|
|
"access": "public",
|
|
"destination": "682873132844345324",
|
|
"label": "e",
|
|
"source": "370583978606928327",
|
|
"type": "association"
|
|
},
|
|
{
|
|
"access": "public",
|
|
"destination": "85797106299568719",
|
|
"label": "f",
|
|
"source": "370583978606928327",
|
|
"type": "association"
|
|
},
|
|
{
|
|
"access": "public",
|
|
"destination": "1592909736406415155",
|
|
"label": "g",
|
|
"source": "370583978606928327",
|
|
"type": "association"
|
|
}
|
|
]
|
|
}
|
|
```
|