(e)
| 23 | children:[]},this.stack=[this.rootNode]}get top(){ |
| 24 | return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){ |
| 25 | this.top.children.push(e)}openNode(e){const t={kind:e,children:[]} |
| 26 | ;this.add(t),this.stack.push(t)}closeNode(){ |
| 27 | if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){ |
| 28 | for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)} |
| 29 | walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){ |