circuitscript 0.1.23 → 0.1.25

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.
Files changed (57) hide show
  1. package/dist/cjs/BaseVisitor.js +35 -23
  2. package/dist/cjs/BomGeneration.js +167 -0
  3. package/dist/cjs/ComponentMatchConditions.js +116 -0
  4. package/dist/cjs/antlr/CircuitScriptLexer.js +247 -244
  5. package/dist/cjs/antlr/CircuitScriptParser.js +1476 -825
  6. package/dist/cjs/builtinMethods.js +6 -1
  7. package/dist/cjs/execute.js +27 -16
  8. package/dist/cjs/graph.js +10 -9
  9. package/dist/cjs/helpers.js +43 -18
  10. package/dist/cjs/layout.js +14 -13
  11. package/dist/cjs/main.js +17 -1
  12. package/dist/cjs/objects/ExecutionScope.js +3 -0
  13. package/dist/cjs/objects/PinDefinition.js +11 -1
  14. package/dist/cjs/objects/types.js +6 -4
  15. package/dist/cjs/rules-check/no-connect-on-connected-pin.js +81 -0
  16. package/dist/cjs/rules-check/rules.js +74 -0
  17. package/dist/cjs/rules-check/unconnected-pins.js +52 -0
  18. package/dist/cjs/visitor.js +121 -5
  19. package/dist/esm/BaseVisitor.js +35 -23
  20. package/dist/esm/BomGeneration.js +137 -0
  21. package/dist/esm/ComponentMatchConditions.js +109 -0
  22. package/dist/esm/antlr/CircuitScriptLexer.js +247 -244
  23. package/dist/esm/antlr/CircuitScriptParser.js +1471 -824
  24. package/dist/esm/antlr/CircuitScriptVisitor.js +7 -0
  25. package/dist/esm/builtinMethods.js +6 -1
  26. package/dist/esm/execute.js +27 -16
  27. package/dist/esm/graph.js +11 -10
  28. package/dist/esm/helpers.js +43 -18
  29. package/dist/esm/layout.js +15 -13
  30. package/dist/esm/main.js +17 -1
  31. package/dist/esm/objects/ExecutionScope.js +3 -0
  32. package/dist/esm/objects/PinDefinition.js +11 -1
  33. package/dist/esm/objects/types.js +7 -5
  34. package/dist/esm/rules-check/no-connect-on-connected-pin.js +77 -0
  35. package/dist/esm/rules-check/rules.js +70 -0
  36. package/dist/esm/rules-check/unconnected-pins.js +48 -0
  37. package/dist/esm/visitor.js +121 -5
  38. package/dist/libs/std.cst +7 -3
  39. package/dist/types/BomGeneration.d.ts +13 -0
  40. package/dist/types/ComponentMatchConditions.d.ts +19 -0
  41. package/dist/types/antlr/CircuitScriptLexer.d.ts +60 -59
  42. package/dist/types/antlr/CircuitScriptParser.d.ts +146 -62
  43. package/dist/types/antlr/CircuitScriptVisitor.d.ts +14 -0
  44. package/dist/types/execute.d.ts +2 -1
  45. package/dist/types/graph.d.ts +6 -1
  46. package/dist/types/helpers.d.ts +7 -2
  47. package/dist/types/layout.d.ts +3 -2
  48. package/dist/types/objects/ExecutionScope.d.ts +8 -2
  49. package/dist/types/objects/ParamDefinition.d.ts +1 -1
  50. package/dist/types/objects/PinDefinition.d.ts +1 -0
  51. package/dist/types/objects/types.d.ts +4 -2
  52. package/dist/types/rules-check/no-connect-on-connected-pin.d.ts +3 -0
  53. package/dist/types/rules-check/rules.d.ts +15 -0
  54. package/dist/types/rules-check/unconnected-pins.d.ts +2 -0
  55. package/dist/types/visitor.d.ts +10 -1
  56. package/libs/std.cst +7 -3
  57. package/package.json +2 -1
