Class ParseTreeSymbolSearch
java.lang.Object
org.ek9lang.cli.ParseTreeSymbolSearch
Provides parse tree traversal operations for symbol lookup.
Extracts recursive tree walking logic into a reusable helper.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncollectVariablesInScope(org.antlr.v4.runtime.tree.ParseTree root, String scopeName, String prefix) Collect variables from a named scope (e.g., program or function body).findByName(org.antlr.v4.runtime.tree.ParseTree root, String name) Find a symbol by name anywhere in the parse tree.Find the first symbol matching a predicate.
-
Constructor Details
-
ParseTreeSymbolSearch
-
-
Method Details
-
findByName
-
findFirst
-
collectVariablesInScope
public List<ISymbol> collectVariablesInScope(org.antlr.v4.runtime.tree.ParseTree root, String scopeName, String prefix) Collect variables from a named scope (e.g., program or function body).- Parameters:
root- The root node to search fromscopeName- The name of the scope to search withinprefix- Prefix to filter variable names- Returns:
- List of matching variable symbols
-