ts2famix 1.1.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dist/analyze.js +8 -5
- package/dist/analyze_functions/processAccesses.js +7 -6
- package/dist/analyze_functions/processFiles.js +43 -43
- package/dist/analyze_functions/processImportClauses.js +25 -7
- package/dist/analyze_functions/processInheritances.js +8 -7
- package/dist/analyze_functions/processInvocations.js +6 -5
- package/dist/famix_functions/famix_functions.js +19 -21
- package/dist/famix_functions/famix_functions_associations.js +29 -14
- package/dist/famix_functions/famix_functions_index.js +32 -15
- package/dist/famix_functions/famix_functions_types.js +2 -1
- package/dist/lib/famix/src/famix_repository.js +6 -0
- package/dist/lib/famix/src/model/famix/access.js +3 -3
- package/dist/lib/famix/src/model/famix/accessor.js +3 -3
- package/dist/lib/famix/src/model/famix/alias.js +3 -3
- package/dist/lib/famix/src/model/famix/association.js +3 -3
- package/dist/lib/famix/src/model/famix/behavioral_entity.js +6 -6
- package/dist/lib/famix/src/model/famix/class.js +3 -3
- package/dist/lib/famix/src/model/famix/comment.js +3 -3
- package/dist/lib/famix/src/model/famix/container_entity.js +3 -3
- package/dist/lib/famix/src/model/famix/decorator.js +3 -3
- package/dist/lib/famix/src/model/famix/entity.js +3 -3
- package/dist/lib/famix/src/model/famix/enum.js +3 -3
- package/dist/lib/famix/src/model/famix/enum_value.js +3 -3
- package/dist/lib/famix/src/model/famix/function.js +3 -3
- package/dist/lib/famix/src/model/famix/implicit_variable.js +3 -3
- package/dist/lib/famix/src/model/famix/import_clause.js +3 -3
- package/dist/lib/famix/src/model/famix/index.js +3 -7
- package/dist/lib/famix/src/model/famix/indexed_file_anchor.js +17 -3
- package/dist/lib/famix/src/model/famix/inheritance.js +3 -3
- package/dist/lib/famix/src/model/famix/interface.js +3 -3
- package/dist/lib/famix/src/model/famix/invocation.js +3 -3
- package/dist/lib/famix/src/model/famix/method.js +3 -3
- package/dist/lib/famix/src/model/famix/module.js +3 -3
- package/dist/lib/famix/src/model/famix/named_entity.js +4 -4
- package/dist/lib/famix/src/model/famix/namespace.js +3 -3
- package/dist/lib/famix/src/model/famix/parameter.js +3 -3
- package/dist/lib/famix/src/model/famix/{type_parameter.js → parameter_type.js} +7 -7
- package/dist/lib/famix/src/model/famix/parameterizable_class.js +11 -11
- package/dist/lib/famix/src/model/famix/parameterizable_interface.js +11 -11
- package/dist/lib/famix/src/model/famix/parameterized_type.js +3 -3
- package/dist/lib/famix/src/model/famix/primitive_type.js +3 -3
- package/dist/lib/famix/src/model/famix/property.js +3 -3
- package/dist/lib/famix/src/model/famix/reference.js +3 -3
- package/dist/lib/famix/src/model/famix/scoping_entity.js +6 -5
- package/dist/lib/famix/src/model/famix/script_entity.js +3 -3
- package/dist/lib/famix/src/model/famix/source_anchor.js +3 -3
- package/dist/lib/famix/src/model/famix/source_language.js +8 -3
- package/dist/lib/famix/src/model/famix/sourced_entity.js +7 -3
- package/dist/lib/famix/src/model/famix/structural_entity.js +3 -3
- package/dist/lib/famix/src/model/famix/text_anchor.js +3 -3
- package/dist/lib/famix/src/model/famix/type.js +3 -3
- package/dist/lib/famix/src/model/famix/variable.js +3 -3
- package/dist/ts2famix-cli.js +16 -3
- package/package.json +14 -13
- package/src/analyze.ts +10 -4
- package/src/analyze_functions/processAccesses.ts +7 -6
- package/src/analyze_functions/processFiles.ts +44 -46
- package/src/analyze_functions/processImportClauses.ts +25 -7
- package/src/analyze_functions/processInheritances.ts +8 -7
- package/src/analyze_functions/processInvocations.ts +6 -5
- package/src/famix_functions/famix_functions.ts +20 -23
- package/src/famix_functions/famix_functions_associations.ts +32 -15
- package/src/famix_functions/famix_functions_index.ts +34 -18
- package/src/famix_functions/famix_functions_types.ts +2 -1
- package/src/generate_uml.sh +1 -0
- package/src/lib/famix/src/famix_repository.ts +12 -3
- package/src/lib/famix/src/model/famix/access.ts +3 -3
- package/src/lib/famix/src/model/famix/accessor.ts +3 -3
- package/src/lib/famix/src/model/famix/alias.ts +3 -3
- package/src/lib/famix/src/model/famix/association.ts +3 -3
- package/src/lib/famix/src/model/famix/behavioral_entity.ts +8 -8
- package/src/lib/famix/src/model/famix/class.ts +3 -3
- package/src/lib/famix/src/model/famix/comment.ts +3 -3
- package/src/lib/famix/src/model/famix/container_entity.ts +3 -3
- package/src/lib/famix/src/model/famix/decorator.ts +3 -3
- package/src/lib/famix/src/model/famix/entity.ts +3 -3
- package/src/lib/famix/src/model/famix/enum.ts +3 -3
- package/src/lib/famix/src/model/famix/enum_value.ts +3 -3
- package/src/lib/famix/src/model/famix/function.ts +3 -3
- package/src/lib/famix/src/model/famix/implicit_variable.ts +3 -3
- package/src/lib/famix/src/model/famix/import_clause.ts +3 -3
- package/src/lib/famix/src/model/famix/index.ts +40 -42
- package/src/lib/famix/src/model/famix/indexed_file_anchor.ts +25 -3
- package/src/lib/famix/src/model/famix/inheritance.ts +3 -3
- package/src/lib/famix/src/model/famix/interface.ts +3 -3
- package/src/lib/famix/src/model/famix/invocation.ts +3 -3
- package/src/lib/famix/src/model/famix/method.ts +3 -3
- package/src/lib/famix/src/model/famix/module.ts +3 -3
- package/src/lib/famix/src/model/famix/named_entity.ts +4 -4
- package/src/lib/famix/src/model/famix/namespace.ts +3 -3
- package/src/lib/famix/src/model/famix/parameter.ts +3 -3
- package/src/lib/famix/src/model/famix/{type_parameter.ts → parameter_type.ts} +9 -9
- package/src/lib/famix/src/model/famix/parameterizable_class.ts +12 -12
- package/src/lib/famix/src/model/famix/parameterizable_interface.ts +12 -12
- package/src/lib/famix/src/model/famix/parameterized_type.ts +3 -3
- package/src/lib/famix/src/model/famix/primitive_type.ts +3 -3
- package/src/lib/famix/src/model/famix/property.ts +3 -3
- package/src/lib/famix/src/model/famix/reference.ts +3 -3
- package/src/lib/famix/src/model/famix/scoping_entity.ts +6 -5
- package/src/lib/famix/src/model/famix/script_entity.ts +3 -3
- package/src/lib/famix/src/model/famix/source_anchor.ts +3 -3
- package/src/lib/famix/src/model/famix/source_language.ts +9 -3
- package/src/lib/famix/src/model/famix/sourced_entity.ts +6 -3
- package/src/lib/famix/src/model/famix/structural_entity.ts +3 -3
- package/src/lib/famix/src/model/famix/text_anchor.ts +3 -3
- package/src/lib/famix/src/model/famix/type.ts +3 -3
- package/src/lib/famix/src/model/famix/variable.ts +3 -3
- package/src/ts2famix-cli.ts +17 -3
- package/dist/lib/famix/src/model/famix/c_source_language.js +0 -16
- package/dist/lib/famix/src/model/famix/custom_source_language.js +0 -23
- package/src/lib/famix/src/model/famix/c_source_language.ts +0 -15
- package/src/lib/famix/src/model/famix/custom_source_language.ts +0 -27
|
@@ -1,42 +1,40 @@
|
|
|
1
|
-
export {Access} from "./access";
|
|
2
|
-
export {Accessor} from "./accessor";
|
|
3
|
-
export {Alias} from "./alias";
|
|
4
|
-
export {Association} from "./association";
|
|
5
|
-
export {BehavioralEntity} from "./behavioral_entity";
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
16
|
-
export {
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
19
|
-
export {
|
|
20
|
-
export {
|
|
21
|
-
export {
|
|
22
|
-
export {
|
|
23
|
-
export {
|
|
24
|
-
export {
|
|
25
|
-
export {
|
|
26
|
-
export {
|
|
27
|
-
export {
|
|
28
|
-
export {
|
|
29
|
-
export {
|
|
30
|
-
export {
|
|
31
|
-
export {
|
|
32
|
-
export {
|
|
33
|
-
export {
|
|
34
|
-
export {
|
|
35
|
-
export {
|
|
36
|
-
export {
|
|
37
|
-
export {
|
|
38
|
-
export {
|
|
39
|
-
export {
|
|
40
|
-
export {
|
|
41
|
-
export {Type} from "./type";
|
|
42
|
-
export {Variable} from "./variable";
|
|
1
|
+
export { Access } from "./access";
|
|
2
|
+
export { Accessor } from "./accessor";
|
|
3
|
+
export { Alias } from "./alias";
|
|
4
|
+
export { Association } from "./association";
|
|
5
|
+
export { BehavioralEntity } from "./behavioral_entity";
|
|
6
|
+
export { Class } from "./class";
|
|
7
|
+
export { Comment } from "./comment";
|
|
8
|
+
export { ContainerEntity } from "./container_entity";
|
|
9
|
+
export { Decorator } from "./decorator";
|
|
10
|
+
export { Entity } from "./entity";
|
|
11
|
+
export { EnumValue } from "./enum_value";
|
|
12
|
+
export { Enum } from "./enum";
|
|
13
|
+
export { Property } from "./property";
|
|
14
|
+
export { Function } from "./function";
|
|
15
|
+
export { ImplicitVariable } from "./implicit_variable";
|
|
16
|
+
export { ImportClause } from "./import_clause";
|
|
17
|
+
export { IndexedFileAnchor } from "./indexed_file_anchor";
|
|
18
|
+
export { Inheritance } from "./inheritance";
|
|
19
|
+
export { Interface } from "./interface";
|
|
20
|
+
export { Invocation } from "./invocation";
|
|
21
|
+
export { Method } from "./method";
|
|
22
|
+
export { Module } from "./module";
|
|
23
|
+
export { NamedEntity } from "./named_entity";
|
|
24
|
+
export { Namespace } from "./namespace";
|
|
25
|
+
export { ParameterType } from "./parameter_type";
|
|
26
|
+
export { Parameter } from "./parameter";
|
|
27
|
+
export { ParameterizableClass } from "./parameterizable_class";
|
|
28
|
+
export { ParameterizableInterface } from "./parameterizable_interface";
|
|
29
|
+
export { ParameterizedType } from "./parameterized_type";
|
|
30
|
+
export { PrimitiveType } from "./primitive_type";
|
|
31
|
+
export { Reference } from "./reference";
|
|
32
|
+
export { ScopingEntity } from "./scoping_entity";
|
|
33
|
+
export { ScriptEntity } from "./script_entity";
|
|
34
|
+
export { SourceAnchor } from "./source_anchor";
|
|
35
|
+
export { SourceLanguage } from "./source_language";
|
|
36
|
+
export { SourcedEntity } from "./sourced_entity";
|
|
37
|
+
export { StructuralEntity } from "./structural_entity";
|
|
38
|
+
export { TextAnchor } from "./text_anchor";
|
|
39
|
+
export { Type } from "./type";
|
|
40
|
+
export { Variable } from "./variable";
|
|
@@ -23,6 +23,26 @@ export class IndexedFileAnchor extends SourceAnchor {
|
|
|
23
23
|
this.endPos = endPos;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
private endLine: number;
|
|
27
|
+
|
|
28
|
+
public getEndLine(): number {
|
|
29
|
+
return this.endLine;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
public setEndLine(sourceEndLine: number) {
|
|
33
|
+
this.endLine = sourceEndLine;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
private startLine: number;
|
|
37
|
+
|
|
38
|
+
public getStartLine(): number {
|
|
39
|
+
return this.startLine;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
public setStartLine(sourceStartLine: number) {
|
|
43
|
+
this.startLine = sourceStartLine;
|
|
44
|
+
}
|
|
45
|
+
|
|
26
46
|
private fileName: string;
|
|
27
47
|
|
|
28
48
|
public getFileName(): string {
|
|
@@ -35,15 +55,17 @@ export class IndexedFileAnchor extends SourceAnchor {
|
|
|
35
55
|
|
|
36
56
|
|
|
37
57
|
public getJSON(): string {
|
|
38
|
-
const
|
|
39
|
-
this.addPropertiesToExporter(
|
|
40
|
-
return
|
|
58
|
+
const json: FamixJSONExporter = new FamixJSONExporter("IndexedFileAnchor", this);
|
|
59
|
+
this.addPropertiesToExporter(json);
|
|
60
|
+
return json.getJSON();
|
|
41
61
|
}
|
|
42
62
|
|
|
43
63
|
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
44
64
|
super.addPropertiesToExporter(exporter);
|
|
45
65
|
exporter.addProperty("startPos", this.getStartPos());
|
|
46
66
|
exporter.addProperty("endPos", this.getEndPos());
|
|
67
|
+
exporter.addProperty("startLine", this.getStartLine());
|
|
68
|
+
exporter.addProperty("endLine", this.getEndLine());
|
|
47
69
|
exporter.addProperty("fileName", this.getFileName());
|
|
48
70
|
}
|
|
49
71
|
}
|
|
@@ -29,9 +29,9 @@ export class Inheritance extends Association {
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
public getJSON(): string {
|
|
32
|
-
const
|
|
33
|
-
this.addPropertiesToExporter(
|
|
34
|
-
return
|
|
32
|
+
const json: FamixJSONExporter = new FamixJSONExporter("Inheritance", this);
|
|
33
|
+
this.addPropertiesToExporter(json);
|
|
34
|
+
return json.getJSON();
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
@@ -60,9 +60,9 @@ export class Interface extends Type {
|
|
|
60
60
|
|
|
61
61
|
|
|
62
62
|
public getJSON(): string {
|
|
63
|
-
const
|
|
64
|
-
this.addPropertiesToExporter(
|
|
65
|
-
return
|
|
63
|
+
const json: FamixJSONExporter = new FamixJSONExporter("Interface", this);
|
|
64
|
+
this.addPropertiesToExporter(json);
|
|
65
|
+
return json.getJSON();
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
@@ -53,9 +53,9 @@ export class Invocation extends Association {
|
|
|
53
53
|
|
|
54
54
|
|
|
55
55
|
public getJSON(): string {
|
|
56
|
-
const
|
|
57
|
-
this.addPropertiesToExporter(
|
|
58
|
-
return
|
|
56
|
+
const json: FamixJSONExporter = new FamixJSONExporter("Invocation", this);
|
|
57
|
+
this.addPropertiesToExporter(json);
|
|
58
|
+
return json.getJSON();
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
@@ -78,9 +78,9 @@ export class Method extends BehavioralEntity {
|
|
|
78
78
|
|
|
79
79
|
|
|
80
80
|
public getJSON(): string {
|
|
81
|
-
const
|
|
82
|
-
this.addPropertiesToExporter(
|
|
83
|
-
return
|
|
81
|
+
const json: FamixJSONExporter = new FamixJSONExporter("Method", this);
|
|
82
|
+
this.addPropertiesToExporter(json);
|
|
83
|
+
return json.getJSON();
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
@@ -19,9 +19,9 @@ export class Module extends ScriptEntity {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
public getJSON(): string {
|
|
22
|
-
const
|
|
23
|
-
this.addPropertiesToExporter(
|
|
24
|
-
return
|
|
22
|
+
const json: FamixJSONExporter = new FamixJSONExporter("Module", this);
|
|
23
|
+
this.addPropertiesToExporter(json);
|
|
24
|
+
return json.getJSON();
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
@@ -81,15 +81,15 @@ export class NamedEntity extends SourcedEntity {
|
|
|
81
81
|
|
|
82
82
|
|
|
83
83
|
public getJSON(): string {
|
|
84
|
-
const
|
|
85
|
-
this.addPropertiesToExporter(
|
|
86
|
-
return
|
|
84
|
+
const json: FamixJSONExporter = new FamixJSONExporter("NamedEntity", this);
|
|
85
|
+
this.addPropertiesToExporter(json);
|
|
86
|
+
return json.getJSON();
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
90
90
|
super.addPropertiesToExporter(exporter);
|
|
91
91
|
exporter.addProperty("fullyQualifiedName", this.getFullyQualifiedName());
|
|
92
|
-
exporter.addProperty("
|
|
92
|
+
exporter.addProperty("incomingInvocations", this.getReceivedInvocations());
|
|
93
93
|
exporter.addProperty("incomingImports", this.getIncomingImports());
|
|
94
94
|
exporter.addProperty("name", this.getName());
|
|
95
95
|
exporter.addProperty("aliases", this.getAliases());
|
|
@@ -16,9 +16,9 @@ export class Namespace extends ScopingEntity {
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
public getJSON(): string {
|
|
19
|
-
const
|
|
20
|
-
this.addPropertiesToExporter(
|
|
21
|
-
return
|
|
19
|
+
const json: FamixJSONExporter = new FamixJSONExporter("Namespace", this);
|
|
20
|
+
this.addPropertiesToExporter(json);
|
|
21
|
+
return json.getJSON();
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
@@ -17,9 +17,9 @@ export class Parameter extends StructuralEntity {
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
public getJSON(): string {
|
|
20
|
-
const
|
|
21
|
-
this.addPropertiesToExporter(
|
|
22
|
-
return
|
|
20
|
+
const json: FamixJSONExporter = new FamixJSONExporter("Parameter", this);
|
|
21
|
+
this.addPropertiesToExporter(json);
|
|
22
|
+
return json.getJSON();
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
@@ -3,27 +3,27 @@ import { Type } from "./type";
|
|
|
3
3
|
import { ParameterizableClass } from "./parameterizable_class";
|
|
4
4
|
import { ParameterizableInterface } from "./parameterizable_interface";
|
|
5
5
|
import { Method } from "./method";
|
|
6
|
-
import { Function } from "./function";
|
|
6
|
+
import { Function as FamixFunction } from "./function";
|
|
7
7
|
import { Accessor } from "./accessor";
|
|
8
8
|
|
|
9
|
-
export class
|
|
9
|
+
export class ParameterType extends Type {
|
|
10
10
|
|
|
11
|
-
private parentGeneric: ParameterizableClass | ParameterizableInterface | Method | Accessor |
|
|
11
|
+
private parentGeneric: ParameterizableClass | ParameterizableInterface | Method | Accessor | FamixFunction;
|
|
12
12
|
|
|
13
|
-
public getParentGeneric(): ParameterizableClass | ParameterizableInterface | Method | Accessor |
|
|
13
|
+
public getParentGeneric(): ParameterizableClass | ParameterizableInterface | Method | Accessor | FamixFunction {
|
|
14
14
|
return this.parentGeneric;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
public setParentGeneric(parentGeneric: ParameterizableClass | ParameterizableInterface | Method | Accessor |
|
|
17
|
+
public setParentGeneric(parentGeneric: ParameterizableClass | ParameterizableInterface | Method | Accessor | FamixFunction): void {
|
|
18
18
|
this.parentGeneric = parentGeneric;
|
|
19
|
-
parentGeneric.
|
|
19
|
+
parentGeneric.addParameterType(this);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
public getJSON(): string {
|
|
24
|
-
const
|
|
25
|
-
this.addPropertiesToExporter(
|
|
26
|
-
return
|
|
24
|
+
const json: FamixJSONExporter = new FamixJSONExporter("ParameterType", this);
|
|
25
|
+
this.addPropertiesToExporter(json);
|
|
26
|
+
return json.getJSON();
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import { FamixJSONExporter } from "../../famix_JSON_exporter";
|
|
2
2
|
import { Class } from "./class";
|
|
3
|
-
import {
|
|
3
|
+
import { ParameterType } from "./parameter_type";
|
|
4
4
|
|
|
5
5
|
export class ParameterizableClass extends Class {
|
|
6
6
|
|
|
7
|
-
private
|
|
7
|
+
private parameterTypes: Set<ParameterType> = new Set();
|
|
8
8
|
|
|
9
|
-
public
|
|
10
|
-
return this.
|
|
9
|
+
public getParameterTypes(): Set<ParameterType> {
|
|
10
|
+
return this.parameterTypes;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
public
|
|
14
|
-
if (!this.
|
|
15
|
-
this.
|
|
16
|
-
|
|
13
|
+
public addParameterType(parameterType: ParameterType): void {
|
|
14
|
+
if (!this.parameterTypes.has(parameterType)) {
|
|
15
|
+
this.parameterTypes.add(parameterType);
|
|
16
|
+
parameterType.setParentGeneric(this);
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
public getJSON(): string {
|
|
22
|
-
const
|
|
23
|
-
this.addPropertiesToExporter(
|
|
24
|
-
return
|
|
22
|
+
const json: FamixJSONExporter = new FamixJSONExporter("ParameterizableClass", this);
|
|
23
|
+
this.addPropertiesToExporter(json);
|
|
24
|
+
return json.getJSON();
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
28
28
|
super.addPropertiesToExporter(exporter);
|
|
29
|
-
exporter.addProperty("
|
|
29
|
+
exporter.addProperty("parameterTypes", this.getParameterTypes());
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import { FamixJSONExporter } from "../../famix_JSON_exporter";
|
|
2
2
|
import { Interface } from "./interface";
|
|
3
|
-
import {
|
|
3
|
+
import { ParameterType } from "./parameter_type";
|
|
4
4
|
|
|
5
5
|
export class ParameterizableInterface extends Interface {
|
|
6
6
|
|
|
7
|
-
private
|
|
7
|
+
private parameterTypes: Set<ParameterType> = new Set();
|
|
8
8
|
|
|
9
|
-
public
|
|
10
|
-
return this.
|
|
9
|
+
public getParameterTypes(): Set<ParameterType> {
|
|
10
|
+
return this.parameterTypes;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
public
|
|
14
|
-
if (!this.
|
|
15
|
-
this.
|
|
16
|
-
|
|
13
|
+
public addParameterType(parameterType: ParameterType): void {
|
|
14
|
+
if (!this.parameterTypes.has(parameterType)) {
|
|
15
|
+
this.parameterTypes.add(parameterType);
|
|
16
|
+
parameterType.setParentGeneric(this);
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
public getJSON(): string {
|
|
22
|
-
const
|
|
23
|
-
this.addPropertiesToExporter(
|
|
24
|
-
return
|
|
22
|
+
const json: FamixJSONExporter = new FamixJSONExporter("ParameterizableInterface", this);
|
|
23
|
+
this.addPropertiesToExporter(json);
|
|
24
|
+
return json.getJSON();
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
28
28
|
super.addPropertiesToExporter(exporter);
|
|
29
|
-
exporter.addProperty("
|
|
29
|
+
exporter.addProperty("parameterTypes", this.getParameterTypes());
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -27,9 +27,9 @@ export class ParameterizedType extends Type {
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
public getJSON(): string {
|
|
30
|
-
const
|
|
31
|
-
this.addPropertiesToExporter(
|
|
32
|
-
return
|
|
30
|
+
const json: FamixJSONExporter = new FamixJSONExporter("ParameterizedType", this);
|
|
31
|
+
this.addPropertiesToExporter(json);
|
|
32
|
+
return json.getJSON();
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
@@ -4,9 +4,9 @@ import { Type } from "./type";
|
|
|
4
4
|
export class PrimitiveType extends Type {
|
|
5
5
|
|
|
6
6
|
public getJSON(): string {
|
|
7
|
-
const
|
|
8
|
-
this.addPropertiesToExporter(
|
|
9
|
-
return
|
|
7
|
+
const json: FamixJSONExporter = new FamixJSONExporter("PrimitiveType", this);
|
|
8
|
+
this.addPropertiesToExporter(json);
|
|
9
|
+
return json.getJSON();
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
@@ -40,9 +40,9 @@ export class Property extends StructuralEntity {
|
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
public getJSON(): string {
|
|
43
|
-
const
|
|
44
|
-
this.addPropertiesToExporter(
|
|
45
|
-
return
|
|
43
|
+
const json: FamixJSONExporter = new FamixJSONExporter("Property", this);
|
|
44
|
+
this.addPropertiesToExporter(json);
|
|
45
|
+
return json.getJSON();
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
@@ -29,9 +29,9 @@ export class Reference extends Association {
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
public getJSON(): string {
|
|
32
|
-
const
|
|
33
|
-
this.addPropertiesToExporter(
|
|
34
|
-
return
|
|
32
|
+
const json: FamixJSONExporter = new FamixJSONExporter("Reference", this);
|
|
33
|
+
this.addPropertiesToExporter(json);
|
|
34
|
+
return json.getJSON();
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { FamixJSONExporter } from "../../famix_JSON_exporter";
|
|
2
2
|
import { ContainerEntity } from "./container_entity";
|
|
3
3
|
import { Namespace } from "./namespace";
|
|
4
|
+
import { logger } from "../../../../../analyze";
|
|
4
5
|
|
|
5
6
|
export class ScopingEntity extends ContainerEntity {
|
|
6
7
|
|
|
@@ -12,19 +13,19 @@ export class ScopingEntity extends ContainerEntity {
|
|
|
12
13
|
|
|
13
14
|
public addNamespace(childNamespace: Namespace): void {
|
|
14
15
|
if (!this.childrenNamespaces.has(childNamespace)) {
|
|
15
|
-
|
|
16
|
+
logger.debug("Adding namespace " + childNamespace.getName() + " to " + this.getName());
|
|
16
17
|
this.childrenNamespaces.add(childNamespace);
|
|
17
18
|
childNamespace.setParentScope(this);
|
|
18
19
|
} else {
|
|
19
|
-
|
|
20
|
+
logger.debug("Namespace " + childNamespace.getName() + " already added to " + this.getName());
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
|
|
24
25
|
public getJSON(): string {
|
|
25
|
-
const
|
|
26
|
-
this.addPropertiesToExporter(
|
|
27
|
-
return
|
|
26
|
+
const json: FamixJSONExporter = new FamixJSONExporter("ScopingEntity", this);
|
|
27
|
+
this.addPropertiesToExporter(json);
|
|
28
|
+
return json.getJSON();
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
@@ -25,9 +25,9 @@ export class ScriptEntity extends ScopingEntity {
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
public getJSON(): string {
|
|
28
|
-
const
|
|
29
|
-
this.addPropertiesToExporter(
|
|
30
|
-
return
|
|
28
|
+
const json: FamixJSONExporter = new FamixJSONExporter("ScriptEntity", this);
|
|
29
|
+
this.addPropertiesToExporter(json);
|
|
30
|
+
return json.getJSON();
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
@@ -19,9 +19,9 @@ export class SourceAnchor extends Entity {
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
public getJSON(): string {
|
|
22
|
-
const
|
|
23
|
-
this.addPropertiesToExporter(
|
|
24
|
-
return
|
|
22
|
+
const json: FamixJSONExporter = new FamixJSONExporter("SourceAnchor", this);
|
|
23
|
+
this.addPropertiesToExporter(json);
|
|
24
|
+
return json.getJSON();
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
@@ -6,6 +6,11 @@ export class SourceLanguage extends Entity {
|
|
|
6
6
|
|
|
7
7
|
private sourcedEntities: Set<SourcedEntity> = new Set();
|
|
8
8
|
|
|
9
|
+
// name of the source language
|
|
10
|
+
get name(): string {
|
|
11
|
+
return "TypeScript";
|
|
12
|
+
}
|
|
13
|
+
|
|
9
14
|
public getSourcedEntities(): Set<SourcedEntity> {
|
|
10
15
|
return this.sourcedEntities;
|
|
11
16
|
}
|
|
@@ -19,13 +24,14 @@ export class SourceLanguage extends Entity {
|
|
|
19
24
|
|
|
20
25
|
|
|
21
26
|
public getJSON(): string {
|
|
22
|
-
const
|
|
23
|
-
this.addPropertiesToExporter(
|
|
24
|
-
return
|
|
27
|
+
const json: FamixJSONExporter = new FamixJSONExporter("SourceLanguage", this);
|
|
28
|
+
this.addPropertiesToExporter(json);
|
|
29
|
+
return json.getJSON();
|
|
25
30
|
}
|
|
26
31
|
|
|
27
32
|
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
28
33
|
super.addPropertiesToExporter(exporter);
|
|
34
|
+
exporter.addProperty("name", this.name);
|
|
29
35
|
exporter.addProperty("sourcedEntities", this.getSourcedEntities());
|
|
30
36
|
}
|
|
31
37
|
}
|
|
@@ -3,6 +3,7 @@ import { SourceLanguage } from "./source_language";
|
|
|
3
3
|
import { Entity } from "./entity";
|
|
4
4
|
import { Comment } from "./comment";
|
|
5
5
|
import { SourceAnchor } from "./source_anchor";
|
|
6
|
+
import { logger } from "../../../../../analyze";
|
|
6
7
|
|
|
7
8
|
export class SourcedEntity extends Entity {
|
|
8
9
|
|
|
@@ -39,6 +40,8 @@ export class SourcedEntity extends Entity {
|
|
|
39
40
|
if (!this.comments.has(comment)) {
|
|
40
41
|
this.comments.add(comment);
|
|
41
42
|
comment.setContainer(this);
|
|
43
|
+
} else {
|
|
44
|
+
logger.warn("WARNING: adding comment that is already in comments: " + comment.getJSON() + " to " + this.getJSON());
|
|
42
45
|
}
|
|
43
46
|
}
|
|
44
47
|
|
|
@@ -55,9 +58,9 @@ export class SourcedEntity extends Entity {
|
|
|
55
58
|
|
|
56
59
|
|
|
57
60
|
public getJSON(): string {
|
|
58
|
-
const
|
|
59
|
-
this.addPropertiesToExporter(
|
|
60
|
-
return
|
|
61
|
+
const json: FamixJSONExporter = new FamixJSONExporter("SourcedEntity", this);
|
|
62
|
+
this.addPropertiesToExporter(json);
|
|
63
|
+
return json.getJSON();
|
|
61
64
|
}
|
|
62
65
|
|
|
63
66
|
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
@@ -31,9 +31,9 @@ export class StructuralEntity extends NamedEntity {
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
public getJSON(): string {
|
|
34
|
-
const
|
|
35
|
-
this.addPropertiesToExporter(
|
|
36
|
-
return
|
|
34
|
+
const json: FamixJSONExporter = new FamixJSONExporter("StructuralEntity", this);
|
|
35
|
+
this.addPropertiesToExporter(json);
|
|
36
|
+
return json.getJSON();
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
@@ -35,9 +35,9 @@ export class TextAnchor extends SourceAnchor {
|
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
public getJSON(): string {
|
|
38
|
-
const
|
|
39
|
-
this.addPropertiesToExporter(
|
|
40
|
-
return
|
|
38
|
+
const json: FamixJSONExporter = new FamixJSONExporter("TextAnchor", this);
|
|
39
|
+
this.addPropertiesToExporter(json);
|
|
40
|
+
return json.getJSON();
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
@@ -72,9 +72,9 @@ export class Type extends ContainerEntity {
|
|
|
72
72
|
|
|
73
73
|
|
|
74
74
|
public getJSON(): string {
|
|
75
|
-
const
|
|
76
|
-
this.addPropertiesToExporter(
|
|
77
|
-
return
|
|
75
|
+
const json: FamixJSONExporter = new FamixJSONExporter("Type", this);
|
|
76
|
+
this.addPropertiesToExporter(json);
|
|
77
|
+
return json.getJSON();
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
@@ -16,9 +16,9 @@ export class Variable extends StructuralEntity {
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
public getJSON(): string {
|
|
19
|
-
const
|
|
20
|
-
this.addPropertiesToExporter(
|
|
21
|
-
return
|
|
19
|
+
const json: FamixJSONExporter = new FamixJSONExporter("Variable", this);
|
|
20
|
+
this.addPropertiesToExporter(json);
|
|
21
|
+
return json.getJSON();
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|