Stack is a helper for Nodes that need to produce stack-based code instead of continuous flow.
They are usually needed in cases like If, Else.
Constructor
new StackNode(parent?)| Parameter | Type | Default Value |
|---|---|---|
| parent? | null | StackNode | null |
Constructs a new stack node.
| Accessor | Type | |
|---|---|---|
| get type | string | |
Properties
| Property | Type | Default Value | |
|---|---|---|---|
| nodes | Array<Node> | — | |
| outputNode | null | Node | — | |
| parent | null | StackNode | — | |
| _currentCond | ConditionalNode | — | |
| _expressionNode | Node | — | |
| _currentNode | Node | — | |
| isStackNode | boolean | — | |
| Method | Type | |
|---|---|---|
| getElementType | (builder: any) => string | |
| generateNodeType | (builder: any) => string | |
| getMemberType | (builder: any, name: any) => string | |
| addToStack | (node: Node, index?: number) => StackNode | |
| addToStackBefore | (node: Node) => StackNode | |
| If | (boolNode: Node, method: Function) => StackNode | |
| ElseIf | (boolNode: Node, method: Function) => StackNode | |
| Else | (method: Function) => StackNode | |
| Switch | (expression: any) => StackNode | |
| Case | (...params: Array<…>) => StackNode | |
| Default | (method: Function) => StackNode | |
| setup | (builder: any) => any | |
| hasOutput | (builder: any) => null | boolean | |
| build | (builder: any, ...params: Array<…>) => null | string | Node | |
Extends
NodeTSL function for creating a stack node.
| Parameter | Type | Default Value |
|---|---|---|
| parent? | StackNode | — |
Returns
StackNode