@bitloops/bl-transpiler
Version:
The one and only Bitloops Language transpiler
31 lines • 931 B
JavaScript
import { ExecuteNode } from '../nodes/ExecuteNode.js';
export class ExecuteNodeBuilder {
parameter;
statementList;
returnType;
useCaseExecuteNode;
constructor(metadata) {
this.useCaseExecuteNode = new ExecuteNode(metadata);
}
withParameter(parameter) {
this.parameter = parameter;
return this;
}
withStatementList(statementList) {
this.statementList = statementList;
return this;
}
withReturnType(returnType) {
this.returnType = returnType;
return this;
}
build() {
this.useCaseExecuteNode.addChild(this.statementList);
this.useCaseExecuteNode.addChild(this.returnType);
if (this.parameter)
this.useCaseExecuteNode.addChild(this.parameter);
this.useCaseExecuteNode.buildObjectValue();
return this.useCaseExecuteNode;
}
}
//# sourceMappingURL=ExecuteNodeBuilder.js.map