classafPegger::TreeCtx
sys::Obj afPegger::TreeCtx
@Js
The ctx object that holds the tree structure. Is created with an initial root element
- current
TreeItem current := this.items.firstReturns the current tree item. This is set by
push()andpop().- items
TreeItem[] items := TreeItem[TreeItem.<ctor>("root")]- pop
Pops the last
TreeItemoff the stack. Iftypeis non-null then item are repeatedly popped until the last popped item was of the same type.- push
This push(Str type, Str? matched := null, Obj? data := null)Creates a
TreeItemadding it as a child and setting it to current.- root
TreeItem root()Returns the root item.
- toStr
virtual override Str toStr()Prints the tree structure.