2017-04-03 01:34:15 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "../../third_party/doctest/doctest/doctest.h"
|
|
|
|
#include "../../third_party/macro_map.h"
|
|
|
|
#include "../../third_party/optional.h"
|
|
|
|
#include <rapidjson/rapidjson.h>
|
|
|
|
#include <rapidjson/document.h>
|
|
|
|
#include <rapidjson/prettywriter.h>
|
|
|
|
|
|
|
|
struct Base {};
|
|
|
|
|
|
|
|
struct SameFileDerived : Base {};
|
|
|
|
|
|
|
|
using Foo0 = SameFileDerived;
|
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
void Foo1() {}
|
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
struct Foo2 {};
|
|
|
|
|
|
|
|
enum Foo3 { A, B, C };
|
|
|
|
|
|
|
|
int Foo4;
|
|
|
|
static int Foo5;
|
|
|
|
|
|
|
|
/*
|
|
|
|
OUTPUT:
|
|
|
|
{
|
|
|
|
"types": [{
|
|
|
|
"id": 0,
|
|
|
|
"usr": "c:@S@Base",
|
|
|
|
"short_name": "Base",
|
|
|
|
"qualified_name": "Base",
|
2017-04-05 08:06:18 +00:00
|
|
|
"definition": "10:8",
|
2017-04-03 01:34:15 +00:00
|
|
|
"derived": [1],
|
2017-04-05 08:06:18 +00:00
|
|
|
"uses": ["*10:8", "*12:26"]
|
2017-04-03 01:34:15 +00:00
|
|
|
}, {
|
|
|
|
"id": 1,
|
|
|
|
"usr": "c:@S@SameFileDerived",
|
|
|
|
"short_name": "SameFileDerived",
|
|
|
|
"qualified_name": "SameFileDerived",
|
2017-04-05 08:06:18 +00:00
|
|
|
"definition": "12:8",
|
2017-04-03 01:34:15 +00:00
|
|
|
"parents": [0],
|
2017-04-05 08:06:18 +00:00
|
|
|
"uses": ["*12:8", "*14:14"]
|
2017-04-03 01:34:15 +00:00
|
|
|
}, {
|
|
|
|
"id": 2,
|
|
|
|
"usr": "c:@Foo0",
|
|
|
|
"short_name": "Foo0",
|
|
|
|
"qualified_name": "Foo0",
|
2017-04-05 08:06:18 +00:00
|
|
|
"definition": "14:7",
|
2017-04-03 01:34:15 +00:00
|
|
|
"alias_of": 1,
|
2017-04-05 08:06:18 +00:00
|
|
|
"uses": ["*14:7"]
|
2017-04-03 01:34:15 +00:00
|
|
|
}, {
|
|
|
|
"id": 3,
|
|
|
|
"usr": "c:@ST>1#T@Foo2",
|
|
|
|
"short_name": "Foo2",
|
|
|
|
"qualified_name": "Foo2",
|
2017-04-05 08:06:18 +00:00
|
|
|
"definition": "20:8",
|
|
|
|
"uses": ["*20:8"]
|
2017-04-03 01:34:15 +00:00
|
|
|
}, {
|
|
|
|
"id": 4,
|
|
|
|
"usr": "c:@E@Foo3",
|
|
|
|
"short_name": "Foo3",
|
|
|
|
"qualified_name": "Foo3",
|
2017-04-05 08:06:18 +00:00
|
|
|
"definition": "22:6",
|
2017-04-03 01:34:15 +00:00
|
|
|
"vars": [0, 1, 2],
|
2017-04-05 08:06:18 +00:00
|
|
|
"uses": ["*22:6"]
|
2017-04-03 01:34:15 +00:00
|
|
|
}],
|
|
|
|
"funcs": [{
|
|
|
|
"id": 0,
|
|
|
|
"usr": "c:@FT@>1#TFoo1#v#",
|
|
|
|
"short_name": "Foo1",
|
|
|
|
"qualified_name": "Foo1",
|
2017-04-05 08:06:18 +00:00
|
|
|
"definition": "17:6",
|
|
|
|
"uses": ["17:6"]
|
2017-04-03 01:34:15 +00:00
|
|
|
}],
|
|
|
|
"vars": [{
|
|
|
|
"id": 0,
|
|
|
|
"usr": "c:@E@Foo3@A",
|
|
|
|
"short_name": "A",
|
|
|
|
"qualified_name": "Foo3::A",
|
2017-04-05 08:06:18 +00:00
|
|
|
"definition": "22:13",
|
2017-04-03 01:34:15 +00:00
|
|
|
"variable_type": 4,
|
|
|
|
"declaring_type": 4,
|
2017-04-05 08:06:18 +00:00
|
|
|
"uses": ["22:13"]
|
2017-04-03 01:34:15 +00:00
|
|
|
}, {
|
|
|
|
"id": 1,
|
|
|
|
"usr": "c:@E@Foo3@B",
|
|
|
|
"short_name": "B",
|
|
|
|
"qualified_name": "Foo3::B",
|
2017-04-05 08:06:18 +00:00
|
|
|
"definition": "22:16",
|
2017-04-03 01:34:15 +00:00
|
|
|
"variable_type": 4,
|
|
|
|
"declaring_type": 4,
|
2017-04-05 08:06:18 +00:00
|
|
|
"uses": ["22:16"]
|
2017-04-03 01:34:15 +00:00
|
|
|
}, {
|
|
|
|
"id": 2,
|
|
|
|
"usr": "c:@E@Foo3@C",
|
|
|
|
"short_name": "C",
|
|
|
|
"qualified_name": "Foo3::C",
|
2017-04-05 08:06:18 +00:00
|
|
|
"definition": "22:19",
|
2017-04-03 01:34:15 +00:00
|
|
|
"variable_type": 4,
|
|
|
|
"declaring_type": 4,
|
2017-04-05 08:06:18 +00:00
|
|
|
"uses": ["22:19"]
|
2017-04-03 01:34:15 +00:00
|
|
|
}, {
|
|
|
|
"id": 3,
|
|
|
|
"usr": "c:@Foo4",
|
|
|
|
"short_name": "Foo4",
|
|
|
|
"qualified_name": "Foo4",
|
2017-04-05 08:06:18 +00:00
|
|
|
"definition": "24:5",
|
|
|
|
"uses": ["24:5"]
|
2017-04-03 01:34:15 +00:00
|
|
|
}, {
|
|
|
|
"id": 4,
|
|
|
|
"usr": "c:header.h@Foo5",
|
|
|
|
"short_name": "Foo5",
|
|
|
|
"qualified_name": "Foo5",
|
2017-04-05 08:06:18 +00:00
|
|
|
"definition": "25:12",
|
|
|
|
"uses": ["25:12"]
|
2017-04-03 01:34:15 +00:00
|
|
|
}]
|
|
|
|
}
|
|
|
|
*/
|