corba.js 0.2.0 → 0.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 +15 -14
- package/lib/idl/idl.cjs +1049 -1272
- package/lib/idl/idl.cjs.map +1 -1
- package/lib/idl/src/idl/cc/typeIDLtoCC.d.ts +4 -2
- package/lib/idl/src/idl/cc/typeIDLtoGIOPCC.d.ts +2 -2
- package/lib/idl/src/idl/cc/write-code.d.ts +2 -2
- package/lib/idl/src/idl/cc/write-interface.d.ts +4 -4
- package/lib/idl/src/idl/cc/write-skeleton.d.ts +2 -2
- package/lib/idl/src/idl/cc/write-stub.d.ts +2 -2
- package/lib/idl/src/idl/idl-lexer.d.ts +9 -4
- package/lib/idl/src/idl/idl-node.d.ts +157 -28
- package/lib/idl/src/idl/idl-parser.d.ts +2 -2
- package/lib/idl/src/idl/ts/typeIDLtoGIOPTS.d.ts +2 -2
- package/lib/idl/src/idl/ts/typeIDLtoTS.d.ts +3 -2
- package/lib/idl/src/idl/ts/write-interface.d.ts +2 -2
- package/lib/idl/src/idl/ts/write-skeleton.d.ts +2 -2
- package/lib/idl/src/idl/ts/write-stub.d.ts +2 -2
- package/lib/idl/src/idl/ts/write-value.d.ts +2 -2
- package/lib/idl/src/idl/ts/write-valueimpl.d.ts +2 -2
- package/lib/idl/src/idl/ts/write-valuetype.d.ts +2 -2
- package/lib/idl/src/idl/util.d.ts +11 -4
- package/lib/src/idl/cc/typeIDLtoCC.d.ts +4 -2
- package/lib/src/idl/cc/typeIDLtoCC.js +32 -29
- package/lib/src/idl/cc/typeIDLtoCC.js.map +1 -1
- package/lib/src/idl/cc/typeIDLtoGIOPCC.d.ts +2 -2
- package/lib/src/idl/cc/typeIDLtoGIOPCC.js +14 -18
- package/lib/src/idl/cc/typeIDLtoGIOPCC.js.map +1 -1
- package/lib/src/idl/cc/write-code.d.ts +2 -2
- package/lib/src/idl/cc/write-code.js +42 -69
- package/lib/src/idl/cc/write-code.js.map +1 -1
- package/lib/src/idl/cc/write-interface.d.ts +4 -4
- package/lib/src/idl/cc/write-interface.js +64 -65
- package/lib/src/idl/cc/write-interface.js.map +1 -1
- package/lib/src/idl/cc/write-skeleton.d.ts +2 -2
- package/lib/src/idl/cc/write-skeleton.js +6 -7
- package/lib/src/idl/cc/write-skeleton.js.map +1 -1
- package/lib/src/idl/cc/write-stub.d.ts +2 -2
- package/lib/src/idl/cc/write-stub.js +17 -26
- package/lib/src/idl/cc/write-stub.js.map +1 -1
- package/lib/src/idl/idl-lexer.d.ts +9 -4
- package/lib/src/idl/idl-lexer.js +124 -76
- package/lib/src/idl/idl-lexer.js.map +1 -1
- package/lib/src/idl/idl-node.d.ts +157 -28
- package/lib/src/idl/idl-node.js +12 -142
- package/lib/src/idl/idl-node.js.map +1 -1
- package/lib/src/idl/idl-parser.d.ts +2 -2
- package/lib/src/idl/idl-parser.js +379 -454
- package/lib/src/idl/idl-parser.js.map +1 -1
- package/lib/src/idl/idl.js +0 -2
- package/lib/src/idl/idl.js.map +1 -1
- package/lib/src/idl/ts/typeIDLtoGIOPTS.d.ts +2 -2
- package/lib/src/idl/ts/typeIDLtoGIOPTS.js +16 -21
- package/lib/src/idl/ts/typeIDLtoGIOPTS.js.map +1 -1
- package/lib/src/idl/ts/typeIDLtoTS.d.ts +3 -2
- package/lib/src/idl/ts/typeIDLtoTS.js +54 -69
- package/lib/src/idl/ts/typeIDLtoTS.js.map +1 -1
- package/lib/src/idl/ts/write-interface.d.ts +2 -2
- package/lib/src/idl/ts/write-interface.js +89 -90
- package/lib/src/idl/ts/write-interface.js.map +1 -1
- package/lib/src/idl/ts/write-skeleton.d.ts +2 -2
- package/lib/src/idl/ts/write-skeleton.js +24 -33
- package/lib/src/idl/ts/write-skeleton.js.map +1 -1
- package/lib/src/idl/ts/write-stub.d.ts +2 -2
- package/lib/src/idl/ts/write-stub.js +26 -35
- package/lib/src/idl/ts/write-stub.js.map +1 -1
- package/lib/src/idl/ts/write-value.d.ts +2 -2
- package/lib/src/idl/ts/write-value.js +39 -59
- package/lib/src/idl/ts/write-value.js.map +1 -1
- package/lib/src/idl/ts/write-valueimpl.d.ts +2 -2
- package/lib/src/idl/ts/write-valueimpl.js +33 -50
- package/lib/src/idl/ts/write-valueimpl.js.map +1 -1
- package/lib/src/idl/ts/write-valuetype.d.ts +2 -2
- package/lib/src/idl/ts/write-valuetype.js +20 -29
- package/lib/src/idl/ts/write-valuetype.js.map +1 -1
- package/lib/src/idl/util.d.ts +11 -4
- package/lib/src/idl/util.js +71 -12
- package/lib/src/idl/util.js.map +1 -1
- package/package.json +10 -10
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as fs from "fs";
|
|
2
2
|
import { Type } from "../idl-node.js";
|
|
3
|
-
import { filenamePrefix, filename, filenameLocal, hasValueType, FileType } from "../util.js";
|
|
3
|
+
import { filenamePrefix, filename, filenameLocal, hasValueType, FileType, writtenName } from "../util.js";
|
|
4
4
|
import { typeIDLtoGIOPTS } from "./typeIDLtoGIOPTS.js";
|
|
5
5
|
import { typeIDLtoTS } from "./typeIDLtoTS.js";
|
|
6
6
|
export function writeTSStub(specification) {
|
|
@@ -11,53 +11,48 @@ export function writeTSStub(specification) {
|
|
|
11
11
|
out.write("import * as valuetype from \"./" + filenameLocal + "_valuetype\"\n");
|
|
12
12
|
}
|
|
13
13
|
out.write("import * as _interface from \"./" + filenameLocal + "\"\n\n");
|
|
14
|
-
writeTSStubDefinitions(out, specification);
|
|
14
|
+
writeTSStubDefinitions(out, specification.definitions);
|
|
15
15
|
}
|
|
16
|
-
function writeTSStubDefinitions(out,
|
|
17
|
-
for (let definition of
|
|
16
|
+
function writeTSStubDefinitions(out, definitions, prefix = "", indent = 0) {
|
|
17
|
+
for (let definition of definitions) {
|
|
18
18
|
switch (definition.type) {
|
|
19
19
|
case Type.TKN_MODULE:
|
|
20
|
-
out.write("export namespace " + definition.
|
|
21
|
-
writeTSStubDefinitions(out, definition, prefix + definition.
|
|
22
|
-
out.write("} // namespace " + definition.
|
|
20
|
+
out.write("export namespace " + definition.name + " {\n\n");
|
|
21
|
+
writeTSStubDefinitions(out, definition.definitions, prefix + definition.name + ".", indent + 1);
|
|
22
|
+
out.write("} // namespace " + definition.name + "\n\n");
|
|
23
23
|
break;
|
|
24
24
|
case Type.SYN_INTERFACE:
|
|
25
25
|
{
|
|
26
26
|
let interface_dcl = definition;
|
|
27
|
-
let identifier = interface_dcl.
|
|
28
|
-
let inheritance_spec = interface_dcl.
|
|
29
|
-
let interface_body = interface_dcl.
|
|
30
|
-
out.write(`export class ${identifier} extends ${inheritance_spec ? inheritance_spec : "Stub"} implements _interface.${prefix}${identifier} {\n`);
|
|
27
|
+
let identifier = interface_dcl.name;
|
|
28
|
+
let inheritance_spec = interface_dcl.base === undefined ? undefined : writtenName(interface_dcl.base);
|
|
29
|
+
let interface_body = interface_dcl.body;
|
|
30
|
+
out.write(`export class ${identifier}_stub extends ${inheritance_spec ? inheritance_spec + "_stub" : "Stub"} implements _interface.${prefix}${identifier} {\n`);
|
|
31
31
|
out.write(` static ${inheritance_spec ? "override " : ""}_idlClassName(): string {\n`);
|
|
32
32
|
out.write(` return "${prefix}${identifier}"\n`);
|
|
33
33
|
out.write(` }\n\n`);
|
|
34
|
-
out.write(` static ${inheritance_spec ? "override " : ""}narrow(object: any): ${prefix}${identifier} {\n`);
|
|
35
|
-
out.write(` if (object instanceof ${prefix}${identifier})\n`);
|
|
36
|
-
out.write(` return object as ${prefix}${identifier}\n`);
|
|
34
|
+
out.write(` static ${inheritance_spec ? "override " : ""}narrow(object: any): ${prefix}${identifier}_stub {\n`);
|
|
35
|
+
out.write(` if (object instanceof ${prefix}${identifier}_stub)\n`);
|
|
36
|
+
out.write(` return object as ${prefix}${identifier}_stub\n`);
|
|
37
37
|
out.write(` throw Error("${prefix}${identifier}.narrow() failed")\n`);
|
|
38
38
|
out.write(` }\n\n`);
|
|
39
|
-
for (let _export of interface_body
|
|
39
|
+
for (let _export of interface_body) {
|
|
40
40
|
switch (_export.type) {
|
|
41
41
|
case Type.SYN_OPERATION_DECLARATION:
|
|
42
42
|
{
|
|
43
43
|
let op_dcl = _export;
|
|
44
|
-
let
|
|
45
|
-
let returnType = op_dcl.
|
|
46
|
-
let oneway = false;
|
|
47
|
-
if (attribute !== undefined && attribute.type === Type.TKN_ONEWAY)
|
|
48
|
-
oneway = true;
|
|
44
|
+
let oneway = op_dcl.oneway;
|
|
45
|
+
let returnType = op_dcl.returnType;
|
|
49
46
|
if (oneway && returnType.type !== Type.TKN_VOID)
|
|
50
47
|
console.log("WARNING: corba.js currently requires every oneway function to return void");
|
|
51
|
-
let identifier = op_dcl.
|
|
52
|
-
let parameter_decls = op_dcl.
|
|
48
|
+
let identifier = op_dcl.name;
|
|
49
|
+
let parameter_decls = op_dcl.params;
|
|
53
50
|
out.write(" async ");
|
|
54
51
|
out.write(identifier + "(");
|
|
55
52
|
let comma = false;
|
|
56
53
|
for (let parameter_dcl of parameter_decls) {
|
|
57
|
-
let
|
|
58
|
-
|
|
59
|
-
let identifier = parameter_dcl.child[2].text;
|
|
60
|
-
if (attribute !== Type.TKN_IN) {
|
|
54
|
+
let identifier = parameter_dcl.name;
|
|
55
|
+
if (parameter_dcl.attribute !== Type.TKN_IN) {
|
|
61
56
|
throw Error("corba.js currently only supports 'in' parameters");
|
|
62
57
|
}
|
|
63
58
|
if (!comma) {
|
|
@@ -66,7 +61,7 @@ function writeTSStubDefinitions(out, specification, prefix = "", indent = 0) {
|
|
|
66
61
|
else {
|
|
67
62
|
out.write(", ");
|
|
68
63
|
}
|
|
69
|
-
out.write(`${identifier}: ${typeIDLtoTS(
|
|
64
|
+
out.write(`${identifier}: ${typeIDLtoTS(parameter_dcl.typeSpec, FileType.STUB)}`);
|
|
70
65
|
}
|
|
71
66
|
out.write(`): Promise<${typeIDLtoTS(returnType, FileType.STUB)}> {\n`);
|
|
72
67
|
out.write(" ");
|
|
@@ -82,9 +77,7 @@ function writeTSStubDefinitions(out, specification, prefix = "", indent = 0) {
|
|
|
82
77
|
}
|
|
83
78
|
out.write(`(encoder) => {\n`);
|
|
84
79
|
for (let parameter_dcl of parameter_decls) {
|
|
85
|
-
|
|
86
|
-
let identifier = parameter_dcl.child[2].text;
|
|
87
|
-
out.write(` ${typeIDLtoGIOPTS(type, identifier)}\n`);
|
|
80
|
+
out.write(` ${typeIDLtoGIOPTS(parameter_dcl.typeSpec, parameter_dcl.name)}\n`);
|
|
88
81
|
}
|
|
89
82
|
if (oneway) {
|
|
90
83
|
out.write(` })\n`);
|
|
@@ -104,11 +97,9 @@ function writeTSStubDefinitions(out, specification, prefix = "", indent = 0) {
|
|
|
104
97
|
break;
|
|
105
98
|
case Type.TKN_ATTRIBUTE:
|
|
106
99
|
{
|
|
107
|
-
const readonly = _export.
|
|
108
|
-
const param_type_spec = _export.
|
|
109
|
-
const
|
|
110
|
-
for (const n of attr_declarator.child) {
|
|
111
|
-
const identifier = n.text;
|
|
100
|
+
const readonly = _export.readonly;
|
|
101
|
+
const param_type_spec = _export.typeSpec;
|
|
102
|
+
for (const identifier of _export.names) {
|
|
112
103
|
const type = typeIDLtoTS(param_type_spec, FileType.STUB);
|
|
113
104
|
if (readonly) {
|
|
114
105
|
out.write(` async ${identifier}(): Promise<${type}> {\n`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write-stub.js","sourceRoot":"","sources":["../../../../src/idl/ts/write-stub.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"write-stub.js","sourceRoot":"","sources":["../../../../src/idl/ts/write-stub.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,EAAE,IAAI,EAA6B,uBAAmB;AAC7D,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,mBAAe;AACt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F,GAAG,CAAC,KAAK,CAAC,iCAAiC,eAAe,CAAC,eAAe,EAAE,SAAS,CAAC,MAAM,CAAC,CAAA;4CAC7F,GAAG,CAAC,KAAK,CAAC,oCAAoC,CAAC,CAAA;4CAC/C,GAAG,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAA;4CAC5B,GAAG,CAAC,KAAK,CAAC,aAAa,CAAC,CAAA;4CACxB,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA;wCACxB,CAAC;oCACL,CAAC;gCAEL,CAAC;gCAAC,MAAK;4BACP;gCACI,MAAM,KAAK,CAAC,OAAO,CAAC,CAAA;wBAC5B,CAAC;oBACL,CAAC;oBACD,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;gBACtB,CAAC;gBAAC,MAAK;QACX,CAAC;IACL,CAAC;AACL,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function writeTSValue(specification:
|
|
1
|
+
import { Specification } from "../idl-node";
|
|
2
|
+
export declare function writeTSValue(specification: Specification): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as fs from "fs";
|
|
2
2
|
import { Type } from "../idl-node.js";
|
|
3
|
-
import { filenamePrefix, filename, filenameLocal, hasNative, hasValueType, writeIndent, classAttributes, FileType, defaultValueIDLtoTS } from "../util.js";
|
|
3
|
+
import { filenamePrefix, filename, filenameLocal, hasNative, hasValueType, writeIndent, writeDoc, classAttributes, FileType, defaultValueIDLtoTS, writtenName, resolvedTarget, predefinedTypes, isPointerName } from "../util.js";
|
|
4
4
|
import { typeIDLtoGIOPTS } from "./typeIDLtoGIOPTS.js";
|
|
5
5
|
import { typeIDLtoTS } from "./typeIDLtoTS.js";
|
|
6
6
|
let initCalls = "";
|
|
@@ -16,10 +16,9 @@ export function writeTSValue(specification) {
|
|
|
16
16
|
}
|
|
17
17
|
if (hasNative(specification)) {
|
|
18
18
|
out.write("declare global {\n");
|
|
19
|
-
for (let definition of specification.
|
|
19
|
+
for (let definition of specification.definitions) {
|
|
20
20
|
if (definition.type === Type.TKN_NATIVE) {
|
|
21
|
-
let
|
|
22
|
-
let nativeName = native.text;
|
|
21
|
+
let nativeName = definition.name;
|
|
23
22
|
if (nativeName.length <= 4 ||
|
|
24
23
|
nativeName.substring(nativeName.length - 4) !== "_ptr") {
|
|
25
24
|
out.write(` interface ${nativeName} {}\n`);
|
|
@@ -28,7 +27,7 @@ export function writeTSValue(specification) {
|
|
|
28
27
|
}
|
|
29
28
|
out.write("}\n\n");
|
|
30
29
|
}
|
|
31
|
-
writeTSValueDefinitions(out, specification);
|
|
30
|
+
writeTSValueDefinitions(out, specification.definitions);
|
|
32
31
|
out.write("let initialized = false\n");
|
|
33
32
|
out.write("export function _init() {\n");
|
|
34
33
|
out.write(" if (initialized)\n");
|
|
@@ -38,16 +37,16 @@ export function writeTSValue(specification) {
|
|
|
38
37
|
out.write("}\n");
|
|
39
38
|
out.write("_init()\n");
|
|
40
39
|
}
|
|
41
|
-
function writeTSValueDefinitions(out,
|
|
42
|
-
for (let definition of
|
|
40
|
+
function writeTSValueDefinitions(out, definitions, prefix = "", indent = 0) {
|
|
41
|
+
for (let definition of definitions) {
|
|
43
42
|
switch (definition.type) {
|
|
44
43
|
case Type.TKN_MODULE:
|
|
45
44
|
{
|
|
46
45
|
writeIndent(out, indent);
|
|
47
|
-
out.write(`export namespace ${definition.
|
|
48
|
-
writeTSValueDefinitions(out, definition, prefix + definition.
|
|
46
|
+
out.write(`export namespace ${definition.name} {\n\n`);
|
|
47
|
+
writeTSValueDefinitions(out, definition.definitions, prefix + definition.name + ".", indent + 1);
|
|
49
48
|
writeIndent(out, indent);
|
|
50
|
-
out.write(`} // namespace ${definition.
|
|
49
|
+
out.write(`} // namespace ${definition.name}\n\n`);
|
|
51
50
|
}
|
|
52
51
|
break;
|
|
53
52
|
case Type.TKN_NATIVE:
|
|
@@ -57,21 +56,20 @@ function writeTSValueDefinitions(out, specification, prefix = "", indent = 0) {
|
|
|
57
56
|
case Type.TKN_VALUETYPE:
|
|
58
57
|
{
|
|
59
58
|
let value_dcl = definition;
|
|
60
|
-
let
|
|
61
|
-
|
|
62
|
-
let identifier = value_header.child[1].text;
|
|
63
|
-
let inheritance_spec = value_header.child[2];
|
|
59
|
+
let identifier = value_dcl.name;
|
|
60
|
+
writeDoc(out, value_dcl.doc, indent);
|
|
64
61
|
writeIndent(out, indent);
|
|
65
62
|
out.write(`export interface ${identifier}`);
|
|
66
63
|
let attributes = new Array();
|
|
67
64
|
classAttributes.set(prefix + identifier, attributes);
|
|
68
|
-
if (
|
|
69
|
-
if (
|
|
65
|
+
if (value_dcl.base.length > 0) {
|
|
66
|
+
if (value_dcl.base.length > 1)
|
|
70
67
|
throw Error("multiple inheritance is not supported for TypeScript");
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
const base = writtenName(value_dcl.base[0]);
|
|
69
|
+
out.write(` extends ${base}`);
|
|
70
|
+
let superAttributes = classAttributes.get(prefix + base);
|
|
73
71
|
if (superAttributes === undefined) {
|
|
74
|
-
superAttributes = classAttributes.get(
|
|
72
|
+
superAttributes = classAttributes.get(base);
|
|
75
73
|
}
|
|
76
74
|
if (superAttributes === undefined) {
|
|
77
75
|
throw Error("failed to find attributes for super class");
|
|
@@ -81,17 +79,13 @@ function writeTSValueDefinitions(out, specification, prefix = "", indent = 0) {
|
|
|
81
79
|
}
|
|
82
80
|
}
|
|
83
81
|
out.write(" {\n");
|
|
84
|
-
for (let
|
|
85
|
-
let value_element = value_dcl.child[i];
|
|
82
|
+
for (let value_element of value_dcl.elements) {
|
|
86
83
|
if (value_element.type === Type.SYN_STATE_MEMBER) {
|
|
87
|
-
|
|
88
|
-
let
|
|
89
|
-
let type = state_member.child[1];
|
|
90
|
-
let declarators = state_member.child[2];
|
|
91
|
-
for (let declarator of declarators.child) {
|
|
84
|
+
writeDoc(out, value_element.doc, indent + 1);
|
|
85
|
+
for (let declarator of value_element.names) {
|
|
92
86
|
writeIndent(out, indent + 1);
|
|
93
|
-
out.write(declarator
|
|
94
|
-
attributes.push(declarator
|
|
87
|
+
out.write(declarator + ": " + typeIDLtoTS(value_element.typeSpec, FileType.VALUE) + "\n");
|
|
88
|
+
attributes.push(declarator);
|
|
95
89
|
}
|
|
96
90
|
}
|
|
97
91
|
}
|
|
@@ -116,20 +110,16 @@ function writeTSValueDefinitions(out, specification, prefix = "", indent = 0) {
|
|
|
116
110
|
writeIndent(out, indent);
|
|
117
111
|
out.write(`export function encode${identifier}(encoder: GIOPEncoder, obj: ${identifier}) {\n`);
|
|
118
112
|
++indent;
|
|
119
|
-
if (
|
|
113
|
+
if (value_dcl.base.length > 0) {
|
|
120
114
|
writeIndent(out, indent);
|
|
121
|
-
|
|
115
|
+
const base = value_dcl.base[0];
|
|
116
|
+
out.write(`${base.path.map(module => module.name + ".").join("")}encode${base.name}(encoder, obj)\n`);
|
|
122
117
|
}
|
|
123
|
-
for (let
|
|
124
|
-
let value_element = value_dcl.child[i];
|
|
118
|
+
for (let value_element of value_dcl.elements) {
|
|
125
119
|
if (value_element.type === Type.SYN_STATE_MEMBER) {
|
|
126
|
-
let
|
|
127
|
-
let attribute = state_member.child[0];
|
|
128
|
-
let type = state_member.child[1];
|
|
129
|
-
let declarators = state_member.child[2];
|
|
130
|
-
for (let declarator of declarators.child) {
|
|
120
|
+
for (let declarator of value_element.names) {
|
|
131
121
|
writeIndent(out, indent);
|
|
132
|
-
out.write(`${typeIDLtoGIOPTS(
|
|
122
|
+
out.write(`${typeIDLtoGIOPTS(value_element.typeSpec, "obj." + declarator)}\n`);
|
|
133
123
|
}
|
|
134
124
|
}
|
|
135
125
|
}
|
|
@@ -154,39 +144,29 @@ function writeTSValueDefinitions(out, specification, prefix = "", indent = 0) {
|
|
|
154
144
|
}
|
|
155
145
|
}
|
|
156
146
|
function writeTSInitValueFromGIOP(value_dcl, out, indent) {
|
|
157
|
-
for (let
|
|
158
|
-
let value_element = value_dcl.child[i];
|
|
147
|
+
for (let value_element of value_dcl.elements) {
|
|
159
148
|
if (value_element.type === Type.SYN_STATE_MEMBER) {
|
|
160
|
-
let
|
|
161
|
-
let type = state_member.child[1];
|
|
162
|
-
let declarators = state_member.child[2];
|
|
163
|
-
for (let declarator of declarators.child) {
|
|
164
|
-
let decl_identifier = declarator.text;
|
|
149
|
+
for (let declarator of value_element.names) {
|
|
165
150
|
writeIndent(out, indent);
|
|
166
|
-
out.write(`object.${
|
|
151
|
+
out.write(`object.${declarator} = ${typeIDLtoGIOPTS(value_element.typeSpec)}\n`);
|
|
167
152
|
}
|
|
168
153
|
}
|
|
169
154
|
}
|
|
170
155
|
}
|
|
171
156
|
function writeTSInitValueFromPOJO(value_dcl, out, indent) {
|
|
172
|
-
for (let
|
|
173
|
-
let value_element = value_dcl.child[i];
|
|
157
|
+
for (let value_element of value_dcl.elements) {
|
|
174
158
|
if (value_element.type === Type.SYN_STATE_MEMBER) {
|
|
175
|
-
let
|
|
176
|
-
let
|
|
177
|
-
|
|
178
|
-
let declarators = state_member.child[2];
|
|
179
|
-
for (let declarator of declarators.child) {
|
|
180
|
-
let decl_identifier = declarator.text;
|
|
159
|
+
let type = value_element.typeSpec;
|
|
160
|
+
for (let declarator of value_element.names) {
|
|
161
|
+
let decl_identifier = declarator;
|
|
181
162
|
writeIndent(out, indent);
|
|
182
|
-
if (type.type === Type.
|
|
183
|
-
if (type.
|
|
184
|
-
type.
|
|
185
|
-
type.text.substring(type.text.length - 4) === "_ptr") {
|
|
163
|
+
if (type.type === Type.SYN_SCOPED_NAME && !predefinedTypes.includes(resolvedTarget(type).type)) {
|
|
164
|
+
if (type.target.type == Type.TKN_NATIVE &&
|
|
165
|
+
isPointerName(type.name)) {
|
|
186
166
|
let name = typeIDLtoTS(type, FileType.VALUE);
|
|
187
167
|
out.write(`if (init !== undefined && init.${decl_identifier} !== undefined) object.${decl_identifier} = new (ORB.lookupValueType("${name}"))(init.${decl_identifier})\n`);
|
|
188
168
|
}
|
|
189
|
-
else if (type.
|
|
169
|
+
else if (resolvedTarget(type).type == Type.TKN_SEQUENCE) {
|
|
190
170
|
out.write(`object.${decl_identifier} = init?.${decl_identifier} instanceof Array ? init!.${decl_identifier} : []\n`);
|
|
191
171
|
}
|
|
192
172
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write-value.js","sourceRoot":"","sources":["../../../../src/idl/ts/write-value.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"write-value.js","sourceRoot":"","sources":["../../../../src/idl/ts/write-value.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,EAAE,IAAI,EAA4C,uBAAmB;AAC5E,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,eAAe,EAAE,QAAQ,EAAE,mBAAmB,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,EAAE,aAAa,EAAE,mBAAe;AAC9N,OAAO,EAAE,eAAe,EAAE,6BAAyB;AACnD,OAAO,EAAE,WAAW,EAAE,yBAAqB;AAE3C,IAAI,SAAS,GAAG,EAAE,CAAA;AAClB,MAAM,UAAU,YAAY,CAAC,aAA4B;IACrD,SAAS,GAAG,EAAE,CAAA;IAEd,IAAI,GAAG,GAAG,EAAE,CAAC,iBAAiB,CAAC,cAAc,GAAG,WAAW,CAAC,CAAA;IAC5D,GAAG,CAAC,KAAK,CAAC,gEAAgE,QAAQ,QAAQ,CAAC,CAAA;IAC3F,GAAG,CAAC,KAAK,CAAC,4DAA4D,CAAC,CAAA;IACvE,GAAG,CAAC,KAAK,CAAC,kCAAkC,GAAG,aAAa,GAAG,QAAQ,CAAC,CAAA;IACxE,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,EAAE,CAAC;QAC/B,GAAG,CAAC,KAAK,C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AA;oBAC7K,CAAC;yBACD,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;wBACjD,GAAG,CAAC,KAAK,CAAC,UAAU,eAAe,YAAY,eAAe,6BAA6B,eAAe,SAAS,CAAC,CAAA;oBACxH,CAAC;yBAAM,CAAC;wBACJ,IAAI,IAAI,GAAG,WAAW,CAAC,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAA;wBAC5C,GAAG,CAAC,KAAK,CAAC,WAAW,eAAe,2BAA2B,IAAI,MAAM,CAAC,CAAA;wBAC1E,WAAW,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;wBACxB,GAAG,CAAC,KAAK,CAAC,UAAU,eAAe,QAAQ,eAAe,kCAAkC,eAAe,aAAa,eAAe,aAAa,eAAe,WAAW,eAAe,KAAK,CAAC,CAAA;oBACvM,CAAC;gBACL,CAAC;qBAAM,CAAC;oBACJ,GAAG,CAAC,KAAK,CAAC,UAAU,eAAe,kCAAkC,eAAe,oBAAoB,CAAC,CAAA;oBACzG,GAAG,CAAC,KAAK,CAAC,mBAAmB,CAAC,IAAI,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAA;oBACxD,GAAG,CAAC,KAAK,CAAC,WAAW,eAAe,IAAI,CAAC,CAAA;gBAC7C,CAAC;YACL,CAAC;QACL,CAAC;IACL,CAAC;AACL,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function writeTSValueImpl(specification:
|
|
1
|
+
import { Specification } from "../idl-node";
|
|
2
|
+
export declare function writeTSValueImpl(specification: Specification): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as fs from "fs";
|
|
2
2
|
import { Type } from "../idl-node.js";
|
|
3
|
-
import { filenamePrefix, filename, filenameLocal, hasNative, hasValueType, writeIndent, FileType } from "../util.js";
|
|
3
|
+
import { filenamePrefix, filename, filenameLocal, hasNative, hasValueType, writeIndent, FileType, writtenName } from "../util.js";
|
|
4
4
|
import { typeIDLtoTS } from "./typeIDLtoTS.js";
|
|
5
5
|
export function writeTSValueImpl(specification) {
|
|
6
6
|
let out = fs.createWriteStream(filenamePrefix + "_valueimpl.ts");
|
|
@@ -15,12 +15,11 @@ export function writeTSValueImpl(specification) {
|
|
|
15
15
|
out.write(`import * as _interface from "./${filenameLocal}"\n\n`);
|
|
16
16
|
if (hasNative(specification)) {
|
|
17
17
|
out.write("declare global {\n");
|
|
18
|
-
for (let definition of specification.
|
|
18
|
+
for (let definition of specification.definitions) {
|
|
19
19
|
switch (definition.type) {
|
|
20
20
|
case Type.TKN_NATIVE:
|
|
21
21
|
{
|
|
22
|
-
let
|
|
23
|
-
let nativeName = native.text;
|
|
22
|
+
let nativeName = definition.name;
|
|
24
23
|
if (nativeName.length <= 4 ||
|
|
25
24
|
nativeName.substring(nativeName.length - 4) !== "_ptr") {
|
|
26
25
|
out.write(" interface " + nativeName + " {}\n");
|
|
@@ -31,35 +30,32 @@ export function writeTSValueImpl(specification) {
|
|
|
31
30
|
}
|
|
32
31
|
out.write("}\n\n");
|
|
33
32
|
}
|
|
34
|
-
writeTSValueImplDefinitions(out, specification);
|
|
33
|
+
writeTSValueImplDefinitions(out, specification.definitions);
|
|
35
34
|
}
|
|
36
35
|
function hasOperationDeclarations(value_dcl) {
|
|
37
|
-
for (let
|
|
38
|
-
let value_element = value_dcl.child[i];
|
|
36
|
+
for (let value_element of value_dcl.elements) {
|
|
39
37
|
if (value_element.type === Type.SYN_OPERATION_DECLARATION) {
|
|
40
38
|
return true;
|
|
41
39
|
}
|
|
42
40
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
let value_dcl = inheritance_spec.child[1].child[0];
|
|
48
|
-
if (hasOperationDeclarations(value_dcl)) {
|
|
41
|
+
if (value_dcl.base.length > 0) {
|
|
42
|
+
const base = value_dcl.base[0].target;
|
|
43
|
+
if (base.type === Type.TKN_VALUETYPE) {
|
|
44
|
+
if (hasOperationDeclarations(base)) {
|
|
49
45
|
return true;
|
|
50
46
|
}
|
|
51
47
|
}
|
|
52
48
|
}
|
|
53
49
|
return false;
|
|
54
50
|
}
|
|
55
|
-
function writeTSValueImplDefinitions(out,
|
|
56
|
-
for (let definition of
|
|
51
|
+
function writeTSValueImplDefinitions(out, definitions, prefix = "", indent = 0) {
|
|
52
|
+
for (let definition of definitions) {
|
|
57
53
|
switch (definition.type) {
|
|
58
54
|
case Type.TKN_MODULE:
|
|
59
55
|
{
|
|
60
|
-
out.write("export namespace " + definition.
|
|
61
|
-
writeTSValueImplDefinitions(out, definition, prefix + definition.
|
|
62
|
-
out.write("} // namespace " + definition.
|
|
56
|
+
out.write("export namespace " + definition.name + " {\n\n");
|
|
57
|
+
writeTSValueImplDefinitions(out, definition.definitions, prefix + definition.name + ".", indent + 1);
|
|
58
|
+
out.write("} // namespace " + definition.name + "\n\n");
|
|
63
59
|
}
|
|
64
60
|
break;
|
|
65
61
|
case Type.TKN_NATIVE:
|
|
@@ -69,45 +65,37 @@ function writeTSValueImplDefinitions(out, specification, prefix = "", indent = 0
|
|
|
69
65
|
case Type.TKN_VALUETYPE:
|
|
70
66
|
{
|
|
71
67
|
let value_dcl = definition;
|
|
72
|
-
let
|
|
73
|
-
let custom = value_header.child[0];
|
|
74
|
-
let identifier = value_header.child[1].text;
|
|
75
|
-
let inheritance_spec = value_header.child[2];
|
|
68
|
+
let identifier = value_dcl.name;
|
|
76
69
|
writeIndent(out, indent);
|
|
77
70
|
out.write("export ");
|
|
78
71
|
if (hasOperationDeclarations(value_dcl))
|
|
79
72
|
out.write("abstract ");
|
|
80
|
-
else if (
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
if (hasOperationDeclarations(
|
|
73
|
+
else if (value_dcl.base.length > 0) {
|
|
74
|
+
const base = value_dcl.base[0].target;
|
|
75
|
+
if (base.type === Type.TKN_VALUETYPE) {
|
|
76
|
+
if (hasOperationDeclarations(base))
|
|
84
77
|
out.write("abstract ");
|
|
85
78
|
}
|
|
86
79
|
}
|
|
87
80
|
out.write("class " + identifier);
|
|
88
|
-
if (
|
|
89
|
-
if (
|
|
81
|
+
if (value_dcl.base.length > 0) {
|
|
82
|
+
if (value_dcl.base.length > 1)
|
|
90
83
|
throw Error("multiple inheritance is not supported for TypeScript");
|
|
91
|
-
out.write(" extends " +
|
|
84
|
+
out.write(" extends " + writtenName(value_dcl.base[0]));
|
|
92
85
|
}
|
|
93
86
|
out.write(` implements valuetype.${prefix}${identifier} {\n`);
|
|
94
|
-
for (let
|
|
95
|
-
let value_element = value_dcl.child[i];
|
|
87
|
+
for (let value_element of value_dcl.elements) {
|
|
96
88
|
if (value_element.type === Type.SYN_STATE_MEMBER) {
|
|
97
|
-
let
|
|
98
|
-
let attribute = state_member.child[0];
|
|
99
|
-
let type = state_member.child[1];
|
|
100
|
-
let declarators = state_member.child[2];
|
|
101
|
-
for (let declarator of declarators.child) {
|
|
89
|
+
for (let declarator of value_element.names) {
|
|
102
90
|
writeIndent(out, indent + 1);
|
|
103
|
-
out.write(declarator
|
|
91
|
+
out.write(declarator + "!: " + typeIDLtoTS(value_element.typeSpec, FileType.VALUETYPE) + "\n");
|
|
104
92
|
}
|
|
105
93
|
}
|
|
106
94
|
}
|
|
107
95
|
out.write("\n");
|
|
108
96
|
writeIndent(out, indent + 1);
|
|
109
97
|
out.write(`constructor(init?: Partial<value.${prefix}${identifier}>) {\n`);
|
|
110
|
-
if (
|
|
98
|
+
if (value_dcl.base.length > 0) {
|
|
111
99
|
writeIndent(out, indent + 2);
|
|
112
100
|
out.write("super(init)\n");
|
|
113
101
|
}
|
|
@@ -115,23 +103,18 @@ function writeTSValueImplDefinitions(out, specification, prefix = "", indent = 0
|
|
|
115
103
|
out.write(`value.${prefix}init${identifier}(this, init)\n`);
|
|
116
104
|
writeIndent(out, indent + 1);
|
|
117
105
|
out.write("}\n");
|
|
118
|
-
for (let
|
|
119
|
-
let value_element = value_dcl.child[i];
|
|
106
|
+
for (let value_element of value_dcl.elements) {
|
|
120
107
|
if (value_element.type === Type.SYN_OPERATION_DECLARATION) {
|
|
121
108
|
let op_decl = value_element;
|
|
122
|
-
let
|
|
123
|
-
let
|
|
124
|
-
let op_identifier = op_decl.child[2].text;
|
|
125
|
-
let parameter_decls = op_decl.child[3].child;
|
|
109
|
+
let op_identifier = op_decl.name;
|
|
110
|
+
let parameter_decls = op_decl.params;
|
|
126
111
|
writeIndent(out, indent + 1);
|
|
127
112
|
out.write("abstract ");
|
|
128
113
|
out.write(op_identifier + "(");
|
|
129
114
|
let comma = false;
|
|
130
115
|
for (let parameter_dcl of parameter_decls) {
|
|
131
|
-
let
|
|
132
|
-
|
|
133
|
-
let param_identifier = parameter_dcl.child[2].text;
|
|
134
|
-
if (attribute !== Type.TKN_IN) {
|
|
116
|
+
let param_identifier = parameter_dcl.name;
|
|
117
|
+
if (parameter_dcl.attribute !== Type.TKN_IN) {
|
|
135
118
|
throw Error("corba.js currently only supports 'in' parameters");
|
|
136
119
|
}
|
|
137
120
|
if (comma) {
|
|
@@ -142,10 +125,10 @@ function writeTSValueImplDefinitions(out, specification, prefix = "", indent = 0
|
|
|
142
125
|
}
|
|
143
126
|
out.write(param_identifier);
|
|
144
127
|
out.write(": ");
|
|
145
|
-
out.write(typeIDLtoTS(
|
|
128
|
+
out.write(typeIDLtoTS(parameter_dcl.typeSpec));
|
|
146
129
|
}
|
|
147
130
|
out.write("): ");
|
|
148
|
-
out.write(typeIDLtoTS(
|
|
131
|
+
out.write(typeIDLtoTS(op_decl.returnType));
|
|
149
132
|
out.write("\n");
|
|
150
133
|
}
|
|
151
134
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write-valueimpl.js","sourceRoot":"","sources":["../../../../src/idl/ts/write-valueimpl.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file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AAC,CAAA;wBACnB,CAAC;oBACL,CAAC;oBACD,WAAW,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;oBACxB,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;gBACtB,CAAC;gBAAC,MAAK;QACX,CAAC;IACL,CAAC;AACL,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function writeTSValueType(specification:
|
|
1
|
+
import { Specification } from "../idl-node";
|
|
2
|
+
export declare function writeTSValueType(specification: Specification): void;
|