circuitscript 0.0.22 → 0.0.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.
- package/dist/cjs/BaseVisitor.js +487 -0
- package/dist/cjs/SemanticTokenVisitor.js +218 -0
- package/dist/cjs/SymbolValidatorVisitor.js +233 -0
- package/dist/cjs/antlr/CircuitScriptLexer.js +302 -0
- package/dist/cjs/antlr/CircuitScriptParser.js +5128 -0
- package/dist/cjs/antlr/CircuitScriptVisitor.js +7 -0
- package/dist/cjs/draw_symbols.js +819 -0
- package/dist/cjs/execute.js +778 -0
- package/{src/export.ts → dist/cjs/export.js} +34 -56
- package/dist/cjs/fonts.js +4 -0
- package/dist/cjs/geometry.js +450 -0
- package/dist/cjs/globals.js +60 -0
- package/dist/cjs/helpers.js +269 -0
- package/dist/cjs/index.js +31 -0
- package/{src/layout.ts → dist/cjs/layout.js} +421 -1002
- package/dist/cjs/lexer.js +111 -0
- package/dist/cjs/logger.js +17 -0
- package/dist/cjs/main.js +82 -0
- package/dist/cjs/objects/ClassComponent.js +145 -0
- package/dist/cjs/objects/ExecutionScope.js +135 -0
- package/dist/cjs/objects/Frame.js +22 -0
- package/{src/objects/Net.ts → dist/cjs/objects/Net.js} +9 -24
- package/dist/cjs/objects/ParamDefinition.js +42 -0
- package/dist/cjs/objects/PinDefinition.js +31 -0
- package/dist/cjs/objects/PinTypes.js +11 -0
- package/dist/cjs/objects/Wire.js +9 -0
- package/dist/cjs/objects/types.js +15 -0
- package/dist/cjs/parser.js +70 -0
- package/dist/cjs/regenerate-tests.js +23 -0
- package/dist/cjs/render.js +155 -0
- package/{src/server.ts → dist/cjs/server.js} +15 -21
- package/dist/cjs/sizing.js +105 -0
- package/{src/utils.ts → dist/cjs/utils.js} +25 -35
- package/dist/cjs/validate.js +81 -0
- package/dist/cjs/visitor.js +844 -0
- package/dist/esm/BaseVisitor.mjs +488 -0
- package/dist/esm/SemanticTokenVisitor.mjs +215 -0
- package/dist/esm/SymbolValidatorVisitor.mjs +222 -0
- package/dist/esm/antlr/CircuitScriptLexer.mjs +276 -0
- package/dist/esm/antlr/CircuitScriptParser.mjs +5038 -0
- package/{build/src/antlr/CircuitScriptVisitor.js → dist/esm/antlr/CircuitScriptVisitor.mjs} +8 -3
- package/{build/src/draw_symbols.js → dist/esm/draw_symbols.mjs} +78 -33
- package/{build/src/execute.js → dist/esm/execute.mjs} +59 -60
- package/{build/src/export.js → dist/esm/export.mjs} +2 -2
- package/{build/src/geometry.js → dist/esm/geometry.mjs} +31 -15
- package/dist/esm/helpers.mjs +252 -0
- package/dist/esm/index.mjs +15 -0
- package/{build/src/layout.js → dist/esm/layout.mjs} +19 -11
- package/{build/src/lexer.js → dist/esm/lexer.mjs} +10 -10
- package/{build/src/main.js → dist/esm/main.mjs} +9 -14
- package/{build/src/objects/ClassComponent.js → dist/esm/objects/ClassComponent.mjs} +6 -3
- package/{build/src/objects/ExecutionScope.js → dist/esm/objects/ExecutionScope.mjs} +1 -0
- package/{build/src/objects/PinDefinition.js → dist/esm/objects/PinDefinition.mjs} +1 -1
- package/dist/esm/objects/types.mjs +12 -0
- package/dist/esm/parser.mjs +64 -0
- package/{build/src/regenerate-tests.js → dist/esm/regenerate-tests.mjs} +1 -1
- package/{build/src/render.js → dist/esm/render.mjs} +7 -24
- package/{build/src/sizing.js → dist/esm/sizing.mjs} +22 -8
- package/{src/main.ts → dist/esm/validate.mjs} +31 -62
- package/dist/esm/visitor.mjs +838 -0
- package/dist/types/BaseVisitor.d.ts +69 -0
- package/dist/types/SemanticTokenVisitor.d.ts +36 -0
- package/dist/types/SymbolValidatorVisitor.d.ts +61 -0
- package/{build/src → dist/types}/antlr/CircuitScriptLexer.d.ts +28 -27
- package/dist/types/antlr/CircuitScriptParser.d.ts +719 -0
- package/{build/src → dist/types}/antlr/CircuitScriptVisitor.d.ts +69 -59
- package/{build/src → dist/types}/draw_symbols.d.ts +11 -2
- package/{build/src → dist/types}/execute.d.ts +6 -9
- package/{build/src → dist/types}/geometry.d.ts +5 -1
- package/dist/types/helpers.d.ts +40 -0
- package/dist/types/index.d.ts +15 -0
- package/{build/src → dist/types}/layout.d.ts +10 -10
- package/{build/src → dist/types}/lexer.d.ts +2 -2
- package/{build/src → dist/types}/objects/ClassComponent.d.ts +2 -2
- package/{build/src → dist/types}/objects/ExecutionScope.d.ts +4 -1
- package/{build/src → dist/types}/objects/PinDefinition.d.ts +1 -1
- package/{build/src → dist/types}/objects/types.d.ts +5 -0
- package/dist/types/parser.d.ts +25 -0
- package/{build/src → dist/types}/render.d.ts +1 -1
- package/{build/src → dist/types}/sizing.d.ts +3 -1
- package/dist/types/validate.d.ts +2 -0
- package/dist/types/visitor.d.ts +80 -0
- package/libs/lib.cst +0 -2
- package/package.json +38 -15
- package/.editorconfig +0 -15
- package/.eslintignore +0 -1
- package/.eslintrc.json +0 -27
- package/.gitlab-ci.yml +0 -81
- package/.prettierignore +0 -8
- package/.prettierrc +0 -16
- package/__tests__/expectedResults.ts +0 -657
- package/__tests__/helpers.ts +0 -82
- package/__tests__/parseScripts.ts +0 -593
- package/__tests__/renderData/script1.cst +0 -58
- package/__tests__/renderData/script1.cst.svg +0 -1
- package/__tests__/renderData/script2.cst +0 -16
- package/__tests__/renderData/script2.cst.svg +0 -1
- package/__tests__/renderData/script3.cst +0 -30
- package/__tests__/renderData/script3.cst.svg +0 -1
- package/__tests__/renderData/script4.cst +0 -54
- package/__tests__/renderData/script4.cst.svg +0 -1
- package/__tests__/renderData/script5.cst +0 -23
- package/__tests__/renderData/script5.cst.svg +0 -1
- package/__tests__/renderData/script6.cst +0 -28
- package/__tests__/renderData/script6.cst.svg +0 -1
- package/__tests__/renderData/script7.cst +0 -26
- package/__tests__/renderData/script7.cst.svg +0 -1
- package/__tests__/renderData/script8.cst +0 -37
- package/__tests__/renderData/script8.cst.svg +0 -1
- package/__tests__/testCLI.ts +0 -68
- package/__tests__/testMathOps.ts +0 -36
- package/__tests__/testMergeWires.ts +0 -141
- package/__tests__/testParse.ts +0 -263
- package/__tests__/testRender.ts +0 -38
- package/build/src/antlr/CircuitScriptLexer.js +0 -287
- package/build/src/antlr/CircuitScriptParser.d.ts +0 -674
- package/build/src/antlr/CircuitScriptParser.js +0 -4841
- package/build/src/helpers.d.ts +0 -1
- package/build/src/helpers.js +0 -73
- package/build/src/objects/types.js +0 -6
- package/build/src/parser.js +0 -69
- package/build/src/visitor.d.ts +0 -133
- package/build/src/visitor.js +0 -1154
- package/documentation.md +0 -238
- package/examples/example_arduino_uno.cst +0 -1146
- package/examples/example_garden_pump.cst +0 -567
- package/examples/lib.cst +0 -185
- package/jest.config.js +0 -23
- package/refresh.html +0 -42
- package/server.cjs +0 -50
- package/src/antlr/CircuitScript.g4 +0 -209
- package/src/antlr/CircuitScriptLexer.ts +0 -317
- package/src/antlr/CircuitScriptParser.ts +0 -4979
- package/src/antlr/CircuitScriptVisitor.ts +0 -420
- package/src/draw_symbols.ts +0 -1085
- package/src/execute.ts +0 -1227
- package/src/fonts.ts +0 -1
- package/src/geometry.ts +0 -638
- package/src/globals.ts +0 -67
- package/src/helpers.ts +0 -114
- package/src/lexer.ts +0 -151
- package/src/logger.ts +0 -17
- package/src/objects/ClassComponent.ts +0 -223
- package/src/objects/ExecutionScope.ts +0 -201
- package/src/objects/Frame.ts +0 -20
- package/src/objects/ParamDefinition.ts +0 -49
- package/src/objects/PinDefinition.ts +0 -49
- package/src/objects/PinTypes.ts +0 -7
- package/src/objects/Wire.ts +0 -19
- package/src/objects/types.ts +0 -66
- package/src/parser.ts +0 -106
- package/src/regenerate-tests.ts +0 -25
- package/src/render.ts +0 -260
- package/src/sizing.ts +0 -96
- package/src/visitor.ts +0 -1691
- package/tsconfig.json +0 -27
- package/tsconfig.release.json +0 -8
- /package/{build/src/fonts.js → dist/esm/fonts.mjs} +0 -0
- /package/{build/src/globals.js → dist/esm/globals.mjs} +0 -0
- /package/{build/src/logger.js → dist/esm/logger.mjs} +0 -0
- /package/{build/src/objects/Frame.js → dist/esm/objects/Frame.mjs} +0 -0
- /package/{build/src/objects/Net.js → dist/esm/objects/Net.mjs} +0 -0
- /package/{build/src/objects/ParamDefinition.js → dist/esm/objects/ParamDefinition.mjs} +0 -0
- /package/{build/src/objects/PinTypes.js → dist/esm/objects/PinTypes.mjs} +0 -0
- /package/{build/src/objects/Wire.js → dist/esm/objects/Wire.mjs} +0 -0
- /package/{build/src/server.js → dist/esm/server.mjs} +0 -0
- /package/{build/src/utils.js → dist/esm/utils.mjs} +0 -0
- /package/{build/src → dist/types}/export.d.ts +0 -0
- /package/{build/src → dist/types}/fonts.d.ts +0 -0
- /package/{build/src → dist/types}/globals.d.ts +0 -0
- /package/{build/src → dist/types}/logger.d.ts +0 -0
- /package/{build/src → dist/types}/main.d.ts +0 -0
- /package/{build/src → dist/types}/objects/Frame.d.ts +0 -0
- /package/{build/src → dist/types}/objects/Net.d.ts +0 -0
- /package/{build/src → dist/types}/objects/ParamDefinition.d.ts +0 -0
- /package/{build/src → dist/types}/objects/PinTypes.d.ts +0 -0
- /package/{build/src → dist/types}/objects/Wire.d.ts +0 -0
- /package/{build/src → dist/types}/regenerate-tests.d.ts +0 -0
- /package/{build/src → dist/types}/server.d.ts +0 -0
- /package/{build/src → dist/types}/utils.d.ts +0 -0
package/build/src/helpers.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function renderScript(scriptData: string, outputPath: string, options: any): string;
|
package/build/src/helpers.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { writeFileSync } from "fs";
|
|
2
|
-
import { generateKiCADNetList } from "./export.js";
|
|
3
|
-
import { LayoutEngine } from "./layout.js";
|
|
4
|
-
import { SequenceAction } from "./objects/ExecutionScope.js";
|
|
5
|
-
import { parseFileWithVisitor } from "./parser.js";
|
|
6
|
-
import { generateSVG2 } from "./render.js";
|
|
7
|
-
import { SimpleStopwatch } from "./utils.js";
|
|
8
|
-
import { MainVisitor } from "./visitor.js";
|
|
9
|
-
export function renderScript(scriptData, outputPath, options) {
|
|
10
|
-
const { currentDirectory = null, defaultLibsPath, dumpNets = false, dumpData = false, kicadNetlistPath = null, showStats = false } = options;
|
|
11
|
-
const visitor = new MainVisitor(true);
|
|
12
|
-
visitor.onImportFile = visitor.createImportFileHandler(currentDirectory, defaultLibsPath);
|
|
13
|
-
visitor.print('reading file');
|
|
14
|
-
visitor.print('done reading file');
|
|
15
|
-
const { tree, parser, hasParseError, hasError, parserTimeTaken, lexerTimeTaken } = parseFileWithVisitor(visitor, scriptData);
|
|
16
|
-
showStats && console.log('Lexing took:', lexerTimeTaken);
|
|
17
|
-
showStats && console.log('Parsing took:', parserTimeTaken);
|
|
18
|
-
dumpNets && console.log(visitor.dumpNets());
|
|
19
|
-
dumpData && writeFileSync('dump/tree.lisp', tree.toStringTree(null, parser));
|
|
20
|
-
dumpData && writeFileSync('dump/raw-parser.txt', visitor.logger.dump());
|
|
21
|
-
if (hasError || hasParseError) {
|
|
22
|
-
console.log('Error while parsing');
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
25
|
-
try {
|
|
26
|
-
visitor.annotateComponents();
|
|
27
|
-
}
|
|
28
|
-
catch (err) {
|
|
29
|
-
console.log('Error during annotation: ', err);
|
|
30
|
-
}
|
|
31
|
-
if (kicadNetlistPath) {
|
|
32
|
-
const kicadNetList = generateKiCADNetList(visitor.getNetList());
|
|
33
|
-
writeFileSync(kicadNetlistPath, kicadNetList);
|
|
34
|
-
console.log('Generated KiCad netlist file');
|
|
35
|
-
}
|
|
36
|
-
const { sequence, nets } = visitor.getGraph();
|
|
37
|
-
const tmpSequence = sequence.map(item => {
|
|
38
|
-
const tmp = [...item];
|
|
39
|
-
const action = tmp[0];
|
|
40
|
-
if (action === SequenceAction.Wire) {
|
|
41
|
-
tmp[2] = tmp[2].map(item2 => {
|
|
42
|
-
return [item2.direction, item2.value].join(",");
|
|
43
|
-
}).join(" ");
|
|
44
|
-
}
|
|
45
|
-
else if (action === SequenceAction.Frame) {
|
|
46
|
-
tmp[1] = item[1].frameId;
|
|
47
|
-
}
|
|
48
|
-
else if (action !== SequenceAction.WireJump) {
|
|
49
|
-
tmp[1] = item[1].instanceName;
|
|
50
|
-
}
|
|
51
|
-
return tmp.join(" | ");
|
|
52
|
-
});
|
|
53
|
-
dumpData && writeFileSync('dump/raw-sequence.txt', tmpSequence.join('\n'));
|
|
54
|
-
let svgOutput = null;
|
|
55
|
-
try {
|
|
56
|
-
const layoutEngine = new LayoutEngine();
|
|
57
|
-
const layoutTimer = new SimpleStopwatch();
|
|
58
|
-
const graph = layoutEngine.runLayout(sequence, nets);
|
|
59
|
-
layoutEngine.printWarnings();
|
|
60
|
-
showStats && console.log('Layout took:', layoutTimer.lap());
|
|
61
|
-
dumpData && writeFileSync('dump/raw-layout.txt', layoutEngine.logger.dump());
|
|
62
|
-
const generateSvgTimer = new SimpleStopwatch();
|
|
63
|
-
svgOutput = generateSVG2(graph);
|
|
64
|
-
showStats && console.log('Render took:', generateSvgTimer.lap());
|
|
65
|
-
if (outputPath) {
|
|
66
|
-
writeFileSync(outputPath, svgOutput);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
catch (err) {
|
|
70
|
-
console.log('Error during render: ', err);
|
|
71
|
-
}
|
|
72
|
-
return svgOutput;
|
|
73
|
-
}
|
package/build/src/parser.js
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { CharStream, CommonTokenStream, ErrorListener } from 'antlr4';
|
|
2
|
-
import CircuitScriptParser from './antlr/CircuitScriptParser.js';
|
|
3
|
-
import { MainLexer } from './lexer.js';
|
|
4
|
-
import { SimpleStopwatch } from './utils.js';
|
|
5
|
-
export function parseFileWithVisitor(visitor, data) {
|
|
6
|
-
const chars = new CharStream(data);
|
|
7
|
-
const lexer = new MainLexer(chars);
|
|
8
|
-
const lexerTimer = new SimpleStopwatch();
|
|
9
|
-
const tokens = new CommonTokenStream(lexer);
|
|
10
|
-
tokens.fill();
|
|
11
|
-
const lexerTimeTaken = lexerTimer.lap();
|
|
12
|
-
const parserTimer = new SimpleStopwatch();
|
|
13
|
-
const parser = new CircuitScriptParser(tokens);
|
|
14
|
-
parser.removeErrorListeners();
|
|
15
|
-
const errorListener = new CircuitscriptParserErrorListener();
|
|
16
|
-
parser.addErrorListener(errorListener);
|
|
17
|
-
const tree = parser.script();
|
|
18
|
-
let hasError = false;
|
|
19
|
-
try {
|
|
20
|
-
visitor.visit(tree);
|
|
21
|
-
}
|
|
22
|
-
catch (err) {
|
|
23
|
-
err.print(data);
|
|
24
|
-
hasError = true;
|
|
25
|
-
}
|
|
26
|
-
const parserTimeTaken = parserTimer.lap();
|
|
27
|
-
return {
|
|
28
|
-
tree, parser,
|
|
29
|
-
hasParseError: errorListener.hasParseErrors(),
|
|
30
|
-
hasError,
|
|
31
|
-
parserTimeTaken,
|
|
32
|
-
lexerTimeTaken,
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
function dumpTokens(tokens, lexer, scriptData) {
|
|
36
|
-
tokens.forEach(item => {
|
|
37
|
-
if (item.type !== -1) {
|
|
38
|
-
let stringValue = "";
|
|
39
|
-
let textPart = "";
|
|
40
|
-
if (lexer.symbolicNames[item.type] !== null && lexer.symbolicNames[item.type] !== undefined) {
|
|
41
|
-
stringValue = lexer.symbolicNames[item.type];
|
|
42
|
-
if (stringValue !== "NEWLINE") {
|
|
43
|
-
textPart = scriptData.substring(item.start, item.stop + 1);
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
textPart = item.text.length - 1;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
else if (lexer.literalNames[item.type] !== null && lexer.literalNames[item.type] !== undefined) {
|
|
50
|
-
stringValue = lexer.literalNames[item.type];
|
|
51
|
-
textPart = scriptData.substring(item.start, item.stop + 1);
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
stringValue = item._text;
|
|
55
|
-
}
|
|
56
|
-
console.log('line', item.line + ':' + item.column, `\t${stringValue} (${item.type})`.padEnd(30), textPart);
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
export class CircuitscriptParserErrorListener extends ErrorListener {
|
|
61
|
-
syntaxErrorCounter = 0;
|
|
62
|
-
syntaxError(recognizer, offendingSymbol, line, column, msg, e) {
|
|
63
|
-
console.log("Syntax error at line", line, ':', column, ' - ', msg);
|
|
64
|
-
this.syntaxErrorCounter++;
|
|
65
|
-
}
|
|
66
|
-
hasParseErrors() {
|
|
67
|
-
return (this.syntaxErrorCounter > 0);
|
|
68
|
-
}
|
|
69
|
-
}
|
package/build/src/visitor.d.ts
DELETED
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import { ParseTreeVisitor, ParserRuleContext } from 'antlr4';
|
|
2
|
-
import { Add_component_exprContext, AdditionExprContext, Assignment_exprContext, At_blockContext, At_block_pin_exprContext, At_block_pin_expression_complexContext, At_block_pin_expression_simpleContext, At_component_exprContext, Atom_exprContext, BinaryOperatorExprContext, Blank_exprContext, Path_blocksContext, Component_select_exprContext, Create_component_exprContext, Create_graphic_exprContext, DataExprContext, Data_expr_with_assignmentContext, Double_dot_property_set_exprContext, Frame_exprContext, Function_args_exprContext, Function_def_exprContext, Function_return_exprContext, Import_exprContext, Keyword_assignment_exprContext, MultiplyExprContext, Nested_propertiesContext, Net_namespace_exprContext, ParametersContext, Pin_select_expr2Context, Pin_select_exprContext, Point_exprContext, Property_exprContext, Property_key_exprContext, Property_set_exprContext, RoundedBracketsExprContext, ScriptContext, Single_line_propertyContext, Sub_exprContext, To_component_exprContext, Value_exprContext, Wire_exprContext, ValueAtomExprContext, UnaryOperatorExprContext } from './antlr/CircuitScriptParser.js';
|
|
3
|
-
import { ExecutionContext } from './execute.js';
|
|
4
|
-
import { ClassComponent } from './objects/ClassComponent.js';
|
|
5
|
-
import { PinBlankValue } from './objects/ParamDefinition.js';
|
|
6
|
-
import { PinTypes } from './objects/PinTypes.js';
|
|
7
|
-
import { CallableParameter, ComplexType, ComponentPin, ComponentPinNet, FunctionDefinedParameter, ReferenceType, ValueType } from './objects/types.js';
|
|
8
|
-
import { Logger } from './logger.js';
|
|
9
|
-
import { Net } from './objects/Net.js';
|
|
10
|
-
import { SymbolDrawingCommands } from './draw_symbols.js';
|
|
11
|
-
export declare class MainVisitor extends ParseTreeVisitor<any> {
|
|
12
|
-
indentLevel: number;
|
|
13
|
-
startingContext: ExecutionContext;
|
|
14
|
-
executionStack: ExecutionContext[];
|
|
15
|
-
silent: boolean;
|
|
16
|
-
logger: Logger;
|
|
17
|
-
printStream: string[];
|
|
18
|
-
printToConsole: boolean;
|
|
19
|
-
acceptedDirections: string[];
|
|
20
|
-
pinTypesList: string[];
|
|
21
|
-
onImportFile: (visitor: MainVisitor, filePath: string) => {
|
|
22
|
-
hasError: boolean;
|
|
23
|
-
hasParseError: boolean;
|
|
24
|
-
};
|
|
25
|
-
constructor(silent?: boolean);
|
|
26
|
-
getExecutor(): ExecutionContext;
|
|
27
|
-
visit(ctx: ParserRuleContext): any;
|
|
28
|
-
handleError(ctx: ParserRuleContext, err: string | VisitorExecutionException): void;
|
|
29
|
-
visitScript(ctx: ScriptContext): any;
|
|
30
|
-
visitParameters(ctx: ParametersContext): CallableParameter[];
|
|
31
|
-
visitKeyword_assignment_expr(ctx: Keyword_assignment_exprContext): [
|
|
32
|
-
key: string,
|
|
33
|
-
value: any
|
|
34
|
-
];
|
|
35
|
-
visitAssignment_expr(ctx: Assignment_exprContext): ComplexType;
|
|
36
|
-
setInstanceParam(object: ClassComponent, trailers: string[], value: any): void;
|
|
37
|
-
visitValue_expr(ctx: Value_exprContext): ValueType;
|
|
38
|
-
visitBlank_expr(ctx: Blank_exprContext): PinBlankValue;
|
|
39
|
-
visitPin_select_expr(ctx: Pin_select_exprContext): string | number | null;
|
|
40
|
-
visitAdd_component_expr(ctx: Add_component_exprContext): ComponentPin;
|
|
41
|
-
visitAt_component_expr(ctx: At_component_exprContext): ComponentPin;
|
|
42
|
-
visitTo_component_expr(ctx: To_component_exprContext): ComponentPin;
|
|
43
|
-
visitComponent_select_expr(ctx: Component_select_exprContext): ComponentPin;
|
|
44
|
-
visitPath_blocks(ctx: Path_blocksContext): ComponentPin;
|
|
45
|
-
visitBreak_keyword(): number;
|
|
46
|
-
visitCreate_component_expr(ctx: Create_component_exprContext): ClassComponent;
|
|
47
|
-
visitCreate_graphic_expr(ctx: Create_graphic_exprContext): SymbolDrawingCommands;
|
|
48
|
-
visitSub_expr(ctx: Sub_exprContext): [
|
|
49
|
-
id: string,
|
|
50
|
-
parameters: CallableParameter[]
|
|
51
|
-
];
|
|
52
|
-
visitProperty_expr(ctx: Property_exprContext): Map<string, any>;
|
|
53
|
-
visitSingle_line_property(ctx: Single_line_propertyContext): any | any[];
|
|
54
|
-
visitNested_properties(ctx: Nested_propertiesContext): Map<string, any>;
|
|
55
|
-
visitProperty_key_expr(ctx: Property_key_exprContext): string | number;
|
|
56
|
-
visitData_expr_with_assignment(ctx: Data_expr_with_assignmentContext): [
|
|
57
|
-
component: ComplexType,
|
|
58
|
-
pin: string | number | null
|
|
59
|
-
];
|
|
60
|
-
visitValueAtomExpr(ctx: ValueAtomExprContext): ComplexType;
|
|
61
|
-
visitUnaryOperatorExpr(ctx: UnaryOperatorExprContext): ComplexType;
|
|
62
|
-
visitDataExpr(ctx: DataExprContext): ComplexType;
|
|
63
|
-
visitBinaryOperatorExpr(ctx: BinaryOperatorExprContext): boolean | number;
|
|
64
|
-
visitMultiplyExpr(ctx: MultiplyExprContext): number;
|
|
65
|
-
visitAdditionExpr(ctx: AdditionExprContext): number;
|
|
66
|
-
visitFunction_args_expr(ctx: Function_args_exprContext): FunctionDefinedParameter[];
|
|
67
|
-
createNetResolver(executionStack: ExecutionContext[]): (netName: string, netNamespace: string) => {
|
|
68
|
-
found: boolean;
|
|
69
|
-
net?: Net;
|
|
70
|
-
};
|
|
71
|
-
visitFunction_def_expr(ctx: Function_def_exprContext): void;
|
|
72
|
-
private setupDefinedParameters;
|
|
73
|
-
visitFunction_return_expr(ctx: Function_return_exprContext): ComplexType;
|
|
74
|
-
visitAtom_expr(ctx: Atom_exprContext): ReferenceType;
|
|
75
|
-
visitPin_select_expr2(ctx: Pin_select_expr2Context): string | number;
|
|
76
|
-
visitAt_block_pin_expr(ctx: At_block_pin_exprContext): ComponentPin;
|
|
77
|
-
visitAt_block(ctx: At_blockContext): ComponentPin;
|
|
78
|
-
visitAt_block_pin_expression_simple(ctx: At_block_pin_expression_simpleContext): void;
|
|
79
|
-
visitAt_block_pin_expression_complex(ctx: At_block_pin_expression_complexContext): ComponentPin;
|
|
80
|
-
visitWire_expr(ctx: Wire_exprContext): void;
|
|
81
|
-
visitPoint_expr(ctx: Point_exprContext): ComponentPin;
|
|
82
|
-
visitImport_expr(ctx: Import_exprContext): void;
|
|
83
|
-
visitProperty_set_expr(ctx: Property_set_exprContext): void;
|
|
84
|
-
visitDouble_dot_property_set_expr(ctx: Double_dot_property_set_exprContext): void;
|
|
85
|
-
visitRoundedBracketsExpr(ctx: RoundedBracketsExprContext): any;
|
|
86
|
-
visitFrame_expr(ctx: Frame_exprContext): void;
|
|
87
|
-
visitNet_namespace_expr(ctx: Net_namespace_exprContext): string;
|
|
88
|
-
pinTypes: PinTypes[];
|
|
89
|
-
createImportFileHandler(directory: string, defaultLibsPath: string): ((visitor: MainVisitor, importPath: string) => {
|
|
90
|
-
hasError: boolean;
|
|
91
|
-
hasParseError: boolean;
|
|
92
|
-
pathExists: boolean;
|
|
93
|
-
});
|
|
94
|
-
private importLib;
|
|
95
|
-
private parseCreateComponentPins;
|
|
96
|
-
private parseCreateComponentParams;
|
|
97
|
-
private prepareStringValue;
|
|
98
|
-
print(...params: any[]): void;
|
|
99
|
-
printNets(): void;
|
|
100
|
-
dumpNets(): ComponentPinNet[];
|
|
101
|
-
dumpUniqueNets(): Net[];
|
|
102
|
-
dumpVariables(): Map<string, any>;
|
|
103
|
-
dumpInstances(): Map<string, ClassComponent>;
|
|
104
|
-
dump2(): any[];
|
|
105
|
-
getNetList(): NetListItem[];
|
|
106
|
-
getGraph(): {
|
|
107
|
-
sequence: any[];
|
|
108
|
-
nets: import("./objects/types.js").ComponentPinNetPair[];
|
|
109
|
-
components: ClassComponent[];
|
|
110
|
-
};
|
|
111
|
-
annotateComponents(): void;
|
|
112
|
-
private resolveNets;
|
|
113
|
-
private setComponentOrientation;
|
|
114
|
-
private getPropertyExprList;
|
|
115
|
-
private runExpressions;
|
|
116
|
-
private checkNetNamespaceIncludes;
|
|
117
|
-
private getNamespaceParts;
|
|
118
|
-
private setupPrintFunction;
|
|
119
|
-
private getNetNamespace;
|
|
120
|
-
}
|
|
121
|
-
export type NetListItem = {
|
|
122
|
-
instanceName: string;
|
|
123
|
-
instance: ClassComponent;
|
|
124
|
-
pins: {
|
|
125
|
-
[key: string | number]: string;
|
|
126
|
-
};
|
|
127
|
-
};
|
|
128
|
-
export declare class VisitorExecutionException {
|
|
129
|
-
errorMessage: string;
|
|
130
|
-
context: ParserRuleContext;
|
|
131
|
-
constructor(context: ParserRuleContext, errorMessage: string);
|
|
132
|
-
print(scriptData: string): void;
|
|
133
|
-
}
|