forked from microsoft/devicescript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprotogen.c
More file actions
397 lines (362 loc) · 20.3 KB
/
protogen.c
File metadata and controls
397 lines (362 loc) · 20.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
// auto-generated!
#include "devs_internal.h"
#define PROP DEVS_BUILTIN_FLAG_IS_PROPERTY
#define ASYNC DEVS_BUILTIN_FLAG_ASYNC_CALL
#define NO_SELF DEVS_BUILTIN_FLAG_NO_SELF
#define CTOR DEVS_BUILTIN_FLAG_IS_CTOR
#define N(n) (DEVS_BUILTIN_STRING_##n)
// impl_array.c
value_t prop_Array_length(devs_ctx_t *ctx, value_t self);
void meth2_Array_insert(devs_ctx_t *ctx);
void fun1_Array_isArray(devs_ctx_t *ctx);
void methX_Array_push(devs_ctx_t *ctx);
void meth1_Array_pushRange(devs_ctx_t *ctx);
void methX_Array_slice(devs_ctx_t *ctx);
// impl_buffer.c
void fun1_Buffer_alloc(devs_ctx_t *ctx);
value_t prop_Buffer_length(devs_ctx_t *ctx, value_t self);
void meth0_Buffer_toString(devs_ctx_t *ctx);
void meth3_Buffer_fillAt(devs_ctx_t *ctx);
void meth4_Buffer_blitAt(devs_ctx_t *ctx);
// impl_ds.c
void fun1_DeviceScript_sleepMs(devs_ctx_t *ctx);
void fun1_DeviceScript__panic(devs_ctx_t *ctx);
void fun0_DeviceScript_reboot(devs_ctx_t *ctx);
void funX_DeviceScript_format(devs_ctx_t *ctx);
void fun1_DeviceScript_log(devs_ctx_t *ctx);
void fun1_DeviceScript_parseFloat(devs_ctx_t *ctx);
void fun1_DeviceScript_parseInt(devs_ctx_t *ctx);
void fun2_DeviceScript__logRepr(devs_ctx_t *ctx);
// impl_error.c
void meth1_Error___ctor__(devs_ctx_t *ctx);
void meth1_RangeError___ctor__(devs_ctx_t *ctx);
void meth1_TypeError___ctor__(devs_ctx_t *ctx);
value_t prop_Error_name(devs_ctx_t *ctx, value_t self);
void meth0_Error_print(devs_ctx_t *ctx);
// impl_function.c
void methX_Function_start(devs_ctx_t *ctx);
value_t prop_Function_prototype(devs_ctx_t *ctx, value_t self);
value_t prop_Function_name(devs_ctx_t *ctx, value_t self);
// impl_math.c
void fun1_Math_ceil(devs_ctx_t *ctx);
void fun1_Math_floor(devs_ctx_t *ctx);
void fun1_Math_round(devs_ctx_t *ctx);
void fun1_Math_abs(devs_ctx_t *ctx);
void fun0_Math_random(devs_ctx_t *ctx);
void fun1_Math_randomInt(devs_ctx_t *ctx);
void fun1_Math_log(devs_ctx_t *ctx);
void fun2_Math_pow(devs_ctx_t *ctx);
void fun2_Math_idiv(devs_ctx_t *ctx);
void fun2_Math_imod(devs_ctx_t *ctx);
void fun2_Math_imul(devs_ctx_t *ctx);
void fun2_Math_min(devs_ctx_t *ctx);
void fun2_Math_max(devs_ctx_t *ctx);
// impl_object.c
void fun2_Object_assign(devs_ctx_t *ctx);
void fun1_Object_keys(devs_ctx_t *ctx);
void fun1_Object_values(devs_ctx_t *ctx);
void fun2_Object_setPrototypeOf(devs_ctx_t *ctx);
// impl_packet.c
value_t prop_Packet_role(devs_ctx_t *ctx, value_t self);
value_t prop_Packet_deviceIdentifier(devs_ctx_t *ctx, value_t self);
value_t prop_Packet_shortId(devs_ctx_t *ctx, value_t self);
value_t prop_Packet_serviceIndex(devs_ctx_t *ctx, value_t self);
value_t prop_Packet_serviceCommand(devs_ctx_t *ctx, value_t self);
value_t prop_Packet_flags(devs_ctx_t *ctx, value_t self);
value_t prop_Packet_isCommand(devs_ctx_t *ctx, value_t self);
value_t prop_Packet_isReport(devs_ctx_t *ctx, value_t self);
value_t prop_Packet_payload(devs_ctx_t *ctx, value_t self);
value_t prop_Packet_isEvent(devs_ctx_t *ctx, value_t self);
value_t prop_Packet_eventCode(devs_ctx_t *ctx, value_t self);
value_t prop_Packet_isRegSet(devs_ctx_t *ctx, value_t self);
value_t prop_Packet_isRegGet(devs_ctx_t *ctx, value_t self);
value_t prop_Packet_regCode(devs_ctx_t *ctx, value_t self);
void meth0_Packet_decode(devs_ctx_t *ctx);
// impl_register.c
void meth0_DsRegister_read(devs_ctx_t *ctx);
void methX_DsRegister_write(devs_ctx_t *ctx);
value_t prop_DsPacketInfo_role(devs_ctx_t *ctx, value_t self);
value_t prop_DsPacketInfo_name(devs_ctx_t *ctx, value_t self);
value_t prop_DsPacketInfo_code(devs_ctx_t *ctx, value_t self);
void methX_DsCommand___func__(devs_ctx_t *ctx);
// impl_role.c
value_t prop_DsRole_isConnected(devs_ctx_t *ctx, value_t self);
void meth2_DsRole_sendCommand(devs_ctx_t *ctx);
void meth0_DsRole_wait(devs_ctx_t *ctx);
// impl_string.c
value_t prop_String_length(devs_ctx_t *ctx, value_t self);
void meth1_String_charCodeAt(devs_ctx_t *ctx);
void meth1_String_charAt(devs_ctx_t *ctx);
static const devs_builtin_proto_entry_t Array_prototype_entries[] = { //
{N(LENGTH), 50000}, //
{N(INSERT), 50001}, //
{N(PUSH), 50003}, //
{N(PUSHRANGE), 50004}, //
{N(SLICE), 50005}, //
{0, 0}};
static const devs_builtin_proto_entry_t Array_entries[] = { //
{N(ISARRAY), 50002}, //
{N(PROTOTYPE), DEVS_BUILTIN_OBJECT_ARRAY_PROTOTYPE}, //
{0, 0}};
static const devs_builtin_proto_entry_t Buffer_entries[] = { //
{N(ALLOC), 50006}, //
{N(PROTOTYPE), DEVS_BUILTIN_OBJECT_BUFFER_PROTOTYPE}, //
{0, 0}};
static const devs_builtin_proto_entry_t Buffer_prototype_entries[] = { //
{N(LENGTH), 50007}, //
{N(TOSTRING), 50008}, //
{N(FILLAT), 50009}, //
{N(BLITAT), 50010}, //
{0, 0}};
static const devs_builtin_proto_entry_t DeviceScript_entries[] = { //
{N(SLEEPMS), 50011}, //
{N(_PANIC), 50012}, //
{N(REBOOT), 50013}, //
{N(FORMAT), 50014}, //
{N(LOG), 50015}, //
{N(PARSEFLOAT), 50016}, //
{N(PARSEINT), 50017}, //
{N(_LOGREPR), 50018}, //
{0, 0}};
static const devs_builtin_proto_entry_t TypeError_prototype_entries[] = { //
{N(CONSTRUCTOR), 50021}, //
{0, 0}};
static const devs_builtin_proto_entry_t RangeError_prototype_entries[] = { //
{N(CONSTRUCTOR), 50020}, //
{0, 0}};
static const devs_builtin_proto_entry_t Error_entries[] = { //
{N(__FUNC__), 50019}, //
{N(PROTOTYPE), DEVS_BUILTIN_OBJECT_ERROR_PROTOTYPE}, //
{0, 0}};
static const devs_builtin_proto_entry_t Error_prototype_entries[] = { //
{N(CONSTRUCTOR), 50019}, //
{N(NAME), 50022}, //
{N(PRINT), 50023}, //
{0, 0}};
static const devs_builtin_proto_entry_t RangeError_entries[] = { //
{N(__FUNC__), 50020}, //
{N(PROTOTYPE), DEVS_BUILTIN_OBJECT_RANGEERROR_PROTOTYPE}, //
{0, 0}};
static const devs_builtin_proto_entry_t TypeError_entries[] = { //
{N(__FUNC__), 50021}, //
{N(PROTOTYPE), DEVS_BUILTIN_OBJECT_TYPEERROR_PROTOTYPE}, //
{0, 0}};
static const devs_builtin_proto_entry_t Function_prototype_entries[] = { //
{N(START), 50024}, //
{N(PROTOTYPE), 50025}, //
{N(NAME), 50026}, //
{0, 0}};
static const devs_builtin_proto_entry_t Math_entries[] = { //
{N(CEIL), 50027}, //
{N(FLOOR), 50028}, //
{N(ROUND), 50029}, //
{N(ABS), 50030}, //
{N(RANDOM), 50031}, //
{N(RANDOMINT), 50032}, //
{N(LOG), 50033}, //
{N(POW), 50034}, //
{N(IDIV), 50035}, //
{N(IMOD), 50036}, //
{N(IMUL), 50037}, //
{N(MIN), 50038}, //
{N(MAX), 50039}, //
{0, 0}};
static const devs_builtin_proto_entry_t Object_entries[] = { //
{N(ASSIGN), 50040}, //
{N(KEYS), 50041}, //
{N(VALUES), 50042}, //
{N(SETPROTOTYPEOF), 50043}, //
{N(PROTOTYPE), DEVS_BUILTIN_OBJECT_OBJECT_PROTOTYPE}, //
{0, 0}};
static const devs_builtin_proto_entry_t Packet_prototype_entries[] = { //
{N(ROLE), 50044}, //
{N(DEVICEIDENTIFIER), 50045}, //
{N(SHORTID), 50046}, //
{N(SERVICEINDEX), 50047}, //
{N(SERVICECOMMAND), 50048}, //
{N(FLAGS), 50049}, //
{N(ISCOMMAND), 50050}, //
{N(ISREPORT), 50051}, //
{N(PAYLOAD), 50052}, //
{N(ISEVENT), 50053}, //
{N(EVENTCODE), 50054}, //
{N(ISREGSET), 50055}, //
{N(ISREGGET), 50056}, //
{N(REGCODE), 50057}, //
{N(DECODE), 50058}, //
{0, 0}};
static const devs_builtin_proto_entry_t DsRegister_prototype_entries[] = { //
{N(READ), 50059}, //
{N(WRITE), 50060}, //
{0, 0}};
static const devs_builtin_proto_entry_t DsCommand_prototype_entries[] = { //
{N(__FUNC__), 50064}, //
{0, 0}};
static const devs_builtin_proto_entry_t DsEvent_prototype_entries[] = { //
{0, 0}};
static const devs_builtin_proto_entry_t DsPacketInfo_prototype_entries[] = { //
{N(ROLE), 50061}, //
{N(NAME), 50062}, //
{N(CODE), 50063}, //
{0, 0}};
static const devs_builtin_proto_entry_t DsRole_prototype_entries[] = { //
{N(ISCONNECTED), 50065}, //
{N(SENDCOMMAND), 50066}, //
{N(WAIT), 50067}, //
{0, 0}};
static const devs_builtin_proto_entry_t String_prototype_entries[] = { //
{N(LENGTH), 50068}, //
{N(CHARCODEAT), 50069}, //
{N(CHARAT), 50070}, //
{0, 0}};
static const devs_builtin_proto_entry_t empty_entries[] = { //
{0, 0}};
static const devs_builtin_proto_entry_t string_entries[] = { //
{N(PROTOTYPE), DEVS_BUILTIN_OBJECT_STRING_PROTOTYPE}, //
{0, 0}};
static const devs_builtin_proto_entry_t number_entries[] = { //
{N(PROTOTYPE), DEVS_BUILTIN_OBJECT_NUMBER_PROTOTYPE}, //
{0, 0}};
static const devs_builtin_proto_entry_t dsfiber_entries[] = { //
{N(PROTOTYPE), DEVS_BUILTIN_OBJECT_DSFIBER_PROTOTYPE}, //
{0, 0}};
static const devs_builtin_proto_entry_t dsrole_entries[] = { //
{N(PROTOTYPE), DEVS_BUILTIN_OBJECT_DSROLE_PROTOTYPE}, //
{0, 0}};
static const devs_builtin_proto_entry_t function_entries[] = { //
{N(PROTOTYPE), DEVS_BUILTIN_OBJECT_FUNCTION_PROTOTYPE}, //
{0, 0}};
static const devs_builtin_proto_entry_t boolean_entries[] = { //
{N(PROTOTYPE), DEVS_BUILTIN_OBJECT_BOOLEAN_PROTOTYPE}, //
{0, 0}};
static const devs_builtin_proto_entry_t packet_entries[] = { //
{N(PROTOTYPE), DEVS_BUILTIN_OBJECT_PACKET_PROTOTYPE}, //
{0, 0}};
const devs_builtin_proto_t devs_builtin_protos[DEVS_BUILTIN_OBJECT___MAX + 1] = {
[DEVS_BUILTIN_OBJECT_ARRAY_PROTOTYPE] = {DEVS_BUILTIN_PROTO_INIT, NULL,
Array_prototype_entries},
[DEVS_BUILTIN_OBJECT_ARRAY] = {DEVS_BUILTIN_PROTO_INIT, NULL, Array_entries},
[DEVS_BUILTIN_OBJECT_BUFFER] = {DEVS_BUILTIN_PROTO_INIT, NULL, Buffer_entries},
[DEVS_BUILTIN_OBJECT_BUFFER_PROTOTYPE] = {DEVS_BUILTIN_PROTO_INIT, NULL,
Buffer_prototype_entries},
[DEVS_BUILTIN_OBJECT_DEVICESCRIPT] = {DEVS_BUILTIN_PROTO_INIT, NULL, DeviceScript_entries},
[DEVS_BUILTIN_OBJECT_TYPEERROR_PROTOTYPE] =
{DEVS_BUILTIN_PROTO_INIT, &devs_builtin_protos[DEVS_BUILTIN_OBJECT_ERROR_PROTOTYPE],
TypeError_prototype_entries},
[DEVS_BUILTIN_OBJECT_RANGEERROR_PROTOTYPE] =
{DEVS_BUILTIN_PROTO_INIT, &devs_builtin_protos[DEVS_BUILTIN_OBJECT_ERROR_PROTOTYPE],
RangeError_prototype_entries},
[DEVS_BUILTIN_OBJECT_ERROR] = {DEVS_BUILTIN_PROTO_INIT, NULL, Error_entries},
[DEVS_BUILTIN_OBJECT_ERROR_PROTOTYPE] = {DEVS_BUILTIN_PROTO_INIT, NULL,
Error_prototype_entries},
[DEVS_BUILTIN_OBJECT_RANGEERROR] = {DEVS_BUILTIN_PROTO_INIT, NULL, RangeError_entries},
[DEVS_BUILTIN_OBJECT_TYPEERROR] = {DEVS_BUILTIN_PROTO_INIT, NULL, TypeError_entries},
[DEVS_BUILTIN_OBJECT_FUNCTION_PROTOTYPE] = {DEVS_BUILTIN_PROTO_INIT, NULL,
Function_prototype_entries},
[DEVS_BUILTIN_OBJECT_MATH] = {DEVS_BUILTIN_PROTO_INIT, NULL, Math_entries},
[DEVS_BUILTIN_OBJECT_OBJECT] = {DEVS_BUILTIN_PROTO_INIT, NULL, Object_entries},
[DEVS_BUILTIN_OBJECT_PACKET_PROTOTYPE] = {DEVS_BUILTIN_PROTO_INIT, NULL,
Packet_prototype_entries},
[DEVS_BUILTIN_OBJECT_DSREGISTER_PROTOTYPE] =
{DEVS_BUILTIN_PROTO_INIT, &devs_builtin_protos[DEVS_BUILTIN_OBJECT_DSPACKETINFO_PROTOTYPE],
DsRegister_prototype_entries},
[DEVS_BUILTIN_OBJECT_DSCOMMAND_PROTOTYPE] =
{DEVS_BUILTIN_PROTO_INIT, &devs_builtin_protos[DEVS_BUILTIN_OBJECT_DSPACKETINFO_PROTOTYPE],
DsCommand_prototype_entries},
[DEVS_BUILTIN_OBJECT_DSEVENT_PROTOTYPE] =
{DEVS_BUILTIN_PROTO_INIT, &devs_builtin_protos[DEVS_BUILTIN_OBJECT_DSPACKETINFO_PROTOTYPE],
DsEvent_prototype_entries},
[DEVS_BUILTIN_OBJECT_DSPACKETINFO_PROTOTYPE] = {DEVS_BUILTIN_PROTO_INIT, NULL,
DsPacketInfo_prototype_entries},
[DEVS_BUILTIN_OBJECT_DSROLE_PROTOTYPE] = {DEVS_BUILTIN_PROTO_INIT, NULL,
DsRole_prototype_entries},
[DEVS_BUILTIN_OBJECT_STRING_PROTOTYPE] = {DEVS_BUILTIN_PROTO_INIT, NULL,
String_prototype_entries},
[DEVS_BUILTIN_OBJECT_STRING] = {DEVS_BUILTIN_PROTO_INIT, NULL, string_entries},
[DEVS_BUILTIN_OBJECT_NUMBER] = {DEVS_BUILTIN_PROTO_INIT, NULL, number_entries},
[DEVS_BUILTIN_OBJECT_DSFIBER] = {DEVS_BUILTIN_PROTO_INIT, NULL, dsfiber_entries},
[DEVS_BUILTIN_OBJECT_DSROLE] = {DEVS_BUILTIN_PROTO_INIT, NULL, dsrole_entries},
[DEVS_BUILTIN_OBJECT_FUNCTION] = {DEVS_BUILTIN_PROTO_INIT, NULL, function_entries},
[DEVS_BUILTIN_OBJECT_BOOLEAN] = {DEVS_BUILTIN_PROTO_INIT, NULL, boolean_entries},
[DEVS_BUILTIN_OBJECT_PACKET] = {DEVS_BUILTIN_PROTO_INIT, NULL, packet_entries},
[DEVS_BUILTIN_OBJECT_OBJECT_PROTOTYPE] = {DEVS_BUILTIN_PROTO_INIT, NULL, empty_entries},
[DEVS_BUILTIN_OBJECT_NUMBER_PROTOTYPE] = {DEVS_BUILTIN_PROTO_INIT, NULL, empty_entries},
[DEVS_BUILTIN_OBJECT_DSFIBER_PROTOTYPE] = {DEVS_BUILTIN_PROTO_INIT, NULL, empty_entries},
[DEVS_BUILTIN_OBJECT_BOOLEAN_PROTOTYPE] = {DEVS_BUILTIN_PROTO_INIT, NULL, empty_entries},
[DEVS_BUILTIN_OBJECT_DSREPORT_PROTOTYPE] = {DEVS_BUILTIN_PROTO_INIT, NULL, empty_entries},
};
uint16_t devs_num_builtin_functions = 71;
const devs_builtin_function_t devs_builtin_functions[71] = {
{N(LENGTH), 0, PROP, {.prop = prop_Array_length}},
{N(INSERT), 2, 0, {.meth = meth2_Array_insert}},
{N(ISARRAY), 1, NO_SELF, {.meth = fun1_Array_isArray}},
{N(PUSH), 0, 0, {.meth = methX_Array_push}},
{N(PUSHRANGE), 1, 0, {.meth = meth1_Array_pushRange}},
{N(SLICE), 0, 0, {.meth = methX_Array_slice}},
{N(ALLOC), 1, NO_SELF, {.meth = fun1_Buffer_alloc}},
{N(LENGTH), 0, PROP, {.prop = prop_Buffer_length}},
{N(TOSTRING), 0, 0, {.meth = meth0_Buffer_toString}},
{N(FILLAT), 3, 0, {.meth = meth3_Buffer_fillAt}},
{N(BLITAT), 4, 0, {.meth = meth4_Buffer_blitAt}},
{N(SLEEPMS), 1, NO_SELF, {.meth = fun1_DeviceScript_sleepMs}},
{N(_PANIC), 1, NO_SELF, {.meth = fun1_DeviceScript__panic}},
{N(REBOOT), 0, NO_SELF, {.meth = fun0_DeviceScript_reboot}},
{N(FORMAT), 0, NO_SELF, {.meth = funX_DeviceScript_format}},
{N(LOG), 1, NO_SELF, {.meth = fun1_DeviceScript_log}},
{N(PARSEFLOAT), 1, NO_SELF, {.meth = fun1_DeviceScript_parseFloat}},
{N(PARSEINT), 1, NO_SELF, {.meth = fun1_DeviceScript_parseInt}},
{N(_LOGREPR), 2, NO_SELF, {.meth = fun2_DeviceScript__logRepr}},
{N(ERROR), 1, CTOR, {.meth = meth1_Error___ctor__}},
{N(RANGEERROR), 1, CTOR, {.meth = meth1_RangeError___ctor__}},
{N(TYPEERROR), 1, CTOR, {.meth = meth1_TypeError___ctor__}},
{N(NAME), 0, PROP, {.prop = prop_Error_name}},
{N(PRINT), 0, 0, {.meth = meth0_Error_print}},
{N(START), 0, 0, {.meth = methX_Function_start}},
{N(PROTOTYPE), 0, PROP, {.prop = prop_Function_prototype}},
{N(NAME), 0, PROP, {.prop = prop_Function_name}},
{N(CEIL), 1, NO_SELF, {.meth = fun1_Math_ceil}},
{N(FLOOR), 1, NO_SELF, {.meth = fun1_Math_floor}},
{N(ROUND), 1, NO_SELF, {.meth = fun1_Math_round}},
{N(ABS), 1, NO_SELF, {.meth = fun1_Math_abs}},
{N(RANDOM), 0, NO_SELF, {.meth = fun0_Math_random}},
{N(RANDOMINT), 1, NO_SELF, {.meth = fun1_Math_randomInt}},
{N(LOG), 1, NO_SELF, {.meth = fun1_Math_log}},
{N(POW), 2, NO_SELF, {.meth = fun2_Math_pow}},
{N(IDIV), 2, NO_SELF, {.meth = fun2_Math_idiv}},
{N(IMOD), 2, NO_SELF, {.meth = fun2_Math_imod}},
{N(IMUL), 2, NO_SELF, {.meth = fun2_Math_imul}},
{N(MIN), 2, NO_SELF, {.meth = fun2_Math_min}},
{N(MAX), 2, NO_SELF, {.meth = fun2_Math_max}},
{N(ASSIGN), 2, NO_SELF, {.meth = fun2_Object_assign}},
{N(KEYS), 1, NO_SELF, {.meth = fun1_Object_keys}},
{N(VALUES), 1, NO_SELF, {.meth = fun1_Object_values}},
{N(SETPROTOTYPEOF), 2, NO_SELF, {.meth = fun2_Object_setPrototypeOf}},
{N(ROLE), 0, PROP, {.prop = prop_Packet_role}},
{N(DEVICEIDENTIFIER), 0, PROP, {.prop = prop_Packet_deviceIdentifier}},
{N(SHORTID), 0, PROP, {.prop = prop_Packet_shortId}},
{N(SERVICEINDEX), 0, PROP, {.prop = prop_Packet_serviceIndex}},
{N(SERVICECOMMAND), 0, PROP, {.prop = prop_Packet_serviceCommand}},
{N(FLAGS), 0, PROP, {.prop = prop_Packet_flags}},
{N(ISCOMMAND), 0, PROP, {.prop = prop_Packet_isCommand}},
{N(ISREPORT), 0, PROP, {.prop = prop_Packet_isReport}},
{N(PAYLOAD), 0, PROP, {.prop = prop_Packet_payload}},
{N(ISEVENT), 0, PROP, {.prop = prop_Packet_isEvent}},
{N(EVENTCODE), 0, PROP, {.prop = prop_Packet_eventCode}},
{N(ISREGSET), 0, PROP, {.prop = prop_Packet_isRegSet}},
{N(ISREGGET), 0, PROP, {.prop = prop_Packet_isRegGet}},
{N(REGCODE), 0, PROP, {.prop = prop_Packet_regCode}},
{N(DECODE), 0, 0, {.meth = meth0_Packet_decode}},
{N(READ), 0, 0, {.meth = meth0_DsRegister_read}},
{N(WRITE), 0, 0, {.meth = methX_DsRegister_write}},
{N(ROLE), 0, PROP, {.prop = prop_DsPacketInfo_role}},
{N(NAME), 0, PROP, {.prop = prop_DsPacketInfo_name}},
{N(CODE), 0, PROP, {.prop = prop_DsPacketInfo_code}},
{N(__FUNC__), 0, 0, {.meth = methX_DsCommand___func__}},
{N(ISCONNECTED), 0, PROP, {.prop = prop_DsRole_isConnected}},
{N(SENDCOMMAND), 2, 0, {.meth = meth2_DsRole_sendCommand}},
{N(WAIT), 0, 0, {.meth = meth0_DsRole_wait}},
{N(LENGTH), 0, PROP, {.prop = prop_String_length}},
{N(CHARCODEAT), 1, 0, {.meth = meth1_String_charCodeAt}},
{N(CHARAT), 1, 0, {.meth = meth1_String_charAt}}};
STATIC_ASSERT(4 <= DEVS_BUILTIN_MAX_ARGS);
STATIC_ASSERT(50000 == DEVS_FIRST_BUILTIN_FUNCTION);