Class RecordedSymbols
- All Implemented Interfaces:
BiFunction<ParsedModule, org.antlr.v4.runtime.tree.ParseTree, List<RecordedSymbols.Reference>>
mcp.oracle tools - use
this (moved down from compiler-services with SymbolWrites, 2026-10-04), never a
by-NAME walk (a regex over body text, getText().equals(name) on identifier nodes, a set of names).
Why: a name is not a symbol. The symbol-table audit (2026-10-02, EK9_SYMBOL_TABLE_AUDIT_2026_10_02.md)
found eight editors that matched by name and so treated a same-named local in a SIBLING scope, a word in a comment
or in a String, or a longer name sharing a prefix as the variable they were editing. The compiler has already
bound every identifier to the symbol it means (ParsedModule.getRecordedSymbol(ParseTree)); this class reads those
bindings and nothing else, so comments and String text can never appear (they are not identifier nodes) and two
locals called label in sibling blocks are two different symbols.
apply(ParsedModule, ParseTree)- every identifier in the fragment the compiler bound to a symbol, in source order (reads AND writes; declarations areRecordedDeclarations).SymbolUses- the references to ONE symbol instance, including the uses inside a dynamic function or class through the copy it captured (CaptureAliases,CapturedCopy).RecordedDeclarations- the declarations in the fragment (variables, parameters, loop variables, guards).
No-statics lane S3, 2026-10-29: referencedIn is apply(ParsedModule, ParseTree); usesOf, aliasesOf,
declaredIn and capturedCopy are the classes above; a call's resolved callable is
BoundSymbol.
The fragment must come from the COMPILED tree of parsedModule (the one the program was built from):
a re-parsed copy has no recorded symbols, so every query on it answers empty. Writes are
SymbolWrites, which is built on this.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordOne identifier occurrence the compiler bound to a symbol. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapply(ParsedModule parsedModule, org.antlr.v4.runtime.tree.ParseTree fragment) Every identifier infragmentthat the compiler bound to a symbol, in source order: variables, parameters, properties (bare and through.), functions and methods called, types named,thisandsuper.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BiFunction
andThen
-
Constructor Details
-
RecordedSymbols
public RecordedSymbols()
-
-
Method Details
-
apply
public List<RecordedSymbols.Reference> apply(ParsedModule parsedModule, org.antlr.v4.runtime.tree.ParseTree fragment) Every identifier infragmentthat the compiler bound to a symbol, in source order: variables, parameters, properties (bare and through.), functions and methods called, types named,thisandsuper. Reads and writes alike (SymbolWritestells them apart); the NAME of a declaration is not a reference (RecordedDeclarations). Never a comment, never String text - only the identifiers inside an interpolation hole${...}, which are code. WasreferencedIn.- Specified by:
applyin interfaceBiFunction<ParsedModule, org.antlr.v4.runtime.tree.ParseTree, List<RecordedSymbols.Reference>>
-