classafPegger::TreeCtx

sys::Obj
  afPegger::TreeCtx

@Js

The ctx object that holds the tree structure. Is created with an initial root element

current

Source

TreeItem current := this.items.first

Returns the current tree item. This is set by push() and pop().

items

Source

TreeItem[] items := TreeItem[TreeItem.<ctor>("root")]

pop

Source

This pop(Str? type := null)

Pops the last TreeItem off the stack. If type is non-null then item are repeatedly popped until the last popped item was of the same type.

push

Source

This push(Str type, Str? matched := null, Obj? data := null)

Creates a TreeItem adding it as a child and setting it to current.

root

Source

TreeItem root()

Returns the root item.

toStr

Source

virtual override Str toStr()

Prints the tree structure.