The walking of the query tree. This class takes care of visiting
a tree resulting from parsing a query. As it traverses the tree
it calls appropriate methods of the visitor, set at the construction
time. The class uses a depth-first search, visiting all children
of a node, before visiting the node. The visit is done by calling
an appropriate method of the visitor. Typical code should match
the following pattern:
classMyVisitorimplementsQueryTreeVisitor{...}classMyContextextendsQueryTreeContext<MyContext>{...@OverrideprotectedMyContextnewChildContext(){returnnewMyContext();}}MyContextcontext=newMyContext();QueryTreeWalker<MyContext>walker=newQueryTreeWalker<MyContext>(newMyVisitor());Treeroot=parser.query(queryStr);walker.walk(root,context);// retrieve whatever information you need from context
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-03-05 UTC."],[[["`QueryTreeWalker\u003cT\u003e` traverses a parsed query tree using a depth-first search, visiting child nodes before their parent."],["A `QueryTreeVisitor` instance, passed during construction, handles the visit actions on each node."],["The `walk(Tree tree, T context)` method initiates the tree traversal with a given root `tree` and a `context` object of type `T`."],["The class provides a `simplify(Tree tree)` static method to simplify a tree, returning an `org.antlr.runtime.tree.Tree`."],["The `postBooleanExpression(T context)` protected method is invoked after visiting a boolean expression within the tree, using a context parameter of type `T`."]]],[]]