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.first
Returns the current tree item. This is set by
push()
andpop()
.- items
TreeItem[] items := TreeItem[TreeItem.<ctor>("root")]
- pop
Pops the last
TreeItem
off the stack. Iftype
is 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
TreeItem
adding 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.