Documentation
¶
Index ¶
- type Resolver
- type TypeRegistry
- func (r *TypeRegistry) All() map[string]parser.Definition
- func (r *TypeRegistry) Lookup(qualifiedName string) (parser.Definition, bool)
- func (r *TypeRegistry) LookupAllByShortName(shortName string) []struct{ ... }
- func (r *TypeRegistry) LookupByShortName(shortName string) (parser.Definition, bool)
- func (r *TypeRegistry) LookupQualifiedByShortName(shortName string) (string, parser.Definition, bool)
- func (r *TypeRegistry) Register(qualifiedName string, def parser.Definition)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Resolver ¶
type Resolver struct {
SearchPaths []string
Registry *TypeRegistry
Resolved map[string]bool
SkipUnresolved bool
}
Resolver resolves AIDL imports and builds a TypeRegistry.
Resolver is NOT safe for concurrent use. While the underlying TypeRegistry is mutex-protected, the Resolver's own resolved map has no synchronization. Callers must ensure that only one goroutine calls Resolver methods at a time.
func (*Resolver) ResolveDocument ¶
ResolveDocument registers definitions from an already-parsed document and transitively resolves all its imports.
func (*Resolver) ResolveFile ¶
ResolveFile parses an AIDL file and transitively resolves all its imports.
func (*Resolver) SetSkipUnresolved ¶
SetSkipUnresolved configures whether the resolver silently skips imports that cannot be found in any search path. When true, missing imports are ignored instead of causing an error.
type TypeRegistry ¶
type TypeRegistry struct {
Defs map[string]parser.Definition
// contains filtered or unexported fields
}
TypeRegistry maps fully qualified AIDL names to their parsed definitions.
func NewTypeRegistry ¶
func NewTypeRegistry() *TypeRegistry
NewTypeRegistry creates a new empty TypeRegistry.
func (*TypeRegistry) All ¶
func (r *TypeRegistry) All() map[string]parser.Definition
All returns a copy of all registered definitions.
func (*TypeRegistry) Lookup ¶
func (r *TypeRegistry) Lookup( qualifiedName string, ) (parser.Definition, bool)
Lookup returns the definition for the given qualified name, or false if not found.
func (*TypeRegistry) LookupAllByShortName ¶
func (r *TypeRegistry) LookupAllByShortName( shortName string, ) []struct { QualifiedName string Def parser.Definition }
LookupAllByShortName returns all fully qualified names and definitions whose short name matches the given name.
func (*TypeRegistry) LookupByShortName ¶
func (r *TypeRegistry) LookupByShortName( shortName string, ) (parser.Definition, bool)
LookupByShortName returns the definition whose short name (last segment after the final dot) matches the given name. If multiple definitions share the same short name, the first match is returned. This is useful for resolving unqualified type references within a package.
func (*TypeRegistry) LookupQualifiedByShortName ¶
func (r *TypeRegistry) LookupQualifiedByShortName( shortName string, ) (string, parser.Definition, bool)
LookupQualifiedByShortName returns the fully qualified name and definition whose short name (last segment after the final dot) matches the given name. If multiple definitions share the same short name, the first match is returned.
func (*TypeRegistry) Register ¶
func (r *TypeRegistry) Register( qualifiedName string, def parser.Definition, )
Register adds a definition to the registry under the given qualified name.