antlr-ng
Version:
Next generation ANTLR Tool
23 lines (22 loc) • 845 B
TypeScript
import { CommonTree } from "./CommonTree.js";
/**
* Return a node stream from a doubly-linked tree whose nodes know what child index they are. No remove() is supported.
*
* Emit navigation nodes (DOWN, UP, and EOF) to let show tree structure.
*/
export declare class TreeIterator {
/** Navigation nodes to return during walk and at end. */
static readonly up: CommonTree;
static readonly down: CommonTree;
static readonly eof: CommonTree;
protected root: CommonTree | undefined;
protected tree: CommonTree | undefined;
protected firstTime: boolean;
/** If we emit UP/DOWN nodes, we need to spit out multiple nodes per next() call. */
protected nodes: CommonTree[];
constructor(tree: CommonTree);
reset(): void;
hasNext(): boolean;
nextTree(): CommonTree | undefined;
remove(): void;
}