corba.js 0.1.20 → 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 +1123 -1262
- 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 -27
- 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 +15 -19
- 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 +43 -70
- 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 -27
- package/lib/src/idl/idl-node.js +12 -140
- 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 +426 -450
- 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 +22 -18
- 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 +73 -66
- 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,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Type, Declaration } from "../idl-node";
|
|
2
2
|
export declare enum Direction {
|
|
3
3
|
IN = 0,
|
|
4
4
|
OUT = 1,
|
|
5
5
|
NESTED = 1
|
|
6
6
|
}
|
|
7
|
-
export declare function
|
|
7
|
+
export declare function resolvedType(type: Declaration): Type;
|
|
8
|
+
export declare function declarationName(declaration: Declaration): string;
|
|
9
|
+
export declare function typeIDLtoCC(type: Declaration, direction: Direction): string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Declaration } from "../idl-node";
|
|
2
2
|
import { Direction } from "./typeIDLtoCC";
|
|
3
|
-
export declare function typeIDLtoGIOPCC(type:
|
|
3
|
+
export declare function typeIDLtoGIOPCC(type: Declaration, arg: string | undefined, direction: Direction, struct?: boolean): string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function writeCCCode(specification:
|
|
1
|
+
import { Specification } from "../idl-node";
|
|
2
|
+
export declare function writeCCCode(specification: Specification): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Writable } from "stream";
|
|
2
|
-
import {
|
|
3
|
-
export declare function writeCCInterface(specification:
|
|
4
|
-
export declare function writeCCInterfaceDefinitions(out: Writable, specification:
|
|
5
|
-
export declare function writeCCInterfaceBody(out: Writable, interface_body:
|
|
2
|
+
import { Specification, ModuleDecl, Export } from "../idl-node";
|
|
3
|
+
export declare function writeCCInterface(specification: Specification): void;
|
|
4
|
+
export declare function writeCCInterfaceDefinitions(out: Writable, specification: Specification | ModuleDecl, prefix?: string, indent?: number): void;
|
|
5
|
+
export declare function writeCCInterfaceBody(out: Writable, interface_body: Export[]): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function writeCCSkeleton(specification:
|
|
1
|
+
import { Specification } from "../idl-node";
|
|
2
|
+
export declare function writeCCSkeleton(specification: Specification): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function writeCCStub(specification:
|
|
1
|
+
import { Specification } from "../idl-node";
|
|
2
|
+
export declare function writeCCStub(specification: Specification): void;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Type, Token } from "./idl-node";
|
|
2
|
+
export declare const keywords: Map<string, Type>;
|
|
3
|
+
export declare function describeToken(token: Token | undefined): string;
|
|
2
4
|
export declare class Lexer {
|
|
3
5
|
data: string;
|
|
4
6
|
line: number;
|
|
@@ -6,7 +8,8 @@ export declare class Lexer {
|
|
|
6
8
|
pos: number;
|
|
7
9
|
state: number;
|
|
8
10
|
text?: string;
|
|
9
|
-
tokenStack: Array<
|
|
11
|
+
tokenStack: Array<Token>;
|
|
12
|
+
doc: string[];
|
|
10
13
|
static isAlpha(c: string): boolean;
|
|
11
14
|
static isDigit(c: string): boolean;
|
|
12
15
|
static isAlphaNumeric(c: string): boolean;
|
|
@@ -14,6 +17,8 @@ export declare class Lexer {
|
|
|
14
17
|
eof(): boolean;
|
|
15
18
|
getc(): string;
|
|
16
19
|
ungetc(): void;
|
|
17
|
-
unlex(token:
|
|
18
|
-
lex():
|
|
20
|
+
unlex(token: Token | undefined): void;
|
|
21
|
+
lex(): Token | undefined;
|
|
22
|
+
collectDoc(comment: string): void;
|
|
23
|
+
private lexToken;
|
|
19
24
|
}
|
|
@@ -69,34 +69,164 @@ export declare enum Type {
|
|
|
69
69
|
TKN_WSTRING = 67,
|
|
70
70
|
SYN_SPECIFICATION = 68,
|
|
71
71
|
SYN_INTERFACE = 69,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
SYN_PARAMETER_DECLARATION = 82,
|
|
85
|
-
SYN_TYPENAME = 83,
|
|
86
|
-
SYN_LONGLONG = 84,
|
|
87
|
-
SYN_UNSIGNED_SHORT = 85,
|
|
88
|
-
SYN_UNSIGNED_LONG = 86,
|
|
89
|
-
SYN_UNSIGNED_LONGLONG = 87,
|
|
90
|
-
SYN_LONG_DOUBLE = 88
|
|
72
|
+
SYN_OPERATION_DECLARATION = 70,
|
|
73
|
+
SYN_STATE_MEMBER = 71,
|
|
74
|
+
SYN_MEMBER = 72,
|
|
75
|
+
SYN_PARAMETER_DECLARATION = 73,
|
|
76
|
+
SYN_ANNOTAION = 74,
|
|
77
|
+
SYN_SCOPED_NAME = 75,
|
|
78
|
+
SYN_ENUMERATOR = 76,
|
|
79
|
+
SYN_LONGLONG = 77,
|
|
80
|
+
SYN_UNSIGNED_SHORT = 78,
|
|
81
|
+
SYN_UNSIGNED_LONG = 79,
|
|
82
|
+
SYN_UNSIGNED_LONGLONG = 80,
|
|
83
|
+
SYN_LONG_DOUBLE = 81
|
|
91
84
|
}
|
|
92
|
-
export
|
|
85
|
+
export interface Token {
|
|
93
86
|
type: Type;
|
|
94
87
|
text?: string;
|
|
95
|
-
|
|
96
|
-
child: Array<Node | undefined>;
|
|
97
|
-
constructor(type: Type, text?: string);
|
|
98
|
-
toString(): string;
|
|
99
|
-
printTree(depth?: number): void;
|
|
100
|
-
append(node: Node | undefined): void;
|
|
101
|
-
prepend(node: Node | undefined): void;
|
|
88
|
+
doc?: string[];
|
|
102
89
|
}
|
|
90
|
+
export type Annotation = {
|
|
91
|
+
type: Type.SYN_ANNOTAION;
|
|
92
|
+
name: string;
|
|
93
|
+
params: Array<{
|
|
94
|
+
name: string;
|
|
95
|
+
value: string;
|
|
96
|
+
}>;
|
|
97
|
+
};
|
|
98
|
+
export type BaseType = {
|
|
99
|
+
type: Type.TKN_FLOAT | Type.TKN_DOUBLE | Type.SYN_LONG_DOUBLE | Type.TKN_SHORT | Type.TKN_LONG | Type.SYN_LONGLONG | Type.SYN_UNSIGNED_SHORT | Type.SYN_UNSIGNED_LONG | Type.SYN_UNSIGNED_LONGLONG | Type.TKN_CHAR | Type.TKN_WCHAR | Type.TKN_BOOLEAN | Type.TKN_OCTET | Type.TKN_ANY | Type.TKN_VOID;
|
|
100
|
+
};
|
|
101
|
+
export type StringType = {
|
|
102
|
+
type: Type.TKN_STRING | Type.TKN_WSTRING;
|
|
103
|
+
};
|
|
104
|
+
export type SequenceType = {
|
|
105
|
+
type: Type.TKN_SEQUENCE;
|
|
106
|
+
elementType: TypeSpec;
|
|
107
|
+
annotation?: Annotation;
|
|
108
|
+
};
|
|
109
|
+
export type ScopedName = {
|
|
110
|
+
type: Type.SYN_SCOPED_NAME;
|
|
111
|
+
name: string;
|
|
112
|
+
path: ModuleDecl[];
|
|
113
|
+
scope: ModuleDecl | undefined;
|
|
114
|
+
target: Declaration;
|
|
115
|
+
};
|
|
116
|
+
export type TypeSpec = BaseType | StringType | SequenceType | ScopedName | StructDecl | UnionDecl | EnumDecl;
|
|
117
|
+
export type Declaration = TypeSpec | ModuleDecl | InterfaceDecl | ValueTypeDecl | NativeDecl | ExceptionDecl;
|
|
118
|
+
export type Member = {
|
|
119
|
+
type: Type.SYN_MEMBER;
|
|
120
|
+
typeSpec: TypeSpec;
|
|
121
|
+
names: string[];
|
|
122
|
+
doc?: string[];
|
|
123
|
+
};
|
|
124
|
+
export type StructDecl = {
|
|
125
|
+
type: Type.TKN_STRUCT;
|
|
126
|
+
name: string;
|
|
127
|
+
members: Member[];
|
|
128
|
+
doc?: string[];
|
|
129
|
+
};
|
|
130
|
+
export type ExceptionDecl = {
|
|
131
|
+
type: Type.TKN_EXCEPTION;
|
|
132
|
+
name: string;
|
|
133
|
+
members: Member[];
|
|
134
|
+
doc?: string[];
|
|
135
|
+
};
|
|
136
|
+
export type Enumerator = {
|
|
137
|
+
type: Type.SYN_ENUMERATOR;
|
|
138
|
+
name: string;
|
|
139
|
+
enum: EnumDecl;
|
|
140
|
+
doc?: string[];
|
|
141
|
+
};
|
|
142
|
+
export type EnumDecl = {
|
|
143
|
+
type: Type.TKN_ENUM;
|
|
144
|
+
name: string;
|
|
145
|
+
enumerators: Enumerator[];
|
|
146
|
+
doc?: string[];
|
|
147
|
+
};
|
|
148
|
+
export type SwitchCase = {
|
|
149
|
+
type: Type.TKN_CASE;
|
|
150
|
+
label: Enumerator;
|
|
151
|
+
typeSpec: TypeSpec;
|
|
152
|
+
name: string;
|
|
153
|
+
} | {
|
|
154
|
+
type: Type.TKN_DEFAULT;
|
|
155
|
+
typeSpec: TypeSpec;
|
|
156
|
+
name: string;
|
|
157
|
+
};
|
|
158
|
+
export type UnionDecl = {
|
|
159
|
+
type: Type.TKN_UNION;
|
|
160
|
+
name: string;
|
|
161
|
+
switchType: TypeSpec;
|
|
162
|
+
cases: SwitchCase[];
|
|
163
|
+
doc?: string[];
|
|
164
|
+
};
|
|
165
|
+
export type TypedefDecl = {
|
|
166
|
+
type: Type.TKN_TYPEDEF;
|
|
167
|
+
typeSpec: TypeSpec;
|
|
168
|
+
names: string[];
|
|
169
|
+
};
|
|
170
|
+
export type NativeDecl = {
|
|
171
|
+
type: Type.TKN_NATIVE;
|
|
172
|
+
name: string;
|
|
173
|
+
ptrTarget?: ScopedName;
|
|
174
|
+
};
|
|
175
|
+
export type ModuleDecl = {
|
|
176
|
+
type: Type.TKN_MODULE;
|
|
177
|
+
name: string;
|
|
178
|
+
parent: ModuleDecl | undefined;
|
|
179
|
+
definitions: Definition[];
|
|
180
|
+
};
|
|
181
|
+
export type InterfaceDecl = {
|
|
182
|
+
type: Type.SYN_INTERFACE;
|
|
183
|
+
name: string;
|
|
184
|
+
modifier?: Type.TKN_ABSTRACT | Type.TKN_LOCAL;
|
|
185
|
+
base?: ScopedName;
|
|
186
|
+
body: Export[];
|
|
187
|
+
doc?: string[];
|
|
188
|
+
};
|
|
189
|
+
export type ValueTypeDecl = {
|
|
190
|
+
type: Type.TKN_VALUETYPE;
|
|
191
|
+
name: string;
|
|
192
|
+
base: ScopedName[];
|
|
193
|
+
elements: Array<Export | StateMember>;
|
|
194
|
+
doc?: string[];
|
|
195
|
+
};
|
|
196
|
+
export type Operation = {
|
|
197
|
+
type: Type.SYN_OPERATION_DECLARATION;
|
|
198
|
+
oneway: boolean;
|
|
199
|
+
returnType: TypeSpec;
|
|
200
|
+
name: string;
|
|
201
|
+
params: Parameter[];
|
|
202
|
+
raises: ScopedName[];
|
|
203
|
+
doc?: string[];
|
|
204
|
+
};
|
|
205
|
+
export type Attribute = {
|
|
206
|
+
type: Type.TKN_ATTRIBUTE;
|
|
207
|
+
readonly: boolean;
|
|
208
|
+
typeSpec: TypeSpec;
|
|
209
|
+
names: string[];
|
|
210
|
+
doc?: string[];
|
|
211
|
+
};
|
|
212
|
+
export type StateMember = {
|
|
213
|
+
type: Type.SYN_STATE_MEMBER;
|
|
214
|
+
visibility: Type.TKN_PUBLIC | Type.TKN_PRIVATE;
|
|
215
|
+
typeSpec: TypeSpec;
|
|
216
|
+
names: string[];
|
|
217
|
+
doc?: string[];
|
|
218
|
+
};
|
|
219
|
+
export type Parameter = {
|
|
220
|
+
type: Type.SYN_PARAMETER_DECLARATION;
|
|
221
|
+
attribute: Type.TKN_IN | Type.TKN_OUT | Type.TKN_INOUT;
|
|
222
|
+
typeSpec: TypeSpec;
|
|
223
|
+
name: string;
|
|
224
|
+
annotation?: Annotation;
|
|
225
|
+
doc?: string[];
|
|
226
|
+
};
|
|
227
|
+
export type Export = Operation | Attribute;
|
|
228
|
+
export type Definition = ModuleDecl | InterfaceDecl | ValueTypeDecl | TypedefDecl | StructDecl | UnionDecl | EnumDecl | NativeDecl | ExceptionDecl;
|
|
229
|
+
export type Specification = {
|
|
230
|
+
type: Type.SYN_SPECIFICATION;
|
|
231
|
+
definitions: Definition[];
|
|
232
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Specification } from "./idl-node";
|
|
2
2
|
import { Lexer } from "./idl-lexer";
|
|
3
|
-
export declare function specification(aLexer: Lexer):
|
|
3
|
+
export declare function specification(aLexer: Lexer): Specification | undefined;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Node } from "../idl-node";
|
|
2
1
|
import { FileType } from "../util";
|
|
3
|
-
|
|
2
|
+
import { TypeNode } from "./typeIDLtoTS";
|
|
3
|
+
export declare function typeIDLtoGIOPTS(type: TypeNode | undefined, arg?: string | undefined, filetype?: FileType): string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Definition, TypeSpec } from "../idl-node";
|
|
2
2
|
import { FileType } from "../util";
|
|
3
|
-
export
|
|
3
|
+
export type TypeNode = TypeSpec | Definition;
|
|
4
|
+
export declare function typeIDLtoTS(type: TypeNode | undefined, filetype?: FileType): string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function writeTSInterface(specification:
|
|
1
|
+
import { Specification } from "../idl-node";
|
|
2
|
+
export declare function writeTSInterface(specification: Specification): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function writeTSSkeleton(specification:
|
|
1
|
+
import { Specification } from "../idl-node";
|
|
2
|
+
export declare function writeTSSkeleton(specification: Specification): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function writeTSStub(specification:
|
|
1
|
+
import { Specification } from "../idl-node";
|
|
2
|
+
export declare function writeTSStub(specification: Specification): void;
|
|
@@ -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,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,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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Type, Specification, ModuleDecl, Declaration, ScopedName, TypeSpec, Operation } from "./idl-node";
|
|
2
2
|
import { Writable } from "stream";
|
|
3
3
|
export declare let filename: string;
|
|
4
4
|
export declare let filenamePrefix: string;
|
|
@@ -8,6 +8,8 @@ export declare function setFilenamePrefix(prefix: string): void;
|
|
|
8
8
|
export declare function setFilenameLocal(name: string): void;
|
|
9
9
|
export declare let classAttributes: Map<string, string[]>;
|
|
10
10
|
export declare function writeIndent(out: Writable, indent: number): void;
|
|
11
|
+
export declare function operationDoc(op: Operation): string[] | undefined;
|
|
12
|
+
export declare function writeDoc(out: Writable, doc: string[] | undefined, indent: number): void;
|
|
11
13
|
export declare enum FileType {
|
|
12
14
|
NONE = 0,
|
|
13
15
|
VALUE = 1,
|
|
@@ -17,6 +19,11 @@ export declare enum FileType {
|
|
|
17
19
|
SKELETON = 5,
|
|
18
20
|
STUB = 6
|
|
19
21
|
}
|
|
20
|
-
export declare function
|
|
21
|
-
export declare function
|
|
22
|
-
export declare
|
|
22
|
+
export declare function writtenName(name: ScopedName): string;
|
|
23
|
+
export declare function resolvedTarget(name: ScopedName): Declaration;
|
|
24
|
+
export declare const predefinedTypes: Type[];
|
|
25
|
+
export declare function isPointerName(name: string): boolean;
|
|
26
|
+
export declare function scopePrefix(scope: ModuleDecl | undefined): string;
|
|
27
|
+
export declare function defaultValueIDLtoTS(type: TypeSpec | undefined, filetype?: FileType): string;
|
|
28
|
+
export declare function hasValueType(scope: Specification | ModuleDecl): boolean;
|
|
29
|
+
export declare function hasNative(specification: Specification): boolean;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Type, Declaration } from "../idl-node";
|
|
2
2
|
export declare enum Direction {
|
|
3
3
|
IN = 0,
|
|
4
4
|
OUT = 1,
|
|
5
5
|
NESTED = 1
|
|
6
6
|
}
|
|
7
|
-
export declare function
|
|
7
|
+
export declare function resolvedType(type: Declaration): Type;
|
|
8
|
+
export declare function declarationName(declaration: Declaration): string;
|
|
9
|
+
export declare function typeIDLtoCC(type: Declaration, direction: Direction): string;
|
|
@@ -5,27 +5,30 @@ export var Direction;
|
|
|
5
5
|
Direction[Direction["OUT"] = 1] = "OUT";
|
|
6
6
|
Direction[Direction["NESTED"] = 1] = "NESTED";
|
|
7
7
|
})(Direction || (Direction = {}));
|
|
8
|
+
export function resolvedType(type) {
|
|
9
|
+
return type.type === Type.SYN_SCOPED_NAME ? resolvedType(type.target) : type.type;
|
|
10
|
+
}
|
|
11
|
+
export function declarationName(declaration) {
|
|
12
|
+
if (declaration.type === Type.SYN_SCOPED_NAME)
|
|
13
|
+
return declarationName(declaration.target);
|
|
14
|
+
return "name" in declaration ? declaration.name : "";
|
|
15
|
+
}
|
|
8
16
|
export function typeIDLtoCC(type, direction) {
|
|
9
|
-
if (type === undefined)
|
|
10
|
-
throw Error("internal error: parser delivered no type information");
|
|
11
17
|
switch (type.type) {
|
|
12
|
-
case Type.
|
|
18
|
+
case Type.SYN_SCOPED_NAME:
|
|
13
19
|
{
|
|
14
|
-
|
|
15
|
-
let relativeName = "";
|
|
16
|
-
for (let x of type.child) {
|
|
17
|
-
relativeName = `${relativeName}.${x.text}`;
|
|
18
|
-
}
|
|
19
|
-
relativeName = relativeName.substring(1);
|
|
20
|
+
const identifierType = type.target;
|
|
21
|
+
let relativeName = [...type.path.map(x => x.name), declarationName(identifierType)].join("::");
|
|
20
22
|
let absolutePrefix = "";
|
|
21
|
-
for (let x = type.
|
|
22
|
-
absolutePrefix =
|
|
23
|
+
for (let x = type.path.length > 0 ? type.path[0].parent : type.scope; x; x = x.parent) {
|
|
24
|
+
absolutePrefix = `::${x.name}${absolutePrefix}`;
|
|
23
25
|
}
|
|
24
|
-
if (type.
|
|
25
|
-
|
|
26
|
-
type.
|
|
27
|
-
type.
|
|
28
|
-
|
|
26
|
+
if (type.path.length === 0 &&
|
|
27
|
+
resolvedType(identifierType) === Type.TKN_NATIVE &&
|
|
28
|
+
type.name.length > 4 &&
|
|
29
|
+
type.name.substring(type.name.length - 4) === "_ptr") {
|
|
30
|
+
const ptrName = type.name.substring(0, type.name.length - 4);
|
|
31
|
+
return `${absolutePrefix.length == 0 ? ptrName : `${absolutePrefix.substring(2)}::${ptrName}`} | undefined`;
|
|
29
32
|
}
|
|
30
33
|
let name;
|
|
31
34
|
switch (identifierType.type) {
|
|
@@ -33,28 +36,28 @@ export function typeIDLtoCC(type, direction) {
|
|
|
33
36
|
throw Error("not implemented yet");
|
|
34
37
|
break;
|
|
35
38
|
case Type.SYN_INTERFACE:
|
|
36
|
-
name = absolutePrefix.length == 0 ? relativeName : `${absolutePrefix.substring(
|
|
39
|
+
name = absolutePrefix.length == 0 ? relativeName : `${absolutePrefix.substring(2)}::${relativeName}`;
|
|
37
40
|
name = `std::shared_ptr<${name}>`;
|
|
38
41
|
break;
|
|
39
42
|
case Type.TKN_ENUM:
|
|
40
43
|
case Type.TKN_UNION:
|
|
41
|
-
name = absolutePrefix.length == 0 ? relativeName : `${absolutePrefix.substring(
|
|
44
|
+
name = absolutePrefix.length == 0 ? relativeName : `${absolutePrefix.substring(2)}::${relativeName}`;
|
|
42
45
|
break;
|
|
43
46
|
case Type.TKN_STRUCT:
|
|
44
|
-
name = absolutePrefix.length == 0 ? relativeName : `${absolutePrefix.substring(
|
|
47
|
+
name = absolutePrefix.length == 0 ? relativeName : `${absolutePrefix.substring(2)}::${relativeName}`;
|
|
45
48
|
if (direction == Direction.IN) {
|
|
46
49
|
name = `const ${name}&`;
|
|
47
50
|
}
|
|
48
51
|
break;
|
|
49
52
|
case Type.TKN_NATIVE:
|
|
50
53
|
name =
|
|
51
|
-
absolutePrefix.length == 0 ? relativeName : `${absolutePrefix.substring(
|
|
54
|
+
absolutePrefix.length == 0 ? relativeName : `${absolutePrefix.substring(2)}::${relativeName}`;
|
|
52
55
|
break;
|
|
53
56
|
case Type.TKN_SEQUENCE:
|
|
54
|
-
name = typeIDLtoCC(
|
|
57
|
+
name = typeIDLtoCC(identifierType, direction);
|
|
55
58
|
break;
|
|
56
59
|
default:
|
|
57
|
-
|
|
60
|
+
return typeIDLtoCC(identifierType, direction);
|
|
58
61
|
}
|
|
59
62
|
return name;
|
|
60
63
|
}
|
|
@@ -95,7 +98,7 @@ export function typeIDLtoCC(type, direction) {
|
|
|
95
98
|
throw Error("yikes");
|
|
96
99
|
}
|
|
97
100
|
case Type.TKN_SEQUENCE:
|
|
98
|
-
switch (type
|
|
101
|
+
switch (resolvedType(type.elementType)) {
|
|
99
102
|
case Type.TKN_OCTET:
|
|
100
103
|
switch (direction) {
|
|
101
104
|
case Direction.IN:
|
|
@@ -110,7 +113,7 @@ export function typeIDLtoCC(type, direction) {
|
|
|
110
113
|
case Direction.IN:
|
|
111
114
|
return `const std::vector<std::string_view> &`;
|
|
112
115
|
case Direction.OUT:
|
|
113
|
-
return `std::vector<${typeIDLtoCC(type.
|
|
116
|
+
return `std::vector<${typeIDLtoCC(type.elementType, direction)}>`;
|
|
114
117
|
default:
|
|
115
118
|
throw Error("yikes");
|
|
116
119
|
}
|
|
@@ -118,24 +121,24 @@ export function typeIDLtoCC(type, direction) {
|
|
|
118
121
|
case Type.TKN_DOUBLE:
|
|
119
122
|
switch (direction) {
|
|
120
123
|
case Direction.IN:
|
|
121
|
-
return `const std::span<${typeIDLtoCC(type.
|
|
124
|
+
return `const std::span<${typeIDLtoCC(type.elementType, direction)}> &`;
|
|
122
125
|
case Direction.OUT:
|
|
123
|
-
return `std::vector<${typeIDLtoCC(type.
|
|
126
|
+
return `std::vector<${typeIDLtoCC(type.elementType, direction)}>`;
|
|
124
127
|
default:
|
|
125
128
|
throw Error("yikes");
|
|
126
129
|
}
|
|
127
130
|
default:
|
|
128
131
|
switch (direction) {
|
|
129
132
|
case Direction.IN:
|
|
130
|
-
return `const std::vector<${typeIDLtoCC(type.
|
|
133
|
+
return `const std::vector<${typeIDLtoCC(type.elementType, Direction.NESTED)}> &`;
|
|
131
134
|
case Direction.OUT:
|
|
132
|
-
return `std::vector<${typeIDLtoCC(type.
|
|
135
|
+
return `std::vector<${typeIDLtoCC(type.elementType, Direction.NESTED)}>`;
|
|
133
136
|
default:
|
|
134
137
|
throw Error("yikes");
|
|
135
138
|
}
|
|
136
139
|
}
|
|
137
140
|
default:
|
|
138
|
-
throw Error(`no mapping from IDL type to C++ type for ${type.
|
|
141
|
+
throw Error(`no mapping from IDL type to C++ type for ${Type[type.type]}`);
|
|
139
142
|
}
|
|
140
143
|
}
|
|
141
144
|
//# sourceMappingURL=typeIDLtoCC.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeIDLtoCC.js","sourceRoot":"","sources":["../../../../src/idl/cc/typeIDLtoCC.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"typeIDLtoCC.js","sourceRoot":"","sources":["../../../../src/idl/cc/typeIDLtoCC.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAA2B,uBAAmB;AAE3D,MAAM,CAAN,IAAY,SAcX;AAdD,WAAY,SAAS;IAOjB,qCAAE,CAAA;IAEF,uCAAG,CAAA;IAIH,6CAAY,CAAA;AAChB,CAAC,EAdW,SAAS,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,EAAE,SAAS,CAAC,KAAK,CAAA;wBAC3E,KAAK,SAAS,CAAC,GAAG;4BACd,OAAO,eAAe,WAAW,CAAC,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,GAAG,CAAA;wBACrE;4BACI,MAAM,KAAK,CAAC,OAAO,CAAC,CAAA;oBAC5B,CAAC;gBACL;oBACI,QAAQ,SAAS,EAAE,CAAC;wBAChB,KAAK,SAAS,CAAC,EAAE;4BACb,OAAO,qBAAqB,WAAW,CAAC,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,MAAM,CAAC,KAAK,CAAA;wBACpF,KAAK,SAAS,CAAC,GAAG;4BACd,OAAO,eAAe,WAAW,CAAC,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,MAAM,CAAC,GAAG,CAAA;wBAC5E;4BACI,MAAM,KAAK,CAAC,OAAO,CAAC,CAAA;oBAC5B,CAAC;YACT,CAAC;QACL;YACI,MAAM,KAAK,CAAC,4CAA4C,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IAClF,CAAC;AACL,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Declaration } from "../idl-node";
|
|
2
2
|
import { Direction } from "./typeIDLtoCC";
|
|
3
|
-
export declare function typeIDLtoGIOPCC(type:
|
|
3
|
+
export declare function typeIDLtoGIOPCC(type: Declaration, arg: string | undefined, direction: Direction, struct?: boolean): string;
|
|
@@ -1,32 +1,29 @@
|
|
|
1
1
|
import { Type } from "../idl-node.js";
|
|
2
|
-
import { Direction, typeIDLtoCC } from "./typeIDLtoCC.js";
|
|
3
|
-
export function typeIDLtoGIOPCC(type, arg, direction) {
|
|
4
|
-
if (type === undefined)
|
|
5
|
-
throw Error("internal error: parser delivered no type information");
|
|
2
|
+
import { Direction, typeIDLtoCC, resolvedType } from "./typeIDLtoCC.js";
|
|
3
|
+
export function typeIDLtoGIOPCC(type, arg, direction, struct = false) {
|
|
6
4
|
let name;
|
|
7
5
|
switch (type.type) {
|
|
8
|
-
case Type.
|
|
9
|
-
|
|
10
|
-
return typeIDLtoGIOPCC(type.child[0], arg, direction);
|
|
6
|
+
case Type.SYN_SCOPED_NAME:
|
|
7
|
+
return typeIDLtoGIOPCC(type.target, arg, direction, struct);
|
|
11
8
|
case Type.TKN_VALUETYPE:
|
|
12
|
-
return arg === undefined ? `decoder.value("${type.
|
|
9
|
+
return arg === undefined ? `decoder.value("${type.name}")` : `encoder.value(${arg})`;
|
|
13
10
|
case Type.SYN_INTERFACE:
|
|
14
11
|
switch (direction) {
|
|
15
12
|
case Direction.IN:
|
|
16
|
-
return arg === undefined ? `${type.
|
|
13
|
+
return arg === undefined ? `${type.name}::_narrow(decoder.readObject(obj->get_ORB()))` : `encoder.writeObject(${arg}.get())`;
|
|
17
14
|
case Direction.OUT:
|
|
18
|
-
return arg === undefined ? `${type.
|
|
15
|
+
return arg === undefined ? `${type.name}::_narrow(decoder.readObject(${struct ? "orb" : "get_ORB()"}))` : `encoder.writeObject(${arg}.get())`;
|
|
19
16
|
}
|
|
20
17
|
case Type.TKN_UNION:
|
|
21
18
|
throw Error("union is not implemented yet");
|
|
22
19
|
case Type.TKN_STRUCT: {
|
|
23
20
|
return arg === undefined
|
|
24
|
-
? `_decode${type.
|
|
25
|
-
: `_encode${type.
|
|
21
|
+
? `_decode${type.name}(get_ORB(), decoder)`
|
|
22
|
+
: `_encode${type.name}(encoder,${arg})`;
|
|
26
23
|
}
|
|
27
24
|
case Type.TKN_NATIVE:
|
|
28
25
|
{
|
|
29
|
-
const id = type.
|
|
26
|
+
const id = type.name;
|
|
30
27
|
if (id.length > 4 && id.substring(id.length - 4) === "_ptr") {
|
|
31
28
|
return arg === undefined
|
|
32
29
|
? `decoder.value("${id.substring(0, id.length - 4)}")`
|
|
@@ -85,9 +82,9 @@ export function typeIDLtoGIOPCC(type, arg, direction) {
|
|
|
85
82
|
}
|
|
86
83
|
throw Error("yikes");
|
|
87
84
|
case Type.TKN_ENUM:
|
|
88
|
-
return arg === undefined ? `static_cast<${type.
|
|
85
|
+
return arg === undefined ? `static_cast<${type.name}>(decoder.readUlong())` : `encoder.writeUlong(std::to_underlying(${arg}))`;
|
|
89
86
|
case Type.TKN_SEQUENCE:
|
|
90
|
-
switch (type.
|
|
87
|
+
switch (resolvedType(type.elementType)) {
|
|
91
88
|
case Type.TKN_OCTET: {
|
|
92
89
|
switch (direction) {
|
|
93
90
|
case Direction.IN:
|
|
@@ -125,12 +122,11 @@ export function typeIDLtoGIOPCC(type, arg, direction) {
|
|
|
125
122
|
}
|
|
126
123
|
default:
|
|
127
124
|
return arg === undefined
|
|
128
|
-
? `decoder.readSequence<${typeIDLtoCC(type.
|
|
129
|
-
: `encoder.writeSequence<${typeIDLtoCC(type.
|
|
125
|
+
? `decoder.readSequence<${typeIDLtoCC(type.elementType, Direction.NESTED)}>([&] { return ${typeIDLtoGIOPCC(type.elementType, undefined, direction, struct)}; })`
|
|
126
|
+
: `encoder.writeSequence<${typeIDLtoCC(type.elementType, Direction.NESTED)}>(${arg}, [&](auto item) { ${typeIDLtoGIOPCC(type.elementType, "item", direction, struct)}; })`;
|
|
130
127
|
}
|
|
131
128
|
default:
|
|
132
|
-
type.
|
|
133
|
-
throw Error(`no mapping from IDL type '${type.toString()}' to GIOP encoder/decoder`);
|
|
129
|
+
throw Error(`no mapping from IDL type '${Type[type.type]}' to GIOP encoder/decoder`);
|
|
134
130
|
}
|
|
135
131
|
return arg === undefined ? `decoder.read${name}()` : `encoder.write${name}(${arg})`;
|
|
136
132
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeIDLtoGIOPCC.js","sourceRoot":"","sources":["../../../../src/idl/cc/typeIDLtoGIOPCC.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"typeIDLtoGIOPCC.js","sourceRoot":"","sources":["../../../../src/idl/cc/typeIDLtoGIOPCC.ts"],"names":[],"mappings":"AA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