Language record
Swift
Swift is indexed with extensions and protocols treated as real structure: an extension is its own symbol carrying the type it extends, a protocol is recorded as an interface, and a self.init or super.init is a construction rather than a call.
The registry row this page is generated from
Read at render time from the same family row the register reads, so nothing in this block can disagree with it.
- Extensions
- .swift
- Registry names
swift- Recorded symbols
- classes · protocols · methods · constructors
Relationship types this analyzer constructs
11 of 14 constructed, read from this analyzer's source and re-derived by the languages gate. Each row below is one of the engine's types, in the engine's own order.
| Relationship type | Constructed |
|---|---|
calls | constructed by this analyzer |
extends | constructed by this analyzer |
implements | constructed by this analyzer |
uses | constructed by this analyzer |
imports | constructed by this analyzer |
exports | constructed by this analyzer |
contains | constructed by this analyzer |
references | constructed by this analyzer |
overrides | constructed by this analyzer |
instantiates | constructed by this analyzer |
decorates | ruled absent |
renders | constructed by this analyzer |
mixes_in | ruled absent |
part_of | ruled absent |
11 constructed, 3 not constructed. All 3 absent types are recorded as ruled absent: the written reason and the corpus measurement behind each are in this family's completeness record. The register explains what each label means.
What this analyzer does not resolve
- Override resolution runs in three tiers — an exact match inside the file, then the shared companion index, then a deterministic first-parent guess. The last tier is published at reduced confidence precisely because the parent may not declare that member at all.
- A member call resolves to its written leaf: users.first is a call to first with no owner, so an extension method and a member method of the same name are one target in the graph.
- Initializer delegation is never a call edge, because init is a keyword rather than a name in this vocabulary — so which initializer chains to which is not a question the graph answers. deinit and subscript declarations publish no symbols either.
Every line above was written against Swift’s own analyzer module and is named against a construct in it, so it can be checked against the source. Nothing here is inherited from a template, or from another language’s page.
Where you meet it in a repository
Recognised by extension — .swift. Everything below is about where those files actually sit in a working repository.
- Swift reopens a type across many files: the declaration is in one, its behaviour in an extension per protocol in the others.
- SwiftUI state is declared with property wrappers such as @State and @Published, so the attribute often says more than the property's own type does.
- Backtick-escaped keywords are legal identifiers, and bb strips the backticks so a published name matches how the case is actually written.
Questions this index answers
Phrased as retrievals, because that is what an index can honestly do: it holds the symbols and the edges between them, and hands them back with the evidence attached.
- Which protocols does this type adopt?
- Which methods does this extension add to the type?
- Where is this initializer reached from?
- Which enum case does this expression construct?
What the analyzer sees in code like this
protocol Cacheable { // bb records: interface Cacheable
func load() -> Data
}
extension Cache: Cacheable { // bb records: extension Cache · method load
func load() -> Data { return Data() }
}
struct Entry { var id: Int } // bb records: struct Entry · property idSymbols are stored with the file they came from and the bytes they span, so a hit points at a line rather than at a guess. The annotations in the sample are commentary for the reader, not strings the index would store.
Languages that turn up in the same repository
Application & systems — the count beside each name is how many relationship types that family’s analyzer constructs.
The extensions, registry names, recorded symbols and relationship types above are the parser registry row for Swift, read while the page rendered — the same row the register reads, so the two surfaces cannot tell two stories. Every relationship type listed as constructed appears in src/ast/real-*, the analyzer modules bb ships. bb 0.1.0 answers from a local store over 50 languages (53 registry ids, three of them aliases). There is no benchmark on this page: every claim here is one you can go and read in the source.