C# Class Antlr4.Runtime.Tree.Trees

A set of utility routines useful for all kinds of ANTLR trees.
Datei anzeigen Open project: antlr/antlr4

Public Methods

Method Description
Descendants ( IParseTree t ) : IList
FindAllNodes ( IParseTree t, int index, bool findTokens ) : IList
FindAllRuleNodes ( IParseTree t, int ruleIndex ) : ICollection
FindAllTokenNodes ( IParseTree t, int ttype ) : ICollection
GetChildren ( ITree t ) : IList

Return ordered list of all children of this node

GetNodeText ( ITree t, IList ruleNames ) : string
GetNodeText ( ITree t, Parser recog ) : string
ToStringTree ( ITree t ) : string

Print out a whole tree in LISP form.

Print out a whole tree in LISP form. GetNodeText(ITree, Antlr4.Runtime.Parser) is used on the node payloads to get the text for the nodes. Detect parse trees and extract data appropriately.

ToStringTree ( ITree t, IList ruleNames ) : string

Print out a whole tree in LISP form.

Print out a whole tree in LISP form. GetNodeText(ITree, Antlr4.Runtime.Parser) is used on the node payloads to get the text for the nodes. Detect parse trees and extract data appropriately.

ToStringTree ( ITree t, Parser recog ) : string

Print out a whole tree in LISP form.

Print out a whole tree in LISP form. GetNodeText(ITree, Antlr4.Runtime.Parser) is used on the node payloads to get the text for the nodes. Detect parse trees and extract data appropriately.

Private Methods

Method Description
GetAncestors ( ITree t ) : IList
Trees ( ) : System.Collections.Generic
_findAllNodes ( IParseTree t, int index, bool findTokens, IList nodes ) : void

Method Details

Descendants() public static method

public static Descendants ( IParseTree t ) : IList
t IParseTree
return IList

FindAllNodes() public static method

public static FindAllNodes ( IParseTree t, int index, bool findTokens ) : IList
t IParseTree
index int
findTokens bool
return IList

FindAllRuleNodes() public static method

public static FindAllRuleNodes ( IParseTree t, int ruleIndex ) : ICollection
t IParseTree
ruleIndex int
return ICollection

FindAllTokenNodes() public static method

public static FindAllTokenNodes ( IParseTree t, int ttype ) : ICollection
t IParseTree
ttype int
return ICollection

GetChildren() public static method

Return ordered list of all children of this node
public static GetChildren ( ITree t ) : IList
t ITree
return IList

GetNodeText() public static method

public static GetNodeText ( ITree t, IList ruleNames ) : string
t ITree
ruleNames IList
return string

GetNodeText() public static method

public static GetNodeText ( ITree t, Parser recog ) : string
t ITree
recog Parser
return string

ToStringTree() public static method

Print out a whole tree in LISP form.
Print out a whole tree in LISP form. GetNodeText(ITree, Antlr4.Runtime.Parser) is used on the node payloads to get the text for the nodes. Detect parse trees and extract data appropriately.
public static ToStringTree ( ITree t ) : string
t ITree
return string

ToStringTree() public static method

Print out a whole tree in LISP form.
Print out a whole tree in LISP form. GetNodeText(ITree, Antlr4.Runtime.Parser) is used on the node payloads to get the text for the nodes. Detect parse trees and extract data appropriately.
public static ToStringTree ( ITree t, IList ruleNames ) : string
t ITree
ruleNames IList
return string

ToStringTree() public static method

Print out a whole tree in LISP form.
Print out a whole tree in LISP form. GetNodeText(ITree, Antlr4.Runtime.Parser) is used on the node payloads to get the text for the nodes. Detect parse trees and extract data appropriately.
public static ToStringTree ( ITree t, Parser recog ) : string
t ITree
recog Parser
return string