Comment
Comment by alexprengere
Even with the "tree", it is not that trivial, as a single segment tag may be repeated in the "tree", so you cannot just jump to that segment and execute a callback. You need to be aware of the possible transitions from any given "node" in the tree.
Edison solves this by computing a state machine graph whose nodes are all segments, and edges are all transitions, so parsing is just a walk in the graph.