diff --git a/runtime/JavaScript/src/antlr4/tree/Trees.d.ts b/runtime/JavaScript/src/antlr4/tree/Trees.d.ts new file mode 100644 index 0000000000..f2d05c9ba5 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/tree/Trees.d.ts @@ -0,0 +1,15 @@ +import { Parser } from "../Parser"; +import { ParseTree } from "./ParseTree"; +import { Tree } from "./Tree"; + +export default Trees; +declare namespace Trees { + function toStringTree(tree: Tree, ruleNames: string[], recog: Parser): string; + function getNodeText(t: Tree, ruleNames: string[], recog: Parser): string; + function getChildren(t: Tree): Tree[]; + function getAncestors(t: Tree): Tree[]; + function findAllTokenNodes(t: ParseTree, ttype: number): ParseTree[]; + function findAllRuleNodes(t: ParseTree, ruleIndex: number): ParseTree[]; + function findAllNodes(t: ParseTree, index: number, findTokens: boolean): ParseTree[]; + function descendants(t: ParseTree): ParseTree[]; +} diff --git a/runtime/JavaScript/src/antlr4/tree/index.d.ts b/runtime/JavaScript/src/antlr4/tree/index.d.ts index 1fde81f536..c3d3d5ad4b 100644 --- a/runtime/JavaScript/src/antlr4/tree/index.d.ts +++ b/runtime/JavaScript/src/antlr4/tree/index.d.ts @@ -5,4 +5,4 @@ export * from './ParseTree'; export * from './ParseTreeListener'; export * from './ParseTreeVisitor'; export * from './ParseTreeWalker'; - +export * as Trees from './Trees';