circuitscript 0.0.36 → 0.0.38
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/dist/cjs/antlr/CircuitScriptLexer.js +95 -90
- package/dist/cjs/antlr/CircuitScriptParser.js +2 -2
- package/dist/cjs/export.js +1 -0
- package/dist/cjs/globals.js +1 -0
- package/dist/cjs/helpers.js +10 -9
- package/dist/cjs/main.js +0 -3
- package/dist/cjs/visitor.js +6 -0
- package/dist/esm/antlr/CircuitScriptLexer.mjs +95 -90
- package/dist/esm/antlr/CircuitScriptParser.mjs +2 -2
- package/dist/esm/export.mjs +1 -0
- package/dist/esm/globals.mjs +1 -0
- package/dist/esm/helpers.mjs +10 -9
- package/dist/esm/main.mjs +0 -3
- package/dist/esm/visitor.mjs +6 -0
- package/dist/types/globals.d.ts +2 -1
- package/dist/types/helpers.d.ts +0 -1
- package/package.json +1 -1
|
@@ -155,8 +155,8 @@ CircuitScriptLexer.literalNames = [
|
|
|
155
155
|
"'branch'", "'create'", "'component'", "'graphic'", "'module'",
|
|
156
156
|
"'wire'", "'pin'", "'add'", "'at'", "'to'", "'point'", "'join'",
|
|
157
157
|
"'parallel'", "'return'", "'def'", "'import'", "'for'", "'in'",
|
|
158
|
-
"'while'", "'continue'", "'if'", "'else'",
|
|
159
|
-
"'=='", "'!='", "'>'", "'>='", "'<'", "'<='",
|
|
158
|
+
"'while'", "'continue'", "'if'", "'else'", null, "'frame'", "'sheet'",
|
|
159
|
+
"'=='", "'!='", "'>'", "'>='", "'<'", "'<='", null, null, "'+'",
|
|
160
160
|
"'-'", "'/'", "'*'", "'%'", "'+='", "'-='", "'/='", "'*='", "'%='",
|
|
161
161
|
"'('", "')'"
|
|
162
162
|
];
|
|
@@ -191,7 +191,7 @@ CircuitScriptLexer.ruleNames = [
|
|
|
191
191
|
"COMMENT_FRAGMENT", "COMMENT",
|
|
192
192
|
];
|
|
193
193
|
CircuitScriptLexer._serializedATN = [
|
|
194
|
-
4, 0, 65,
|
|
194
|
+
4, 0, 65, 490, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5,
|
|
195
195
|
2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2,
|
|
196
196
|
13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7,
|
|
197
197
|
19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2,
|
|
@@ -212,24 +212,25 @@ CircuitScriptLexer._serializedATN = [
|
|
|
212
212
|
1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 24,
|
|
213
213
|
1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27,
|
|
214
214
|
1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29,
|
|
215
|
-
1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1,
|
|
216
|
-
1,
|
|
217
|
-
1,
|
|
218
|
-
1,
|
|
219
|
-
1,
|
|
220
|
-
1,
|
|
221
|
-
1,
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
215
|
+
1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 1, 30, 3, 30, 289, 8, 30, 1, 31, 1, 31, 1, 31,
|
|
216
|
+
1, 31, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 34,
|
|
217
|
+
1, 34, 1, 34, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 39,
|
|
218
|
+
1, 39, 1, 39, 1, 39, 1, 39, 3, 39, 324, 8, 39, 1, 40, 1, 40, 1, 40, 1, 40, 3, 40, 330, 8,
|
|
219
|
+
40, 1, 41, 1, 41, 1, 42, 1, 42, 1, 43, 1, 43, 1, 44, 1, 44, 1, 45, 1, 45, 1, 46, 1, 46, 1,
|
|
220
|
+
46, 1, 47, 1, 47, 1, 47, 1, 48, 1, 48, 1, 48, 1, 49, 1, 49, 1, 49, 1, 50, 1, 50, 1, 50, 1,
|
|
221
|
+
51, 1, 51, 1, 51, 1, 52, 1, 52, 1, 52, 1, 53, 1, 53, 1, 53, 1, 53, 3, 53, 367, 8, 53, 1,
|
|
222
|
+
54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 378, 8, 54, 1, 55, 1,
|
|
223
|
+
55, 5, 55, 382, 8, 55, 10, 55, 12, 55, 385, 9, 55, 1, 56, 1, 56, 1, 56, 5, 56, 390, 8,
|
|
224
|
+
56, 10, 56, 12, 56, 393, 9, 56, 3, 56, 395, 8, 56, 1, 57, 4, 57, 398, 8, 57, 11, 57, 12,
|
|
225
|
+
57, 399, 1, 57, 5, 57, 403, 8, 57, 10, 57, 12, 57, 406, 9, 57, 1, 57, 3, 57, 409, 8, 57,
|
|
226
|
+
1, 58, 1, 58, 1, 58, 1, 58, 5, 58, 415, 8, 58, 10, 58, 12, 58, 418, 9, 58, 1, 59, 1, 59,
|
|
227
|
+
3, 59, 422, 8, 59, 1, 59, 3, 59, 425, 8, 59, 1, 60, 1, 60, 5, 60, 429, 8, 60, 10, 60, 12,
|
|
228
|
+
60, 432, 9, 60, 1, 60, 1, 60, 1, 61, 4, 61, 437, 8, 61, 11, 61, 12, 61, 438, 1, 61, 5,
|
|
229
|
+
61, 442, 8, 61, 10, 61, 12, 61, 445, 9, 61, 1, 61, 1, 61, 1, 62, 4, 62, 450, 8, 62, 11,
|
|
230
|
+
62, 12, 62, 451, 1, 63, 4, 63, 455, 8, 63, 11, 63, 12, 63, 456, 1, 63, 1, 63, 1, 64, 3,
|
|
231
|
+
64, 462, 8, 64, 1, 64, 1, 64, 3, 64, 466, 8, 64, 1, 64, 3, 64, 469, 8, 64, 1, 64, 1, 64,
|
|
232
|
+
1, 65, 4, 65, 474, 8, 65, 11, 65, 12, 65, 475, 1, 66, 1, 66, 5, 66, 480, 8, 66, 10, 66,
|
|
233
|
+
12, 66, 483, 9, 66, 1, 67, 1, 67, 3, 67, 487, 8, 67, 1, 67, 1, 67, 1, 430, 0, 68, 1, 1,
|
|
233
234
|
3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14,
|
|
234
235
|
29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25,
|
|
235
236
|
51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36,
|
|
@@ -239,7 +240,7 @@ CircuitScriptLexer._serializedATN = [
|
|
|
239
240
|
133, 0, 135, 65, 1, 0, 10, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95,
|
|
240
241
|
97, 122, 1, 0, 49, 57, 2, 0, 48, 57, 95, 95, 1, 0, 48, 57, 1, 0, 48, 48, 5, 0, 77, 77, 107,
|
|
241
242
|
107, 109, 110, 112, 112, 117, 117, 3, 0, 48, 57, 65, 90, 97, 122, 2, 0, 9, 9, 32, 32,
|
|
242
|
-
2, 0, 10, 10, 12, 13,
|
|
243
|
+
2, 0, 10, 10, 12, 13, 511, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0,
|
|
243
244
|
0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0,
|
|
244
245
|
0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0,
|
|
245
246
|
0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0,
|
|
@@ -259,16 +260,16 @@ CircuitScriptLexer._serializedATN = [
|
|
|
259
260
|
206, 1, 0, 0, 0, 33, 210, 1, 0, 0, 0, 35, 213, 1, 0, 0, 0, 37, 216, 1, 0, 0, 0, 39, 222,
|
|
260
261
|
1, 0, 0, 0, 41, 227, 1, 0, 0, 0, 43, 236, 1, 0, 0, 0, 45, 243, 1, 0, 0, 0, 47, 247, 1, 0,
|
|
261
262
|
0, 0, 49, 254, 1, 0, 0, 0, 51, 258, 1, 0, 0, 0, 53, 261, 1, 0, 0, 0, 55, 267, 1, 0, 0, 0,
|
|
262
|
-
57, 276, 1, 0, 0, 0, 59, 279, 1, 0, 0, 0, 61,
|
|
263
|
-
1, 0, 0, 0, 67,
|
|
264
|
-
0, 0, 75,
|
|
265
|
-
83,
|
|
266
|
-
1, 0, 0, 0, 93,
|
|
267
|
-
0, 0, 101,
|
|
268
|
-
0, 0, 109,
|
|
269
|
-
0, 0, 117,
|
|
270
|
-
0, 0, 125,
|
|
271
|
-
0, 0, 133,
|
|
263
|
+
57, 276, 1, 0, 0, 0, 59, 279, 1, 0, 0, 0, 61, 288, 1, 0, 0, 0, 63, 290, 1, 0, 0, 0, 65, 296,
|
|
264
|
+
1, 0, 0, 0, 67, 302, 1, 0, 0, 0, 69, 305, 1, 0, 0, 0, 71, 308, 1, 0, 0, 0, 73, 310, 1, 0,
|
|
265
|
+
0, 0, 75, 313, 1, 0, 0, 0, 77, 315, 1, 0, 0, 0, 79, 323, 1, 0, 0, 0, 81, 329, 1, 0, 0, 0,
|
|
266
|
+
83, 331, 1, 0, 0, 0, 85, 333, 1, 0, 0, 0, 87, 335, 1, 0, 0, 0, 89, 337, 1, 0, 0, 0, 91, 339,
|
|
267
|
+
1, 0, 0, 0, 93, 341, 1, 0, 0, 0, 95, 344, 1, 0, 0, 0, 97, 347, 1, 0, 0, 0, 99, 350, 1, 0,
|
|
268
|
+
0, 0, 101, 353, 1, 0, 0, 0, 103, 356, 1, 0, 0, 0, 105, 359, 1, 0, 0, 0, 107, 366, 1, 0,
|
|
269
|
+
0, 0, 109, 377, 1, 0, 0, 0, 111, 379, 1, 0, 0, 0, 113, 394, 1, 0, 0, 0, 115, 408, 1, 0,
|
|
270
|
+
0, 0, 117, 410, 1, 0, 0, 0, 119, 421, 1, 0, 0, 0, 121, 426, 1, 0, 0, 0, 123, 436, 1, 0,
|
|
271
|
+
0, 0, 125, 449, 1, 0, 0, 0, 127, 454, 1, 0, 0, 0, 129, 465, 1, 0, 0, 0, 131, 473, 1, 0,
|
|
272
|
+
0, 0, 133, 477, 1, 0, 0, 0, 135, 486, 1, 0, 0, 0, 137, 138, 5, 58, 0, 0, 138, 2, 1, 0, 0,
|
|
272
273
|
0, 139, 140, 5, 44, 0, 0, 140, 4, 1, 0, 0, 0, 141, 142, 5, 61, 0, 0, 142, 6, 1, 0, 0, 0,
|
|
273
274
|
143, 144, 5, 46, 0, 0, 144, 145, 5, 46, 0, 0, 145, 8, 1, 0, 0, 0, 146, 147, 5, 46, 0, 0,
|
|
274
275
|
147, 10, 1, 0, 0, 0, 148, 149, 5, 91, 0, 0, 149, 12, 1, 0, 0, 0, 150, 151, 5, 93, 0, 0,
|
|
@@ -307,64 +308,68 @@ CircuitScriptLexer._serializedATN = [
|
|
|
307
308
|
0, 271, 272, 5, 105, 0, 0, 272, 273, 5, 110, 0, 0, 273, 274, 5, 117, 0, 0, 274, 275,
|
|
308
309
|
5, 101, 0, 0, 275, 56, 1, 0, 0, 0, 276, 277, 5, 105, 0, 0, 277, 278, 5, 102, 0, 0, 278,
|
|
309
310
|
58, 1, 0, 0, 0, 279, 280, 5, 101, 0, 0, 280, 281, 5, 108, 0, 0, 281, 282, 5, 115, 0, 0,
|
|
310
|
-
282, 283, 5, 101, 0, 0, 283, 60, 1, 0, 0, 0, 284,
|
|
311
|
-
286, 287, 5,
|
|
312
|
-
0, 0,
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
0, 0,
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
403,
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
0, 0, 416,
|
|
348
|
-
0, 0, 419,
|
|
349
|
-
0,
|
|
350
|
-
0,
|
|
351
|
-
0,
|
|
352
|
-
0,
|
|
353
|
-
0,
|
|
354
|
-
0,
|
|
355
|
-
0,
|
|
356
|
-
0,
|
|
357
|
-
0, 0, 0, 450, 451, 1, 0, 0, 0, 451,
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
1, 0, 0, 0,
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
311
|
+
282, 283, 5, 101, 0, 0, 283, 60, 1, 0, 0, 0, 284, 289, 5, 33, 0, 0, 285, 286, 5, 110,
|
|
312
|
+
0, 0, 286, 287, 5, 111, 0, 0, 287, 289, 5, 116, 0, 0, 288, 284, 1, 0, 0, 0, 288, 285,
|
|
313
|
+
1, 0, 0, 0, 289, 62, 1, 0, 0, 0, 290, 291, 5, 102, 0, 0, 291, 292, 5, 114, 0, 0, 292, 293,
|
|
314
|
+
5, 97, 0, 0, 293, 294, 5, 109, 0, 0, 294, 295, 5, 101, 0, 0, 295, 64, 1, 0, 0, 0, 296,
|
|
315
|
+
297, 5, 115, 0, 0, 297, 298, 5, 104, 0, 0, 298, 299, 5, 101, 0, 0, 299, 300, 5, 101,
|
|
316
|
+
0, 0, 300, 301, 5, 116, 0, 0, 301, 66, 1, 0, 0, 0, 302, 303, 5, 61, 0, 0, 303, 304, 5,
|
|
317
|
+
61, 0, 0, 304, 68, 1, 0, 0, 0, 305, 306, 5, 33, 0, 0, 306, 307, 5, 61, 0, 0, 307, 70, 1,
|
|
318
|
+
0, 0, 0, 308, 309, 5, 62, 0, 0, 309, 72, 1, 0, 0, 0, 310, 311, 5, 62, 0, 0, 311, 312, 5,
|
|
319
|
+
61, 0, 0, 312, 74, 1, 0, 0, 0, 313, 314, 5, 60, 0, 0, 314, 76, 1, 0, 0, 0, 315, 316, 5,
|
|
320
|
+
60, 0, 0, 316, 317, 5, 61, 0, 0, 317, 78, 1, 0, 0, 0, 318, 319, 5, 38, 0, 0, 319, 324,
|
|
321
|
+
5, 38, 0, 0, 320, 321, 5, 97, 0, 0, 321, 322, 5, 110, 0, 0, 322, 324, 5, 100, 0, 0, 323,
|
|
322
|
+
318, 1, 0, 0, 0, 323, 320, 1, 0, 0, 0, 324, 80, 1, 0, 0, 0, 325, 326, 5, 124, 0, 0, 326,
|
|
323
|
+
330, 5, 124, 0, 0, 327, 328, 5, 111, 0, 0, 328, 330, 5, 114, 0, 0, 329, 325, 1, 0, 0,
|
|
324
|
+
0, 329, 327, 1, 0, 0, 0, 330, 82, 1, 0, 0, 0, 331, 332, 5, 43, 0, 0, 332, 84, 1, 0, 0, 0,
|
|
325
|
+
333, 334, 5, 45, 0, 0, 334, 86, 1, 0, 0, 0, 335, 336, 5, 47, 0, 0, 336, 88, 1, 0, 0, 0,
|
|
326
|
+
337, 338, 5, 42, 0, 0, 338, 90, 1, 0, 0, 0, 339, 340, 5, 37, 0, 0, 340, 92, 1, 0, 0, 0,
|
|
327
|
+
341, 342, 5, 43, 0, 0, 342, 343, 5, 61, 0, 0, 343, 94, 1, 0, 0, 0, 344, 345, 5, 45, 0,
|
|
328
|
+
0, 345, 346, 5, 61, 0, 0, 346, 96, 1, 0, 0, 0, 347, 348, 5, 47, 0, 0, 348, 349, 5, 61,
|
|
329
|
+
0, 0, 349, 98, 1, 0, 0, 0, 350, 351, 5, 42, 0, 0, 351, 352, 5, 61, 0, 0, 352, 100, 1, 0,
|
|
330
|
+
0, 0, 353, 354, 5, 37, 0, 0, 354, 355, 5, 61, 0, 0, 355, 102, 1, 0, 0, 0, 356, 357, 5,
|
|
331
|
+
40, 0, 0, 357, 358, 6, 51, 0, 0, 358, 104, 1, 0, 0, 0, 359, 360, 5, 41, 0, 0, 360, 361,
|
|
332
|
+
6, 52, 1, 0, 361, 106, 1, 0, 0, 0, 362, 363, 5, 110, 0, 0, 363, 367, 5, 99, 0, 0, 364,
|
|
333
|
+
365, 5, 78, 0, 0, 365, 367, 5, 67, 0, 0, 366, 362, 1, 0, 0, 0, 366, 364, 1, 0, 0, 0, 367,
|
|
334
|
+
108, 1, 0, 0, 0, 368, 369, 5, 116, 0, 0, 369, 370, 5, 114, 0, 0, 370, 371, 5, 117, 0,
|
|
335
|
+
0, 371, 378, 5, 101, 0, 0, 372, 373, 5, 102, 0, 0, 373, 374, 5, 97, 0, 0, 374, 375, 5,
|
|
336
|
+
108, 0, 0, 375, 376, 5, 115, 0, 0, 376, 378, 5, 101, 0, 0, 377, 368, 1, 0, 0, 0, 377,
|
|
337
|
+
372, 1, 0, 0, 0, 378, 110, 1, 0, 0, 0, 379, 383, 7, 0, 0, 0, 380, 382, 7, 1, 0, 0, 381,
|
|
338
|
+
380, 1, 0, 0, 0, 382, 385, 1, 0, 0, 0, 383, 381, 1, 0, 0, 0, 383, 384, 1, 0, 0, 0, 384,
|
|
339
|
+
112, 1, 0, 0, 0, 385, 383, 1, 0, 0, 0, 386, 395, 5, 48, 0, 0, 387, 391, 7, 2, 0, 0, 388,
|
|
340
|
+
390, 7, 3, 0, 0, 389, 388, 1, 0, 0, 0, 390, 393, 1, 0, 0, 0, 391, 389, 1, 0, 0, 0, 391,
|
|
341
|
+
392, 1, 0, 0, 0, 392, 395, 1, 0, 0, 0, 393, 391, 1, 0, 0, 0, 394, 386, 1, 0, 0, 0, 394,
|
|
342
|
+
387, 1, 0, 0, 0, 395, 114, 1, 0, 0, 0, 396, 398, 7, 2, 0, 0, 397, 396, 1, 0, 0, 0, 398,
|
|
343
|
+
399, 1, 0, 0, 0, 399, 397, 1, 0, 0, 0, 399, 400, 1, 0, 0, 0, 400, 404, 1, 0, 0, 0, 401,
|
|
344
|
+
403, 7, 4, 0, 0, 402, 401, 1, 0, 0, 0, 403, 406, 1, 0, 0, 0, 404, 402, 1, 0, 0, 0, 404,
|
|
345
|
+
405, 1, 0, 0, 0, 405, 409, 1, 0, 0, 0, 406, 404, 1, 0, 0, 0, 407, 409, 7, 5, 0, 0, 408,
|
|
346
|
+
397, 1, 0, 0, 0, 408, 407, 1, 0, 0, 0, 409, 116, 1, 0, 0, 0, 410, 411, 3, 113, 56, 0, 411,
|
|
347
|
+
412, 5, 46, 0, 0, 412, 416, 7, 4, 0, 0, 413, 415, 7, 3, 0, 0, 414, 413, 1, 0, 0, 0, 415,
|
|
348
|
+
418, 1, 0, 0, 0, 416, 414, 1, 0, 0, 0, 416, 417, 1, 0, 0, 0, 417, 118, 1, 0, 0, 0, 418,
|
|
349
|
+
416, 1, 0, 0, 0, 419, 422, 3, 115, 57, 0, 420, 422, 3, 117, 58, 0, 421, 419, 1, 0, 0,
|
|
350
|
+
0, 421, 420, 1, 0, 0, 0, 422, 424, 1, 0, 0, 0, 423, 425, 7, 6, 0, 0, 424, 423, 1, 0, 0,
|
|
351
|
+
0, 424, 425, 1, 0, 0, 0, 425, 120, 1, 0, 0, 0, 426, 430, 5, 34, 0, 0, 427, 429, 9, 0, 0,
|
|
352
|
+
0, 428, 427, 1, 0, 0, 0, 429, 432, 1, 0, 0, 0, 430, 431, 1, 0, 0, 0, 430, 428, 1, 0, 0,
|
|
353
|
+
0, 431, 433, 1, 0, 0, 0, 432, 430, 1, 0, 0, 0, 433, 434, 5, 34, 0, 0, 434, 122, 1, 0, 0,
|
|
354
|
+
0, 435, 437, 7, 2, 0, 0, 436, 435, 1, 0, 0, 0, 437, 438, 1, 0, 0, 0, 438, 436, 1, 0, 0,
|
|
355
|
+
0, 438, 439, 1, 0, 0, 0, 439, 443, 1, 0, 0, 0, 440, 442, 7, 4, 0, 0, 441, 440, 1, 0, 0,
|
|
356
|
+
0, 442, 445, 1, 0, 0, 0, 443, 441, 1, 0, 0, 0, 443, 444, 1, 0, 0, 0, 444, 446, 1, 0, 0,
|
|
357
|
+
0, 445, 443, 1, 0, 0, 0, 446, 447, 5, 37, 0, 0, 447, 124, 1, 0, 0, 0, 448, 450, 7, 7, 0,
|
|
358
|
+
0, 449, 448, 1, 0, 0, 0, 450, 451, 1, 0, 0, 0, 451, 449, 1, 0, 0, 0, 451, 452, 1, 0, 0,
|
|
359
|
+
0, 452, 126, 1, 0, 0, 0, 453, 455, 7, 8, 0, 0, 454, 453, 1, 0, 0, 0, 455, 456, 1, 0, 0,
|
|
360
|
+
0, 456, 454, 1, 0, 0, 0, 456, 457, 1, 0, 0, 0, 457, 458, 1, 0, 0, 0, 458, 459, 6, 63, 2,
|
|
361
|
+
0, 459, 128, 1, 0, 0, 0, 460, 462, 5, 13, 0, 0, 461, 460, 1, 0, 0, 0, 461, 462, 1, 0, 0,
|
|
362
|
+
0, 462, 463, 1, 0, 0, 0, 463, 466, 5, 10, 0, 0, 464, 466, 2, 12, 13, 0, 465, 461, 1, 0,
|
|
363
|
+
0, 0, 465, 464, 1, 0, 0, 0, 466, 468, 1, 0, 0, 0, 467, 469, 3, 131, 65, 0, 468, 467, 1,
|
|
364
|
+
0, 0, 0, 468, 469, 1, 0, 0, 0, 469, 470, 1, 0, 0, 0, 470, 471, 6, 64, 3, 0, 471, 130, 1,
|
|
365
|
+
0, 0, 0, 472, 474, 7, 8, 0, 0, 473, 472, 1, 0, 0, 0, 474, 475, 1, 0, 0, 0, 475, 473, 1,
|
|
366
|
+
0, 0, 0, 475, 476, 1, 0, 0, 0, 476, 132, 1, 0, 0, 0, 477, 481, 5, 35, 0, 0, 478, 480, 8,
|
|
367
|
+
9, 0, 0, 479, 478, 1, 0, 0, 0, 480, 483, 1, 0, 0, 0, 481, 479, 1, 0, 0, 0, 481, 482, 1,
|
|
368
|
+
0, 0, 0, 482, 134, 1, 0, 0, 0, 483, 481, 1, 0, 0, 0, 484, 487, 3, 127, 63, 0, 485, 487,
|
|
369
|
+
3, 133, 66, 0, 486, 484, 1, 0, 0, 0, 486, 485, 1, 0, 0, 0, 487, 488, 1, 0, 0, 0, 488, 489,
|
|
370
|
+
6, 67, 4, 0, 489, 136, 1, 0, 0, 0, 26, 0, 288, 323, 329, 366, 377, 383, 391, 394, 399,
|
|
371
|
+
404, 408, 416, 421, 424, 430, 438, 443, 451, 456, 461, 465, 468, 475, 481, 486,
|
|
372
|
+
5, 1, 51, 0, 1, 52, 1, 6, 0, 0, 1, 64, 2, 0, 2, 0
|
|
368
373
|
];
|
|
369
374
|
CircuitScriptLexer.vocabulary = new antlr.Vocabulary(CircuitScriptLexer.literalNames, CircuitScriptLexer.symbolicNames, []);
|
|
370
375
|
CircuitScriptLexer.decisionsToDFA = CircuitScriptLexer._ATN.decisionToState.map((ds, index) => new antlr.DFA(ds, index));
|
|
@@ -3654,8 +3654,8 @@ CircuitScriptParser.literalNames = [
|
|
|
3654
3654
|
"'branch'", "'create'", "'component'", "'graphic'", "'module'",
|
|
3655
3655
|
"'wire'", "'pin'", "'add'", "'at'", "'to'", "'point'", "'join'",
|
|
3656
3656
|
"'parallel'", "'return'", "'def'", "'import'", "'for'", "'in'",
|
|
3657
|
-
"'while'", "'continue'", "'if'", "'else'",
|
|
3658
|
-
"'=='", "'!='", "'>'", "'>='", "'<'", "'<='",
|
|
3657
|
+
"'while'", "'continue'", "'if'", "'else'", null, "'frame'", "'sheet'",
|
|
3658
|
+
"'=='", "'!='", "'>'", "'>='", "'<'", "'<='", null, null, "'+'",
|
|
3659
3659
|
"'-'", "'/'", "'*'", "'%'", "'+='", "'-='", "'/='", "'*='", "'%='",
|
|
3660
3660
|
"'('", "')'"
|
|
3661
3661
|
];
|
package/dist/cjs/export.js
CHANGED
|
@@ -53,6 +53,7 @@ function generateKiCADNetList(netlist) {
|
|
|
53
53
|
if (instance.typeProp !== globals_js_1.ComponentTypes.label &&
|
|
54
54
|
instance.typeProp !== globals_js_1.ComponentTypes.net &&
|
|
55
55
|
instance.typeProp !== globals_js_1.ComponentTypes.point &&
|
|
56
|
+
instance.typeProp !== globals_js_1.ComponentTypes.frame &&
|
|
56
57
|
instance.typeProp !== null) {
|
|
57
58
|
console.log('Skipping', instance.instanceName);
|
|
58
59
|
}
|
package/dist/cjs/globals.js
CHANGED
|
@@ -78,6 +78,7 @@ var ComponentTypes;
|
|
|
78
78
|
ComponentTypes["net"] = "net";
|
|
79
79
|
ComponentTypes["label"] = "label";
|
|
80
80
|
ComponentTypes["point"] = "point";
|
|
81
|
+
ComponentTypes["frame"] = "frame";
|
|
81
82
|
})(ComponentTypes || (exports.ComponentTypes = ComponentTypes = {}));
|
|
82
83
|
var ReferenceTypes;
|
|
83
84
|
(function (ReferenceTypes) {
|
package/dist/cjs/helpers.js
CHANGED
|
@@ -161,7 +161,7 @@ function validateScript(scriptData, options) {
|
|
|
161
161
|
}
|
|
162
162
|
exports.validateScript = validateScript;
|
|
163
163
|
function renderScript(scriptData, outputPath, options) {
|
|
164
|
-
const { currentDirectory = null, defaultLibsPath, dumpNets = false, dumpData = false,
|
|
164
|
+
const { currentDirectory = null, defaultLibsPath, dumpNets = false, dumpData = false, showStats = false } = options;
|
|
165
165
|
const onErrorHandler = (line, column, message, error) => {
|
|
166
166
|
if (error instanceof visitor_js_1.VisitorExecutionException) {
|
|
167
167
|
console.log('Error', line, column, message, error.errorMessage);
|
|
@@ -194,14 +194,6 @@ function renderScript(scriptData, outputPath, options) {
|
|
|
194
194
|
catch (err) {
|
|
195
195
|
console.log('Error during annotation: ', err);
|
|
196
196
|
}
|
|
197
|
-
if (kicadNetlistPath) {
|
|
198
|
-
const { tree: kicadNetList, missingFootprints } = (0, export_js_1.generateKiCADNetList)(visitor.getNetList());
|
|
199
|
-
missingFootprints.forEach(entry => {
|
|
200
|
-
console.log(`${entry.refdes} (${entry.instanceName}) does not have footprint`);
|
|
201
|
-
});
|
|
202
|
-
(0, fs_1.writeFileSync)(kicadNetlistPath, (0, export_js_1.printTree)(kicadNetList));
|
|
203
|
-
console.log('Generated KiCad netlist file');
|
|
204
|
-
}
|
|
205
197
|
const { sequence, nets } = visitor.getGraph();
|
|
206
198
|
const tmpSequence = sequence.map(item => {
|
|
207
199
|
const tmp = [...item];
|
|
@@ -230,6 +222,15 @@ function renderScript(scriptData, outputPath, options) {
|
|
|
230
222
|
outputDefaultZoom = 1;
|
|
231
223
|
}
|
|
232
224
|
}
|
|
225
|
+
if (fileExtension === 'net') {
|
|
226
|
+
const { tree: kicadNetList, missingFootprints } = (0, export_js_1.generateKiCADNetList)(visitor.getNetList());
|
|
227
|
+
missingFootprints.forEach(entry => {
|
|
228
|
+
console.log(`${entry.refdes} (${entry.instanceName}) does not have footprint`);
|
|
229
|
+
});
|
|
230
|
+
(0, fs_1.writeFileSync)(outputPath, (0, export_js_1.printTree)(kicadNetList));
|
|
231
|
+
console.log('Generated file', outputPath);
|
|
232
|
+
return null;
|
|
233
|
+
}
|
|
233
234
|
const layoutEngine = new layout_js_1.LayoutEngine();
|
|
234
235
|
const layoutTimer = new utils_js_1.SimpleStopwatch();
|
|
235
236
|
const sheetFrames = layoutEngine.runLayout(sequence, nets);
|
package/dist/cjs/main.js
CHANGED
|
@@ -21,7 +21,6 @@ async function main() {
|
|
|
21
21
|
.argument('[output path]', 'Output path')
|
|
22
22
|
.option('-i, --input text <input text>', 'Input text directly')
|
|
23
23
|
.option('-c, --current-directory <path>', 'Set current directory')
|
|
24
|
-
.option('-k, --kicad-netlist <filename>', 'Create KiCad netlist')
|
|
25
24
|
.option('-w, --watch', 'Watch for file changes')
|
|
26
25
|
.option('-n, --dump-nets', 'Dump out net information')
|
|
27
26
|
.option('-d, --dump-data', 'Dump data during parsing')
|
|
@@ -38,7 +37,6 @@ async function main() {
|
|
|
38
37
|
const watchFileChanges = options.watch;
|
|
39
38
|
const dumpNets = options.dumpNets;
|
|
40
39
|
const dumpData = options.dumpData;
|
|
41
|
-
const kicadNetlist = options.kicadNetlist;
|
|
42
40
|
let currentDirectory = options.currentDirectory ?? null;
|
|
43
41
|
if (watchFileChanges) {
|
|
44
42
|
console.log('watching for file changes...');
|
|
@@ -75,7 +73,6 @@ async function main() {
|
|
|
75
73
|
defaultLibsPath,
|
|
76
74
|
dumpNets,
|
|
77
75
|
dumpData,
|
|
78
|
-
kicadNetlistPath: kicadNetlist,
|
|
79
76
|
showStats: options.stats,
|
|
80
77
|
};
|
|
81
78
|
let outputPath = null;
|
package/dist/cjs/visitor.js
CHANGED
|
@@ -481,6 +481,9 @@ class ParserVisitor extends BaseVisitor_js_1.BaseVisitor {
|
|
|
481
481
|
if (typeof value === "boolean") {
|
|
482
482
|
value = !value;
|
|
483
483
|
}
|
|
484
|
+
else if (typeof value === "number") {
|
|
485
|
+
value = (value === 0) ? false : true;
|
|
486
|
+
}
|
|
484
487
|
else {
|
|
485
488
|
throw "Failed to do Not operator";
|
|
486
489
|
}
|
|
@@ -1224,6 +1227,9 @@ class ComponentAnnotater {
|
|
|
1224
1227
|
this.counter[type] = 1;
|
|
1225
1228
|
}
|
|
1226
1229
|
}
|
|
1230
|
+
if (ComponentRefDesPrefixes[type] === undefined) {
|
|
1231
|
+
return null;
|
|
1232
|
+
}
|
|
1227
1233
|
let attempts = 100;
|
|
1228
1234
|
let proposedName;
|
|
1229
1235
|
while (attempts >= 0) {
|
|
@@ -73,8 +73,8 @@ export class CircuitScriptLexer extends antlr.Lexer {
|
|
|
73
73
|
"'branch'", "'create'", "'component'", "'graphic'", "'module'",
|
|
74
74
|
"'wire'", "'pin'", "'add'", "'at'", "'to'", "'point'", "'join'",
|
|
75
75
|
"'parallel'", "'return'", "'def'", "'import'", "'for'", "'in'",
|
|
76
|
-
"'while'", "'continue'", "'if'", "'else'",
|
|
77
|
-
"'=='", "'!='", "'>'", "'>='", "'<'", "'<='",
|
|
76
|
+
"'while'", "'continue'", "'if'", "'else'", null, "'frame'", "'sheet'",
|
|
77
|
+
"'=='", "'!='", "'>'", "'>='", "'<'", "'<='", null, null, "'+'",
|
|
78
78
|
"'-'", "'/'", "'*'", "'%'", "'+='", "'-='", "'/='", "'*='", "'%='",
|
|
79
79
|
"'('", "')'"
|
|
80
80
|
];
|
|
@@ -154,7 +154,7 @@ export class CircuitScriptLexer extends antlr.Lexer {
|
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
static _serializedATN = [
|
|
157
|
-
4, 0, 65,
|
|
157
|
+
4, 0, 65, 490, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5,
|
|
158
158
|
2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2,
|
|
159
159
|
13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7,
|
|
160
160
|
19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2,
|
|
@@ -175,24 +175,25 @@ export class CircuitScriptLexer extends antlr.Lexer {
|
|
|
175
175
|
1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 24,
|
|
176
176
|
1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27,
|
|
177
177
|
1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29,
|
|
178
|
-
1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1,
|
|
179
|
-
1,
|
|
180
|
-
1,
|
|
181
|
-
1,
|
|
182
|
-
1,
|
|
183
|
-
1,
|
|
184
|
-
1,
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
178
|
+
1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 1, 30, 3, 30, 289, 8, 30, 1, 31, 1, 31, 1, 31,
|
|
179
|
+
1, 31, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 34,
|
|
180
|
+
1, 34, 1, 34, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 39,
|
|
181
|
+
1, 39, 1, 39, 1, 39, 1, 39, 3, 39, 324, 8, 39, 1, 40, 1, 40, 1, 40, 1, 40, 3, 40, 330, 8,
|
|
182
|
+
40, 1, 41, 1, 41, 1, 42, 1, 42, 1, 43, 1, 43, 1, 44, 1, 44, 1, 45, 1, 45, 1, 46, 1, 46, 1,
|
|
183
|
+
46, 1, 47, 1, 47, 1, 47, 1, 48, 1, 48, 1, 48, 1, 49, 1, 49, 1, 49, 1, 50, 1, 50, 1, 50, 1,
|
|
184
|
+
51, 1, 51, 1, 51, 1, 52, 1, 52, 1, 52, 1, 53, 1, 53, 1, 53, 1, 53, 3, 53, 367, 8, 53, 1,
|
|
185
|
+
54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 378, 8, 54, 1, 55, 1,
|
|
186
|
+
55, 5, 55, 382, 8, 55, 10, 55, 12, 55, 385, 9, 55, 1, 56, 1, 56, 1, 56, 5, 56, 390, 8,
|
|
187
|
+
56, 10, 56, 12, 56, 393, 9, 56, 3, 56, 395, 8, 56, 1, 57, 4, 57, 398, 8, 57, 11, 57, 12,
|
|
188
|
+
57, 399, 1, 57, 5, 57, 403, 8, 57, 10, 57, 12, 57, 406, 9, 57, 1, 57, 3, 57, 409, 8, 57,
|
|
189
|
+
1, 58, 1, 58, 1, 58, 1, 58, 5, 58, 415, 8, 58, 10, 58, 12, 58, 418, 9, 58, 1, 59, 1, 59,
|
|
190
|
+
3, 59, 422, 8, 59, 1, 59, 3, 59, 425, 8, 59, 1, 60, 1, 60, 5, 60, 429, 8, 60, 10, 60, 12,
|
|
191
|
+
60, 432, 9, 60, 1, 60, 1, 60, 1, 61, 4, 61, 437, 8, 61, 11, 61, 12, 61, 438, 1, 61, 5,
|
|
192
|
+
61, 442, 8, 61, 10, 61, 12, 61, 445, 9, 61, 1, 61, 1, 61, 1, 62, 4, 62, 450, 8, 62, 11,
|
|
193
|
+
62, 12, 62, 451, 1, 63, 4, 63, 455, 8, 63, 11, 63, 12, 63, 456, 1, 63, 1, 63, 1, 64, 3,
|
|
194
|
+
64, 462, 8, 64, 1, 64, 1, 64, 3, 64, 466, 8, 64, 1, 64, 3, 64, 469, 8, 64, 1, 64, 1, 64,
|
|
195
|
+
1, 65, 4, 65, 474, 8, 65, 11, 65, 12, 65, 475, 1, 66, 1, 66, 5, 66, 480, 8, 66, 10, 66,
|
|
196
|
+
12, 66, 483, 9, 66, 1, 67, 1, 67, 3, 67, 487, 8, 67, 1, 67, 1, 67, 1, 430, 0, 68, 1, 1,
|
|
196
197
|
3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14,
|
|
197
198
|
29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25,
|
|
198
199
|
51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36,
|
|
@@ -202,7 +203,7 @@ export class CircuitScriptLexer extends antlr.Lexer {
|
|
|
202
203
|
133, 0, 135, 65, 1, 0, 10, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95,
|
|
203
204
|
97, 122, 1, 0, 49, 57, 2, 0, 48, 57, 95, 95, 1, 0, 48, 57, 1, 0, 48, 48, 5, 0, 77, 77, 107,
|
|
204
205
|
107, 109, 110, 112, 112, 117, 117, 3, 0, 48, 57, 65, 90, 97, 122, 2, 0, 9, 9, 32, 32,
|
|
205
|
-
2, 0, 10, 10, 12, 13,
|
|
206
|
+
2, 0, 10, 10, 12, 13, 511, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0,
|
|
206
207
|
0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0,
|
|
207
208
|
0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0,
|
|
208
209
|
0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0,
|
|
@@ -222,16 +223,16 @@ export class CircuitScriptLexer extends antlr.Lexer {
|
|
|
222
223
|
206, 1, 0, 0, 0, 33, 210, 1, 0, 0, 0, 35, 213, 1, 0, 0, 0, 37, 216, 1, 0, 0, 0, 39, 222,
|
|
223
224
|
1, 0, 0, 0, 41, 227, 1, 0, 0, 0, 43, 236, 1, 0, 0, 0, 45, 243, 1, 0, 0, 0, 47, 247, 1, 0,
|
|
224
225
|
0, 0, 49, 254, 1, 0, 0, 0, 51, 258, 1, 0, 0, 0, 53, 261, 1, 0, 0, 0, 55, 267, 1, 0, 0, 0,
|
|
225
|
-
57, 276, 1, 0, 0, 0, 59, 279, 1, 0, 0, 0, 61,
|
|
226
|
-
1, 0, 0, 0, 67,
|
|
227
|
-
0, 0, 75,
|
|
228
|
-
83,
|
|
229
|
-
1, 0, 0, 0, 93,
|
|
230
|
-
0, 0, 101,
|
|
231
|
-
0, 0, 109,
|
|
232
|
-
0, 0, 117,
|
|
233
|
-
0, 0, 125,
|
|
234
|
-
0, 0, 133,
|
|
226
|
+
57, 276, 1, 0, 0, 0, 59, 279, 1, 0, 0, 0, 61, 288, 1, 0, 0, 0, 63, 290, 1, 0, 0, 0, 65, 296,
|
|
227
|
+
1, 0, 0, 0, 67, 302, 1, 0, 0, 0, 69, 305, 1, 0, 0, 0, 71, 308, 1, 0, 0, 0, 73, 310, 1, 0,
|
|
228
|
+
0, 0, 75, 313, 1, 0, 0, 0, 77, 315, 1, 0, 0, 0, 79, 323, 1, 0, 0, 0, 81, 329, 1, 0, 0, 0,
|
|
229
|
+
83, 331, 1, 0, 0, 0, 85, 333, 1, 0, 0, 0, 87, 335, 1, 0, 0, 0, 89, 337, 1, 0, 0, 0, 91, 339,
|
|
230
|
+
1, 0, 0, 0, 93, 341, 1, 0, 0, 0, 95, 344, 1, 0, 0, 0, 97, 347, 1, 0, 0, 0, 99, 350, 1, 0,
|
|
231
|
+
0, 0, 101, 353, 1, 0, 0, 0, 103, 356, 1, 0, 0, 0, 105, 359, 1, 0, 0, 0, 107, 366, 1, 0,
|
|
232
|
+
0, 0, 109, 377, 1, 0, 0, 0, 111, 379, 1, 0, 0, 0, 113, 394, 1, 0, 0, 0, 115, 408, 1, 0,
|
|
233
|
+
0, 0, 117, 410, 1, 0, 0, 0, 119, 421, 1, 0, 0, 0, 121, 426, 1, 0, 0, 0, 123, 436, 1, 0,
|
|
234
|
+
0, 0, 125, 449, 1, 0, 0, 0, 127, 454, 1, 0, 0, 0, 129, 465, 1, 0, 0, 0, 131, 473, 1, 0,
|
|
235
|
+
0, 0, 133, 477, 1, 0, 0, 0, 135, 486, 1, 0, 0, 0, 137, 138, 5, 58, 0, 0, 138, 2, 1, 0, 0,
|
|
235
236
|
0, 139, 140, 5, 44, 0, 0, 140, 4, 1, 0, 0, 0, 141, 142, 5, 61, 0, 0, 142, 6, 1, 0, 0, 0,
|
|
236
237
|
143, 144, 5, 46, 0, 0, 144, 145, 5, 46, 0, 0, 145, 8, 1, 0, 0, 0, 146, 147, 5, 46, 0, 0,
|
|
237
238
|
147, 10, 1, 0, 0, 0, 148, 149, 5, 91, 0, 0, 149, 12, 1, 0, 0, 0, 150, 151, 5, 93, 0, 0,
|
|
@@ -270,64 +271,68 @@ export class CircuitScriptLexer extends antlr.Lexer {
|
|
|
270
271
|
0, 271, 272, 5, 105, 0, 0, 272, 273, 5, 110, 0, 0, 273, 274, 5, 117, 0, 0, 274, 275,
|
|
271
272
|
5, 101, 0, 0, 275, 56, 1, 0, 0, 0, 276, 277, 5, 105, 0, 0, 277, 278, 5, 102, 0, 0, 278,
|
|
272
273
|
58, 1, 0, 0, 0, 279, 280, 5, 101, 0, 0, 280, 281, 5, 108, 0, 0, 281, 282, 5, 115, 0, 0,
|
|
273
|
-
282, 283, 5, 101, 0, 0, 283, 60, 1, 0, 0, 0, 284,
|
|
274
|
-
286, 287, 5,
|
|
275
|
-
0, 0,
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
0, 0,
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
403,
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
0, 0, 416,
|
|
311
|
-
0, 0, 419,
|
|
312
|
-
0,
|
|
313
|
-
0,
|
|
314
|
-
0,
|
|
315
|
-
0,
|
|
316
|
-
0,
|
|
317
|
-
0,
|
|
318
|
-
0,
|
|
319
|
-
0,
|
|
320
|
-
0, 0, 0, 450, 451, 1, 0, 0, 0, 451,
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
1, 0, 0, 0,
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
274
|
+
282, 283, 5, 101, 0, 0, 283, 60, 1, 0, 0, 0, 284, 289, 5, 33, 0, 0, 285, 286, 5, 110,
|
|
275
|
+
0, 0, 286, 287, 5, 111, 0, 0, 287, 289, 5, 116, 0, 0, 288, 284, 1, 0, 0, 0, 288, 285,
|
|
276
|
+
1, 0, 0, 0, 289, 62, 1, 0, 0, 0, 290, 291, 5, 102, 0, 0, 291, 292, 5, 114, 0, 0, 292, 293,
|
|
277
|
+
5, 97, 0, 0, 293, 294, 5, 109, 0, 0, 294, 295, 5, 101, 0, 0, 295, 64, 1, 0, 0, 0, 296,
|
|
278
|
+
297, 5, 115, 0, 0, 297, 298, 5, 104, 0, 0, 298, 299, 5, 101, 0, 0, 299, 300, 5, 101,
|
|
279
|
+
0, 0, 300, 301, 5, 116, 0, 0, 301, 66, 1, 0, 0, 0, 302, 303, 5, 61, 0, 0, 303, 304, 5,
|
|
280
|
+
61, 0, 0, 304, 68, 1, 0, 0, 0, 305, 306, 5, 33, 0, 0, 306, 307, 5, 61, 0, 0, 307, 70, 1,
|
|
281
|
+
0, 0, 0, 308, 309, 5, 62, 0, 0, 309, 72, 1, 0, 0, 0, 310, 311, 5, 62, 0, 0, 311, 312, 5,
|
|
282
|
+
61, 0, 0, 312, 74, 1, 0, 0, 0, 313, 314, 5, 60, 0, 0, 314, 76, 1, 0, 0, 0, 315, 316, 5,
|
|
283
|
+
60, 0, 0, 316, 317, 5, 61, 0, 0, 317, 78, 1, 0, 0, 0, 318, 319, 5, 38, 0, 0, 319, 324,
|
|
284
|
+
5, 38, 0, 0, 320, 321, 5, 97, 0, 0, 321, 322, 5, 110, 0, 0, 322, 324, 5, 100, 0, 0, 323,
|
|
285
|
+
318, 1, 0, 0, 0, 323, 320, 1, 0, 0, 0, 324, 80, 1, 0, 0, 0, 325, 326, 5, 124, 0, 0, 326,
|
|
286
|
+
330, 5, 124, 0, 0, 327, 328, 5, 111, 0, 0, 328, 330, 5, 114, 0, 0, 329, 325, 1, 0, 0,
|
|
287
|
+
0, 329, 327, 1, 0, 0, 0, 330, 82, 1, 0, 0, 0, 331, 332, 5, 43, 0, 0, 332, 84, 1, 0, 0, 0,
|
|
288
|
+
333, 334, 5, 45, 0, 0, 334, 86, 1, 0, 0, 0, 335, 336, 5, 47, 0, 0, 336, 88, 1, 0, 0, 0,
|
|
289
|
+
337, 338, 5, 42, 0, 0, 338, 90, 1, 0, 0, 0, 339, 340, 5, 37, 0, 0, 340, 92, 1, 0, 0, 0,
|
|
290
|
+
341, 342, 5, 43, 0, 0, 342, 343, 5, 61, 0, 0, 343, 94, 1, 0, 0, 0, 344, 345, 5, 45, 0,
|
|
291
|
+
0, 345, 346, 5, 61, 0, 0, 346, 96, 1, 0, 0, 0, 347, 348, 5, 47, 0, 0, 348, 349, 5, 61,
|
|
292
|
+
0, 0, 349, 98, 1, 0, 0, 0, 350, 351, 5, 42, 0, 0, 351, 352, 5, 61, 0, 0, 352, 100, 1, 0,
|
|
293
|
+
0, 0, 353, 354, 5, 37, 0, 0, 354, 355, 5, 61, 0, 0, 355, 102, 1, 0, 0, 0, 356, 357, 5,
|
|
294
|
+
40, 0, 0, 357, 358, 6, 51, 0, 0, 358, 104, 1, 0, 0, 0, 359, 360, 5, 41, 0, 0, 360, 361,
|
|
295
|
+
6, 52, 1, 0, 361, 106, 1, 0, 0, 0, 362, 363, 5, 110, 0, 0, 363, 367, 5, 99, 0, 0, 364,
|
|
296
|
+
365, 5, 78, 0, 0, 365, 367, 5, 67, 0, 0, 366, 362, 1, 0, 0, 0, 366, 364, 1, 0, 0, 0, 367,
|
|
297
|
+
108, 1, 0, 0, 0, 368, 369, 5, 116, 0, 0, 369, 370, 5, 114, 0, 0, 370, 371, 5, 117, 0,
|
|
298
|
+
0, 371, 378, 5, 101, 0, 0, 372, 373, 5, 102, 0, 0, 373, 374, 5, 97, 0, 0, 374, 375, 5,
|
|
299
|
+
108, 0, 0, 375, 376, 5, 115, 0, 0, 376, 378, 5, 101, 0, 0, 377, 368, 1, 0, 0, 0, 377,
|
|
300
|
+
372, 1, 0, 0, 0, 378, 110, 1, 0, 0, 0, 379, 383, 7, 0, 0, 0, 380, 382, 7, 1, 0, 0, 381,
|
|
301
|
+
380, 1, 0, 0, 0, 382, 385, 1, 0, 0, 0, 383, 381, 1, 0, 0, 0, 383, 384, 1, 0, 0, 0, 384,
|
|
302
|
+
112, 1, 0, 0, 0, 385, 383, 1, 0, 0, 0, 386, 395, 5, 48, 0, 0, 387, 391, 7, 2, 0, 0, 388,
|
|
303
|
+
390, 7, 3, 0, 0, 389, 388, 1, 0, 0, 0, 390, 393, 1, 0, 0, 0, 391, 389, 1, 0, 0, 0, 391,
|
|
304
|
+
392, 1, 0, 0, 0, 392, 395, 1, 0, 0, 0, 393, 391, 1, 0, 0, 0, 394, 386, 1, 0, 0, 0, 394,
|
|
305
|
+
387, 1, 0, 0, 0, 395, 114, 1, 0, 0, 0, 396, 398, 7, 2, 0, 0, 397, 396, 1, 0, 0, 0, 398,
|
|
306
|
+
399, 1, 0, 0, 0, 399, 397, 1, 0, 0, 0, 399, 400, 1, 0, 0, 0, 400, 404, 1, 0, 0, 0, 401,
|
|
307
|
+
403, 7, 4, 0, 0, 402, 401, 1, 0, 0, 0, 403, 406, 1, 0, 0, 0, 404, 402, 1, 0, 0, 0, 404,
|
|
308
|
+
405, 1, 0, 0, 0, 405, 409, 1, 0, 0, 0, 406, 404, 1, 0, 0, 0, 407, 409, 7, 5, 0, 0, 408,
|
|
309
|
+
397, 1, 0, 0, 0, 408, 407, 1, 0, 0, 0, 409, 116, 1, 0, 0, 0, 410, 411, 3, 113, 56, 0, 411,
|
|
310
|
+
412, 5, 46, 0, 0, 412, 416, 7, 4, 0, 0, 413, 415, 7, 3, 0, 0, 414, 413, 1, 0, 0, 0, 415,
|
|
311
|
+
418, 1, 0, 0, 0, 416, 414, 1, 0, 0, 0, 416, 417, 1, 0, 0, 0, 417, 118, 1, 0, 0, 0, 418,
|
|
312
|
+
416, 1, 0, 0, 0, 419, 422, 3, 115, 57, 0, 420, 422, 3, 117, 58, 0, 421, 419, 1, 0, 0,
|
|
313
|
+
0, 421, 420, 1, 0, 0, 0, 422, 424, 1, 0, 0, 0, 423, 425, 7, 6, 0, 0, 424, 423, 1, 0, 0,
|
|
314
|
+
0, 424, 425, 1, 0, 0, 0, 425, 120, 1, 0, 0, 0, 426, 430, 5, 34, 0, 0, 427, 429, 9, 0, 0,
|
|
315
|
+
0, 428, 427, 1, 0, 0, 0, 429, 432, 1, 0, 0, 0, 430, 431, 1, 0, 0, 0, 430, 428, 1, 0, 0,
|
|
316
|
+
0, 431, 433, 1, 0, 0, 0, 432, 430, 1, 0, 0, 0, 433, 434, 5, 34, 0, 0, 434, 122, 1, 0, 0,
|
|
317
|
+
0, 435, 437, 7, 2, 0, 0, 436, 435, 1, 0, 0, 0, 437, 438, 1, 0, 0, 0, 438, 436, 1, 0, 0,
|
|
318
|
+
0, 438, 439, 1, 0, 0, 0, 439, 443, 1, 0, 0, 0, 440, 442, 7, 4, 0, 0, 441, 440, 1, 0, 0,
|
|
319
|
+
0, 442, 445, 1, 0, 0, 0, 443, 441, 1, 0, 0, 0, 443, 444, 1, 0, 0, 0, 444, 446, 1, 0, 0,
|
|
320
|
+
0, 445, 443, 1, 0, 0, 0, 446, 447, 5, 37, 0, 0, 447, 124, 1, 0, 0, 0, 448, 450, 7, 7, 0,
|
|
321
|
+
0, 449, 448, 1, 0, 0, 0, 450, 451, 1, 0, 0, 0, 451, 449, 1, 0, 0, 0, 451, 452, 1, 0, 0,
|
|
322
|
+
0, 452, 126, 1, 0, 0, 0, 453, 455, 7, 8, 0, 0, 454, 453, 1, 0, 0, 0, 455, 456, 1, 0, 0,
|
|
323
|
+
0, 456, 454, 1, 0, 0, 0, 456, 457, 1, 0, 0, 0, 457, 458, 1, 0, 0, 0, 458, 459, 6, 63, 2,
|
|
324
|
+
0, 459, 128, 1, 0, 0, 0, 460, 462, 5, 13, 0, 0, 461, 460, 1, 0, 0, 0, 461, 462, 1, 0, 0,
|
|
325
|
+
0, 462, 463, 1, 0, 0, 0, 463, 466, 5, 10, 0, 0, 464, 466, 2, 12, 13, 0, 465, 461, 1, 0,
|
|
326
|
+
0, 0, 465, 464, 1, 0, 0, 0, 466, 468, 1, 0, 0, 0, 467, 469, 3, 131, 65, 0, 468, 467, 1,
|
|
327
|
+
0, 0, 0, 468, 469, 1, 0, 0, 0, 469, 470, 1, 0, 0, 0, 470, 471, 6, 64, 3, 0, 471, 130, 1,
|
|
328
|
+
0, 0, 0, 472, 474, 7, 8, 0, 0, 473, 472, 1, 0, 0, 0, 474, 475, 1, 0, 0, 0, 475, 473, 1,
|
|
329
|
+
0, 0, 0, 475, 476, 1, 0, 0, 0, 476, 132, 1, 0, 0, 0, 477, 481, 5, 35, 0, 0, 478, 480, 8,
|
|
330
|
+
9, 0, 0, 479, 478, 1, 0, 0, 0, 480, 483, 1, 0, 0, 0, 481, 479, 1, 0, 0, 0, 481, 482, 1,
|
|
331
|
+
0, 0, 0, 482, 134, 1, 0, 0, 0, 483, 481, 1, 0, 0, 0, 484, 487, 3, 127, 63, 0, 485, 487,
|
|
332
|
+
3, 133, 66, 0, 486, 484, 1, 0, 0, 0, 486, 485, 1, 0, 0, 0, 487, 488, 1, 0, 0, 0, 488, 489,
|
|
333
|
+
6, 67, 4, 0, 489, 136, 1, 0, 0, 0, 26, 0, 288, 323, 329, 366, 377, 383, 391, 394, 399,
|
|
334
|
+
404, 408, 416, 421, 424, 430, 438, 443, 451, 456, 461, 465, 468, 475, 481, 486,
|
|
335
|
+
5, 1, 51, 0, 1, 52, 1, 6, 0, 0, 1, 64, 2, 0, 2, 0
|
|
331
336
|
];
|
|
332
337
|
static __ATN;
|
|
333
338
|
static get _ATN() {
|
|
@@ -136,8 +136,8 @@ export class CircuitScriptParser extends antlr.Parser {
|
|
|
136
136
|
"'branch'", "'create'", "'component'", "'graphic'", "'module'",
|
|
137
137
|
"'wire'", "'pin'", "'add'", "'at'", "'to'", "'point'", "'join'",
|
|
138
138
|
"'parallel'", "'return'", "'def'", "'import'", "'for'", "'in'",
|
|
139
|
-
"'while'", "'continue'", "'if'", "'else'",
|
|
140
|
-
"'=='", "'!='", "'>'", "'>='", "'<'", "'<='",
|
|
139
|
+
"'while'", "'continue'", "'if'", "'else'", null, "'frame'", "'sheet'",
|
|
140
|
+
"'=='", "'!='", "'>'", "'>='", "'<'", "'<='", null, null, "'+'",
|
|
141
141
|
"'-'", "'/'", "'*'", "'%'", "'+='", "'-='", "'/='", "'*='", "'%='",
|
|
142
142
|
"'('", "')'"
|
|
143
143
|
];
|
package/dist/esm/export.mjs
CHANGED
|
@@ -50,6 +50,7 @@ export function generateKiCADNetList(netlist) {
|
|
|
50
50
|
if (instance.typeProp !== ComponentTypes.label &&
|
|
51
51
|
instance.typeProp !== ComponentTypes.net &&
|
|
52
52
|
instance.typeProp !== ComponentTypes.point &&
|
|
53
|
+
instance.typeProp !== ComponentTypes.frame &&
|
|
53
54
|
instance.typeProp !== null) {
|
|
54
55
|
console.log('Skipping', instance.instanceName);
|
|
55
56
|
}
|
package/dist/esm/globals.mjs
CHANGED
|
@@ -75,6 +75,7 @@ export var ComponentTypes;
|
|
|
75
75
|
ComponentTypes["net"] = "net";
|
|
76
76
|
ComponentTypes["label"] = "label";
|
|
77
77
|
ComponentTypes["point"] = "point";
|
|
78
|
+
ComponentTypes["frame"] = "frame";
|
|
78
79
|
})(ComponentTypes || (ComponentTypes = {}));
|
|
79
80
|
export var ReferenceTypes;
|
|
80
81
|
(function (ReferenceTypes) {
|
package/dist/esm/helpers.mjs
CHANGED
|
@@ -150,7 +150,7 @@ export function validateScript(scriptData, options) {
|
|
|
150
150
|
return visitorResolver;
|
|
151
151
|
}
|
|
152
152
|
export function renderScript(scriptData, outputPath, options) {
|
|
153
|
-
const { currentDirectory = null, defaultLibsPath, dumpNets = false, dumpData = false,
|
|
153
|
+
const { currentDirectory = null, defaultLibsPath, dumpNets = false, dumpData = false, showStats = false } = options;
|
|
154
154
|
const onErrorHandler = (line, column, message, error) => {
|
|
155
155
|
if (error instanceof VisitorExecutionException) {
|
|
156
156
|
console.log('Error', line, column, message, error.errorMessage);
|
|
@@ -183,14 +183,6 @@ export function renderScript(scriptData, outputPath, options) {
|
|
|
183
183
|
catch (err) {
|
|
184
184
|
console.log('Error during annotation: ', err);
|
|
185
185
|
}
|
|
186
|
-
if (kicadNetlistPath) {
|
|
187
|
-
const { tree: kicadNetList, missingFootprints } = generateKiCADNetList(visitor.getNetList());
|
|
188
|
-
missingFootprints.forEach(entry => {
|
|
189
|
-
console.log(`${entry.refdes} (${entry.instanceName}) does not have footprint`);
|
|
190
|
-
});
|
|
191
|
-
writeFileSync(kicadNetlistPath, printTree(kicadNetList));
|
|
192
|
-
console.log('Generated KiCad netlist file');
|
|
193
|
-
}
|
|
194
186
|
const { sequence, nets } = visitor.getGraph();
|
|
195
187
|
const tmpSequence = sequence.map(item => {
|
|
196
188
|
const tmp = [...item];
|
|
@@ -219,6 +211,15 @@ export function renderScript(scriptData, outputPath, options) {
|
|
|
219
211
|
outputDefaultZoom = 1;
|
|
220
212
|
}
|
|
221
213
|
}
|
|
214
|
+
if (fileExtension === 'net') {
|
|
215
|
+
const { tree: kicadNetList, missingFootprints } = generateKiCADNetList(visitor.getNetList());
|
|
216
|
+
missingFootprints.forEach(entry => {
|
|
217
|
+
console.log(`${entry.refdes} (${entry.instanceName}) does not have footprint`);
|
|
218
|
+
});
|
|
219
|
+
writeFileSync(outputPath, printTree(kicadNetList));
|
|
220
|
+
console.log('Generated file', outputPath);
|
|
221
|
+
return null;
|
|
222
|
+
}
|
|
222
223
|
const layoutEngine = new LayoutEngine();
|
|
223
224
|
const layoutTimer = new SimpleStopwatch();
|
|
224
225
|
const sheetFrames = layoutEngine.runLayout(sequence, nets);
|
package/dist/esm/main.mjs
CHANGED
|
@@ -16,7 +16,6 @@ export default async function main() {
|
|
|
16
16
|
.argument('[output path]', 'Output path')
|
|
17
17
|
.option('-i, --input text <input text>', 'Input text directly')
|
|
18
18
|
.option('-c, --current-directory <path>', 'Set current directory')
|
|
19
|
-
.option('-k, --kicad-netlist <filename>', 'Create KiCad netlist')
|
|
20
19
|
.option('-w, --watch', 'Watch for file changes')
|
|
21
20
|
.option('-n, --dump-nets', 'Dump out net information')
|
|
22
21
|
.option('-d, --dump-data', 'Dump data during parsing')
|
|
@@ -33,7 +32,6 @@ export default async function main() {
|
|
|
33
32
|
const watchFileChanges = options.watch;
|
|
34
33
|
const dumpNets = options.dumpNets;
|
|
35
34
|
const dumpData = options.dumpData;
|
|
36
|
-
const kicadNetlist = options.kicadNetlist;
|
|
37
35
|
let currentDirectory = options.currentDirectory ?? null;
|
|
38
36
|
if (watchFileChanges) {
|
|
39
37
|
console.log('watching for file changes...');
|
|
@@ -70,7 +68,6 @@ export default async function main() {
|
|
|
70
68
|
defaultLibsPath,
|
|
71
69
|
dumpNets,
|
|
72
70
|
dumpData,
|
|
73
|
-
kicadNetlistPath: kicadNetlist,
|
|
74
71
|
showStats: options.stats,
|
|
75
72
|
};
|
|
76
73
|
let outputPath = null;
|
package/dist/esm/visitor.mjs
CHANGED
|
@@ -525,6 +525,9 @@ export class ParserVisitor extends BaseVisitor {
|
|
|
525
525
|
if (typeof value === "boolean") {
|
|
526
526
|
value = !value;
|
|
527
527
|
}
|
|
528
|
+
else if (typeof value === "number") {
|
|
529
|
+
value = (value === 0) ? false : true;
|
|
530
|
+
}
|
|
528
531
|
else {
|
|
529
532
|
throw "Failed to do Not operator";
|
|
530
533
|
}
|
|
@@ -1217,6 +1220,9 @@ class ComponentAnnotater {
|
|
|
1217
1220
|
this.counter[type] = 1;
|
|
1218
1221
|
}
|
|
1219
1222
|
}
|
|
1223
|
+
if (ComponentRefDesPrefixes[type] === undefined) {
|
|
1224
|
+
return null;
|
|
1225
|
+
}
|
|
1220
1226
|
let attempts = 100;
|
|
1221
1227
|
let proposedName;
|
|
1222
1228
|
while (attempts >= 0) {
|
package/dist/types/globals.d.ts
CHANGED
package/dist/types/helpers.d.ts
CHANGED