@Override
    protected void getNext() throws Exception {
      if (childrenIterator == null) {
        this.childrenIterator = initChildrenIterator();
      }
      N child;
      while (childrenIterator.hasNext()) {
        child = childrenIterator.next();
        if (tryGetNextState(child, sourceState, transition) == null) {
          releaseNode(child);
          continue;
        }
        IFAState nextScopeState =
            allScope ? null : getNextMatchedScopeState(currentScopeState, child);
        saveResult(
            child,
            new StateSingleMatchInfo(
                patternFA, patternFA.getNextState(sourceState, transition), nextScopeState));
        return;
      }
    }
The method used for generating the result based on the matched node.
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/schema/tree/AbstractTreeVisitor.java