@@ -0,0 +1,48 @@
1
+ import { RenderItemType } from "../graph.js";
2
+ import { ERC_Rules } from "./rules.js";
3
+ export function RuleCheck_UnconnectedPinsWires(graph) {
4
+ const items = [];
5
+ const allNodes = graph.nodes();
6
+ allNodes.forEach(node => {
7
+ const nodeInfo = graph.node(node);
8
+ if (nodeInfo[0] === RenderItemType.Component) {
9
+ const { component } = nodeInfo[1];
10
+ const edges = graph.nodeEdges(node);
11
+ const instanceName = component.instanceName;
12
+ const connectedPins = [];
13
+ edges.forEach(edge => {
14
+ const edgeInfo = graph.edge(edge.v, edge.w);
15
+ let pin;
16
+ if (edge.v === instanceName) {
17
+ pin = edgeInfo[1];
18
+ }
19
+ else if (edge.w === instanceName) {
20
+ pin = edgeInfo[3];
21
+ }
22
+ connectedPins.push(pin.getHashValue());
23
+ });
24
+ const pinIds = Array.from(component.pins.keys());
25
+ pinIds.forEach(pinId => {
26
+ const hashValue = pinId.getHashValue();
27
+ if (connectedPins.indexOf(hashValue) === -1) {
28
+ items.push({
29
+ type: ERC_Rules.UnconnectedPin,
30
+ instance: component,
31
+ pin: pinId,
32
+ });
33
+ }
34
+ });
35
+ }
36
+ else if (nodeInfo[0] === RenderItemType.Wire) {
37
+ const renderWire = nodeInfo[1];
38
+ const edges = graph.nodeEdges(node);
39
+ if (edges.length < 2) {
40
+ items.push({
41
+ type: ERC_Rules.UnconnectedWire,
42
+ wire: renderWire.wire,
43
+ });
44
+ }
45
+ }
46
+ });
47
+ return items;
48
+ }
@@ -11,8 +11,10 @@ import { getPortType, RuntimeExecutionError } from './utils.js';
11
11
  import { UnitDimension } from './helpers.js';
12
12
  import { FrameParamKeys } from './objects/Frame.js';
13
13
  import { ComponentAnnotater } from './ComponentAnnotater.js';
14
+ import { applyPartConditions, extractPartConditions, flattenConditionNodes } from './ComponentMatchConditions.js';
14
15
  export class ParserVisitor extends BaseVisitor {
15
16
  componentCreationIndex = 0;
17
+ creationCtx = new Map();
16
18
  visitKeyword_assignment_expr = (ctx) => {
17
19
  const id = ctx.ID().getText();
18
20
  const value = this.visitResult(ctx.data_expr());
@@ -537,7 +539,7 @@ export class ParserVisitor extends BaseVisitor {
537
539
  scope.triggerPropertyHandler(this, value, ctxValue);
538
540
  this.getScope().exitContext();
539
541
  this.getScope().exitContext();
540
- if (value instanceof UndeclaredReference && (value.reference.parentValue === undefined
542
+ if (value instanceof UndeclaredReference && (value.reference.rootValue === undefined
541
543
  && value.reference.value === undefined)) {
542
544
  throw value.throwMessage();
543
545
  }
@@ -606,11 +608,11 @@ export class ParserVisitor extends BaseVisitor {
606
608
  componentCtx = ctxAssignmentExpr;
607
609
  }
608
610
  if (dataResult instanceof AnyReference) {
609
- const { trailers = [], parentValue = null } = dataResult;
610
- if (parentValue instanceof ClassComponent
611
+ const { trailers = [], rootValue = null } = dataResult;
612
+ if (rootValue instanceof ClassComponent
611
613
  && trailers.length > 0
612
614
  && trailers[0] === ModuleContainsKeyword) {
613
- dataResult = parentValue;
615
+ dataResult = rootValue;
614
616
  this.placeModuleContains(dataResult);
615
617
  }
616
618
  }
@@ -1056,7 +1058,8 @@ export class ParserVisitor extends BaseVisitor {
1056
1058
  const segments = wireAtomExpr.map(wireSegment => {
1057
1059
  return this.visitResult(wireSegment);
1058
1060
  });
1059
- this.getExecutor().addWire(segments);
1061
+ const newWire = this.getExecutor().addWire(segments);
1062
+ this.creationCtx.set(newWire, ctx);
1060
1063
  };
1061
1064
  visitPoint_expr = (ctx) => {
1062
1065
  const ID = ctx.ID();
@@ -1244,6 +1247,119 @@ export class ParserVisitor extends BaseVisitor {
1244
1247
  }
1245
1248
  }
1246
1249
  };
1250
+ visitPart_set_expr = (ctx) => {
1251
+ const paramKeys = ctx.data_expr().map(ctx => {
1252
+ return this.visitResult(ctx);
1253
+ });
1254
+ const partConditionTree = this.visitResult(ctx.part_match_block());
1255
+ const flattenedTree = flattenConditionNodes(partConditionTree);
1256
+ const partConditions = extractPartConditions(flattenedTree);
1257
+ const instances = this.getScope().getInstances();
1258
+ applyPartConditions(instances, paramKeys, partConditions);
1259
+ };
1260
+ visitPart_match_block = (ctx) => {
1261
+ const results = ctx.part_sub_expr().map(ctxExpr => {
1262
+ return this.visitResult(ctxExpr);
1263
+ });
1264
+ this.setResult(ctx, results);
1265
+ };
1266
+ visitPart_sub_expr = (ctx) => {
1267
+ const ctxForm1 = ctx.part_condition_expr();
1268
+ const ctxForm2 = ctx.part_condition_key_only_expr();
1269
+ const ctxForm3 = ctx.part_value_expr();
1270
+ let result;
1271
+ if (ctxForm1) {
1272
+ result = this.visitResult(ctxForm1);
1273
+ }
1274
+ else if (ctxForm2) {
1275
+ result = this.visitResult(ctxForm2);
1276
+ }
1277
+ else if (ctxForm3) {
1278
+ result = this.visitResult(ctxForm3);
1279
+ }
1280
+ this.setResult(ctx, result);
1281
+ };
1282
+ visitPart_set_key = (ctx) => {
1283
+ const ctxID = ctx.ID();
1284
+ const ctxIntegerValue = ctx.INTEGER_VALUE();
1285
+ const ctxNumericValue = ctx.NUMERIC_VALUE();
1286
+ const ctxStringValue = ctx.STRING_VALUE();
1287
+ let useType = '';
1288
+ let useValue;
1289
+ if (ctxID) {
1290
+ useType = 'ID';
1291
+ useValue = ctxID.getText();
1292
+ }
1293
+ else if (ctxIntegerValue) {
1294
+ useType = 'number',
1295
+ useValue = Number(ctxIntegerValue.getText());
1296
+ }
1297
+ else if (ctxNumericValue) {
1298
+ useType = 'NUMERIC_VALUE';
1299
+ useValue = numeric(ctxNumericValue.getText());
1300
+ }
1301
+ else if (ctxStringValue) {
1302
+ useType = 'STRING_VALUE';
1303
+ useValue = this.prepareStringValue(ctxStringValue.getText());
1304
+ }
1305
+ this.setResult(ctx, {
1306
+ type: useType,
1307
+ value: useValue
1308
+ });
1309
+ };
1310
+ visitPart_value_expr = (ctx) => {
1311
+ const key = this.visitResult(ctx.part_set_key());
1312
+ const values = ctx.data_expr().map(ctxData => {
1313
+ return this.visitResult(ctxData);
1314
+ });
1315
+ this.setResult(ctx, { key, endValue: values });
1316
+ };
1317
+ visitPart_condition_expr = (ctx) => {
1318
+ const allKeys = ctx._key_id.map(ctx => {
1319
+ return this.visitResult(ctx);
1320
+ });
1321
+ const allValues = ctx._values.map(ctx => {
1322
+ return this.visitResult(ctx);
1323
+ });
1324
+ let deepestChildren = [];
1325
+ const ctxPartMatchBlock = ctx.part_match_block();
1326
+ if (ctxPartMatchBlock) {
1327
+ deepestChildren = this.visitResult(ctxPartMatchBlock);
1328
+ }
1329
+ let lastValue = undefined;
1330
+ if (ctx._last_data.length > 0) {
1331
+ lastValue = ctx._last_data.map(ctxData => {
1332
+ return this.visitResult(ctxData);
1333
+ });
1334
+ }
1335
+ if (ctx._id_only) {
1336
+ allKeys.push(this.visitResult(ctx._id_only));
1337
+ allValues.push(undefined);
1338
+ }
1339
+ const reversedKeys = [...allKeys].reverse();
1340
+ const reversedValues = [...allValues].reverse();
1341
+ let tmpKeyValues;
1342
+ reversedKeys.forEach((key, index) => {
1343
+ const node = {
1344
+ key,
1345
+ values: (reversedValues[index] !== undefined) ? [reversedValues[index]] : undefined,
1346
+ children: (index === 0) ? deepestChildren : [tmpKeyValues],
1347
+ };
1348
+ if (index === 0 && lastValue !== undefined) {
1349
+ node.endValue = lastValue;
1350
+ }
1351
+ tmpKeyValues = node;
1352
+ });
1353
+ this.setResult(ctx, tmpKeyValues);
1354
+ };
1355
+ visitPart_condition_key_only_expr = (ctx) => {
1356
+ const key = this.visitResult(ctx.part_set_key());
1357
+ const children = this.visitResult(ctx.part_match_block());
1358
+ this.setResult(ctx, {
1359
+ key,
1360
+ children,
1361
+ });
1362
+ };
1247
1363
  resolveDataExpr(data_expr) {
1248
1364
  const value = this.visitResult(data_expr);
1249
1365
  if (value instanceof UndeclaredReference) {
package/dist/libs/std.cst CHANGED
@@ -65,6 +65,7 @@ def res(value):
65
65
  value: value
66
66
  size: "0402"
67
67
  footprint: "Resistor_SMD:R_0402_1005Metric"
68
+ description: "RES {value} OHM {size}"
68
69
 
69
70
  def cap(value):
70
71
  width = 120
@@ -146,9 +147,9 @@ def led(color):
146
147
  params:
147
148
  size: "0603"
148
149
  color: color
150
+ value: color
149
151
  footprint: "LED_SMD:LED_0603_1608Metric_Pad1.05x0.95mm_HandSolder"
150
-
151
-
152
+ description: "LED {color} {size}"
152
153
 
153
154
  def cgnd():
154
155
  net_name = "gnd"
@@ -224,6 +225,8 @@ def no_connect(size=20):
224
225
  path: "M", -size, -size, "L", size, size
225
226
  path: "M", -size, size, "L", size, -size
226
227
  pin: 1, 0, 0, 0, 0, display_pin_id=false
228
+ params:
229
+ no_connect: true
227
230
 
228
231
  def dnc(size=20):
229
232
  return no_connect(size)
@@ -424,4 +427,5 @@ def sheet_A6(revision="V1"):
424
427
 
425
428
  return tmp_sheet
426
429
 
427
- document.sheet_type = sheet_A4()
430
+ document.sheet_type = sheet_A4()
431
+ document.bom.columns = ["refdes", "mpn", "manufacturer", "footprint"]
@@ -0,0 +1,13 @@
1
+ import { ClassComponent } from "./objects/ClassComponent.js";
2
+ export type BomConfig = {
3
+ columns: string[];
4
+ };
5
+ export declare function generateBom(bomConfig: BomConfig, instances: ClassComponent[]): Record<string, unknown>[];
6
+ type GroupEntry = {
7
+ allRefdes: string[];
8
+ items: Record<string, unknown>[];
9
+ };
10
+ export declare function groupComponents(bomConfig: BomConfig, bomComponents: Record<string, unknown>[]): Map<string, GroupEntry>;
11
+ export declare function generateBomCSV(bomData: Record<string, GroupEntry>[]): string[][];
12
+ export declare function saveBomOutputCsv(bomCsvOutput: string[][], filePath: string): Promise<void>;
13
+ export {};
@@ -0,0 +1,19 @@
1
+ import { ClassComponent } from "./objects/ClassComponent.js";
2
+ import { NumericValue } from "./objects/ParamDefinition.js";
3
+ export type ConditionNode = {
4
+ key: {
5
+ type: string;
6
+ value: string | NumericValue;
7
+ };
8
+ values: any[];
9
+ children: ConditionNode[];
10
+ endValue: any[];
11
+ };
12
+ export declare function flattenConditionNodes(conditionNodes: ConditionNode[], level?: number): ConditionNode[][];
13
+ export type PartConditions = {
14
+ endValue: string[];
15
+ conditions: ConditionNode[];
16
+ };
17
+ export declare function extractPartConditions(conditionBranches: ConditionNode[][]): PartConditions[];
18
+ export declare function partMatchesConditions(instance: ClassComponent, partConditions: PartConditions[]): any | undefined;
19
+ export declare function applyPartConditions(instances: ClassComponent[], paramKeys: string[], partConditions: PartConditions[]): void;
@@ -7,65 +7,66 @@ export declare class CircuitScriptLexer extends antlr.Lexer {
7
7
  static readonly T__4 = 5;
8
8
  static readonly T__5 = 6;
9
9
  static readonly T__6 = 7;
10
- static readonly Break = 8;
11
- static readonly Branch = 9;
12
- static readonly Create = 10;
13
- static readonly Component = 11;
14
- static readonly Graphic = 12;
15
- static readonly Module = 13;
16
- static readonly Wire = 14;
17
- static readonly Pin = 15;
18
- static readonly Add = 16;
19
- static readonly At = 17;
20
- static readonly To = 18;
21
- static readonly Point = 19;
22
- static readonly Join = 20;
23
- static readonly Parallel = 21;
24
- static readonly Return = 22;
25
- static readonly Define = 23;
26
- static readonly Import = 24;
27
- static readonly For = 25;
28
- static readonly In = 26;
29
- static readonly While = 27;
30
- static readonly Continue = 28;
31
- static readonly If = 29;
32
- static readonly Else = 30;
33
- static readonly Not = 31;
34
- static readonly Frame = 32;
35
- static readonly Sheet = 33;
36
- static readonly Equals = 34;
37
- static readonly NotEquals = 35;
38
- static readonly GreaterThan = 36;
39
- static readonly GreatOrEqualThan = 37;
40
- static readonly LessThan = 38;
41
- static readonly LessOrEqualThan = 39;
42
- static readonly LogicalAnd = 40;
43
- static readonly LogicalOr = 41;
44
- static readonly Addition = 42;
45
- static readonly Minus = 43;
46
- static readonly Divide = 44;
47
- static readonly Multiply = 45;
48
- static readonly Modulus = 46;
49
- static readonly AdditionAssign = 47;
50
- static readonly MinusAssign = 48;
51
- static readonly DivideAssign = 49;
52
- static readonly MultiplyAssign = 50;
53
- static readonly ModulusAssign = 51;
54
- static readonly ANNOTATION_START = 52;
55
- static readonly OPEN_PAREN = 53;
56
- static readonly CLOSE_PAREN = 54;
57
- static readonly NOT_CONNECTED = 55;
58
- static readonly BOOLEAN_VALUE = 56;
59
- static readonly ID = 57;
60
- static readonly INTEGER_VALUE = 58;
61
- static readonly DECIMAL_VALUE = 59;
62
- static readonly NUMERIC_VALUE = 60;
63
- static readonly STRING_VALUE = 61;
64
- static readonly PERCENTAGE_VALUE = 62;
65
- static readonly ALPHA_NUMERIC = 63;
66
- static readonly WS = 64;
67
- static readonly NEWLINE = 65;
68
- static readonly COMMENT = 66;
10
+ static readonly T__7 = 8;
11
+ static readonly Break = 9;
12
+ static readonly Branch = 10;
13
+ static readonly Create = 11;
14
+ static readonly Component = 12;
15
+ static readonly Graphic = 13;
16
+ static readonly Module = 14;
17
+ static readonly Wire = 15;
18
+ static readonly Pin = 16;
19
+ static readonly Add = 17;
20
+ static readonly At = 18;
21
+ static readonly To = 19;
22
+ static readonly Point = 20;
23
+ static readonly Join = 21;
24
+ static readonly Parallel = 22;
25
+ static readonly Return = 23;
26
+ static readonly Define = 24;
27
+ static readonly Import = 25;
28
+ static readonly For = 26;
29
+ static readonly In = 27;
30
+ static readonly While = 28;
31
+ static readonly Continue = 29;
32
+ static readonly If = 30;
33
+ static readonly Else = 31;
34
+ static readonly Not = 32;
35
+ static readonly Frame = 33;
36
+ static readonly Sheet = 34;
37
+ static readonly Equals = 35;
38
+ static readonly NotEquals = 36;
39
+ static readonly GreaterThan = 37;
40
+ static readonly GreatOrEqualThan = 38;
41
+ static readonly LessThan = 39;
42
+ static readonly LessOrEqualThan = 40;
43
+ static readonly LogicalAnd = 41;
44
+ static readonly LogicalOr = 42;
45
+ static readonly Addition = 43;
46
+ static readonly Minus = 44;
47
+ static readonly Divide = 45;
48
+ static readonly Multiply = 46;
49
+ static readonly Modulus = 47;
50
+ static readonly AdditionAssign = 48;
51
+ static readonly MinusAssign = 49;
52
+ static readonly DivideAssign = 50;
53
+ static readonly MultiplyAssign = 51;
54
+ static readonly ModulusAssign = 52;
55
+ static readonly ANNOTATION_START = 53;
56
+ static readonly OPEN_PAREN = 54;
57
+ static readonly CLOSE_PAREN = 55;
58
+ static readonly NOT_CONNECTED = 56;
59
+ static readonly BOOLEAN_VALUE = 57;
60
+ static readonly ID = 58;
61
+ static readonly INTEGER_VALUE = 59;
62
+ static readonly DECIMAL_VALUE = 60;
63
+ static readonly NUMERIC_VALUE = 61;
64
+ static readonly STRING_VALUE = 62;
65
+ static readonly PERCENTAGE_VALUE = 63;
66
+ static readonly ALPHA_NUMERIC = 64;
67
+ static readonly WS = 65;
68
+ static readonly NEWLINE = 66;
69
+ static readonly COMMENT = 67;
69
70
  static readonly channelNames: string[];
70
71
  static readonly literalNames: (string | null)[];
71
72
  static readonly symbolicNames: (string | null)[];
@@ -9,67 +9,68 @@ export declare class CircuitScriptParser extends antlr.Parser {
9
9
  static readonly T__4 = 5;
10
10
  static readonly T__5 = 6;
11
11
  static readonly T__6 = 7;
12
- static readonly Break = 8;
13
- static readonly Branch = 9;
14
- static readonly Create = 10;
15
- static readonly Component = 11;
16
- static readonly Graphic = 12;
17
- static readonly Module = 13;
18
- static readonly Wire = 14;
19
- static readonly Pin = 15;
20
- static readonly Add = 16;
21
- static readonly At = 17;
22
- static readonly To = 18;
23
- static readonly Point = 19;
24
- static readonly Join = 20;
25
- static readonly Parallel = 21;
26
- static readonly Return = 22;
27
- static readonly Define = 23;
28
- static readonly Import = 24;
29
- static readonly For = 25;
30
- static readonly In = 26;
31
- static readonly While = 27;
32
- static readonly Continue = 28;
33
- static readonly If = 29;
34
- static readonly Else = 30;
35
- static readonly Not = 31;
36
- static readonly Frame = 32;
37
- static readonly Sheet = 33;
38
- static readonly Equals = 34;
39
- static readonly NotEquals = 35;
40
- static readonly GreaterThan = 36;
41
- static readonly GreatOrEqualThan = 37;
42
- static readonly LessThan = 38;
43
- static readonly LessOrEqualThan = 39;
44
- static readonly LogicalAnd = 40;
45
- static readonly LogicalOr = 41;
46
- static readonly Addition = 42;
47
- static readonly Minus = 43;
48
- static readonly Divide = 44;
49
- static readonly Multiply = 45;
50
- static readonly Modulus = 46;
51
- static readonly AdditionAssign = 47;
52
- static readonly MinusAssign = 48;
53
- static readonly DivideAssign = 49;
54
- static readonly MultiplyAssign = 50;
55
- static readonly ModulusAssign = 51;
56
- static readonly ANNOTATION_START = 52;
57
- static readonly OPEN_PAREN = 53;
58
- static readonly CLOSE_PAREN = 54;
59
- static readonly NOT_CONNECTED = 55;
60
- static readonly BOOLEAN_VALUE = 56;
61
- static readonly ID = 57;
62
- static readonly INTEGER_VALUE = 58;
63
- static readonly DECIMAL_VALUE = 59;
64
- static readonly NUMERIC_VALUE = 60;
65
- static readonly STRING_VALUE = 61;
66
- static readonly PERCENTAGE_VALUE = 62;
67
- static readonly ALPHA_NUMERIC = 63;
68
- static readonly WS = 64;
69
- static readonly NEWLINE = 65;
70
- static readonly COMMENT = 66;
71
- static readonly INDENT = 67;
72
- static readonly DEDENT = 68;
12
+ static readonly T__7 = 8;
13
+ static readonly Break = 9;
14
+ static readonly Branch = 10;
15
+ static readonly Create = 11;
16
+ static readonly Component = 12;
17
+ static readonly Graphic = 13;
18
+ static readonly Module = 14;
19
+ static readonly Wire = 15;
20
+ static readonly Pin = 16;
21
+ static readonly Add = 17;
22
+ static readonly At = 18;
23
+ static readonly To = 19;
24
+ static readonly Point = 20;
25
+ static readonly Join = 21;
26
+ static readonly Parallel = 22;
27
+ static readonly Return = 23;
28
+ static readonly Define = 24;
29
+ static readonly Import = 25;
30
+ static readonly For = 26;
31
+ static readonly In = 27;
32
+ static readonly While = 28;
33
+ static readonly Continue = 29;
34
+ static readonly If = 30;
35
+ static readonly Else = 31;
36
+ static readonly Not = 32;
37
+ static readonly Frame = 33;
38
+ static readonly Sheet = 34;
39
+ static readonly Equals = 35;
40
+ static readonly NotEquals = 36;
41
+ static readonly GreaterThan = 37;
42
+ static readonly GreatOrEqualThan = 38;
43
+ static readonly LessThan = 39;
44
+ static readonly LessOrEqualThan = 40;
45
+ static readonly LogicalAnd = 41;
46
+ static readonly LogicalOr = 42;
47
+ static readonly Addition = 43;
48
+ static readonly Minus = 44;
49
+ static readonly Divide = 45;
50
+ static readonly Multiply = 46;
51
+ static readonly Modulus = 47;
52
+ static readonly AdditionAssign = 48;
53
+ static readonly MinusAssign = 49;
54
+ static readonly DivideAssign = 50;
55
+ static readonly MultiplyAssign = 51;
56
+ static readonly ModulusAssign = 52;
57
+ static readonly ANNOTATION_START = 53;
58
+ static readonly OPEN_PAREN = 54;
59
+ static readonly CLOSE_PAREN = 55;
60
+ static readonly NOT_CONNECTED = 56;
61
+ static readonly BOOLEAN_VALUE = 57;
62
+ static readonly ID = 58;
63
+ static readonly INTEGER_VALUE = 59;
64
+ static readonly DECIMAL_VALUE = 60;
65
+ static readonly NUMERIC_VALUE = 61;
66
+ static readonly STRING_VALUE = 62;
67
+ static readonly PERCENTAGE_VALUE = 63;
68
+ static readonly ALPHA_NUMERIC = 64;
69
+ static readonly WS = 65;
70
+ static readonly NEWLINE = 66;
71
+ static readonly COMMENT = 67;
72
+ static readonly INDENT = 68;
73
+ static readonly DEDENT = 69;
73
74
  static readonly RULE_script = 0;
74
75
  static readonly RULE_expression = 1;
75
76
  static readonly RULE_flow_expressions = 2;
@@ -136,7 +137,14 @@ export declare class CircuitScriptParser extends antlr.Parser {
136
137
  static readonly RULE_else_expr = 63;
137
138
  static readonly RULE_while_expr = 64;
138
139
  static readonly RULE_for_expr = 65;
139
- static readonly RULE_annotation_comment_expr = 66;
140
+ static readonly RULE_part_set_expr = 66;
141
+ static readonly RULE_part_set_key = 67;
142
+ static readonly RULE_part_match_block = 68;
143
+ static readonly RULE_part_sub_expr = 69;
144
+ static readonly RULE_part_condition_expr = 70;
145
+ static readonly RULE_part_condition_key_only_expr = 71;
146
+ static readonly RULE_part_value_expr = 72;
147
+ static readonly RULE_annotation_comment_expr = 73;
140
148
  static readonly literalNames: (string | null)[];
141
149
  static readonly symbolicNames: (string | null)[];
142
150
  static readonly ruleNames: string[];
@@ -214,6 +222,13 @@ export declare class CircuitScriptParser extends antlr.Parser {
214
222
  else_expr(): Else_exprContext;
215
223
  while_expr(): While_exprContext;
216
224
  for_expr(): For_exprContext;
225
+ part_set_expr(): Part_set_exprContext;
226
+ part_set_key(): Part_set_keyContext;
227
+ part_match_block(): Part_match_blockContext;
228
+ part_sub_expr(): Part_sub_exprContext;
229
+ part_condition_expr(): Part_condition_exprContext;
230
+ part_condition_key_only_expr(): Part_condition_key_only_exprContext;
231
+ part_value_expr(): Part_value_exprContext;
217
232
  annotation_comment_expr(): Annotation_comment_exprContext;
218
233
  sempred(localContext: antlr.ParserRuleContext | null, ruleIndex: number, predIndex: number): boolean;
219
234
  private data_expr_sempred;
@@ -251,6 +266,7 @@ export declare class ExpressionContext extends antlr.ParserRuleContext {
251
266
  frame_expr(): Frame_exprContext | null;
252
267
  flow_expressions(): Flow_expressionsContext | null;
253
268
  annotation_comment_expr(): Annotation_comment_exprContext | null;
269
+ part_set_expr(): Part_set_exprContext | null;
254
270
  get ruleIndex(): number;
255
271
  accept<Result>(visitor: CircuitScriptVisitor<Result>): Result | null;
256
272
  }
@@ -928,6 +944,74 @@ export declare class For_exprContext extends antlr.ParserRuleContext {
928
944
  get ruleIndex(): number;
929
945
  accept<Result>(visitor: CircuitScriptVisitor<Result>): Result | null;
930
946
  }
947
+ export declare class Part_set_exprContext extends antlr.ParserRuleContext {
948
+ constructor(parent: antlr.ParserRuleContext | null, invokingState: number);
949
+ data_expr(): Data_exprContext[];
950
+ data_expr(i: number): Data_exprContext | null;
951
+ part_match_block(): Part_match_blockContext;
952
+ get ruleIndex(): number;
953
+ accept<Result>(visitor: CircuitScriptVisitor<Result>): Result | null;
954
+ }
955
+ export declare class Part_set_keyContext extends antlr.ParserRuleContext {
956
+ constructor(parent: antlr.ParserRuleContext | null, invokingState: number);
957
+ ID(): antlr.TerminalNode | null;
958
+ INTEGER_VALUE(): antlr.TerminalNode | null;
959
+ NUMERIC_VALUE(): antlr.TerminalNode | null;
960
+ STRING_VALUE(): antlr.TerminalNode | null;
961
+ PERCENTAGE_VALUE(): antlr.TerminalNode | null;
962
+ get ruleIndex(): number;
963
+ accept<Result>(visitor: CircuitScriptVisitor<Result>): Result | null;
964
+ }
965
+ export declare class Part_match_blockContext extends antlr.ParserRuleContext {
966
+ constructor(parent: antlr.ParserRuleContext | null, invokingState: number);
967
+ NEWLINE(): antlr.TerminalNode[];
968
+ NEWLINE(i: number): antlr.TerminalNode | null;
969
+ INDENT(): antlr.TerminalNode;
970
+ DEDENT(): antlr.TerminalNode;
971
+ part_sub_expr(): Part_sub_exprContext[];
972
+ part_sub_expr(i: number): Part_sub_exprContext | null;
973
+ get ruleIndex(): number;
974
+ accept<Result>(visitor: CircuitScriptVisitor<Result>): Result | null;
975
+ }
976
+ export declare class Part_sub_exprContext extends antlr.ParserRuleContext {
977
+ constructor(parent: antlr.ParserRuleContext | null, invokingState: number);
978
+ part_condition_expr(): Part_condition_exprContext | null;
979
+ part_value_expr(): Part_value_exprContext | null;
980
+ part_condition_key_only_expr(): Part_condition_key_only_exprContext | null;
981
+ get ruleIndex(): number;
982
+ accept<Result>(visitor: CircuitScriptVisitor<Result>): Result | null;
983
+ }
984
+ export declare class Part_condition_exprContext extends antlr.ParserRuleContext {
985
+ _part_set_key?: Part_set_keyContext;
986
+ _key_id: Part_set_keyContext[];
987
+ _data_expr?: Data_exprContext;
988
+ _values: Data_exprContext[];
989
+ _id_only?: Part_set_keyContext;
990
+ _last_data: Data_exprContext[];
991
+ constructor(parent: antlr.ParserRuleContext | null, invokingState: number);
992
+ part_set_key(): Part_set_keyContext[];
993
+ part_set_key(i: number): Part_set_keyContext | null;
994
+ data_expr(): Data_exprContext[];
995
+ data_expr(i: number): Data_exprContext | null;
996
+ part_match_block(): Part_match_blockContext | null;
997
+ get ruleIndex(): number;
998
+ accept<Result>(visitor: CircuitScriptVisitor<Result>): Result | null;
999
+ }
1000
+ export declare class Part_condition_key_only_exprContext extends antlr.ParserRuleContext {
1001
+ constructor(parent: antlr.ParserRuleContext | null, invokingState: number);
1002
+ part_set_key(): Part_set_keyContext;
1003
+ part_match_block(): Part_match_blockContext;
1004
+ get ruleIndex(): number;
1005
+ accept<Result>(visitor: CircuitScriptVisitor<Result>): Result | null;
1006
+ }
1007
+ export declare class Part_value_exprContext extends antlr.ParserRuleContext {
1008
+ constructor(parent: antlr.ParserRuleContext | null, invokingState: number);
1009
+ part_set_key(): Part_set_keyContext;
1010
+ data_expr(): Data_exprContext[];
1011
+ data_expr(i: number): Data_exprContext | null;
1012
+ get ruleIndex(): number;
1013
+ accept<Result>(visitor: CircuitScriptVisitor<Result>): Result | null;
1014
+ }
931
1015
  export declare class Annotation_comment_exprContext extends antlr.ParserRuleContext {
932
1016
  constructor(parent: antlr.ParserRuleContext | null, invokingState: number);
933
1017
  ANNOTATION_START(): antlr.TerminalNode;