Expand description
Language-neutral source code metamodel.
A Model is a set of entities (namespaces, files, types, callables,
variables) linked by containment (parent) and by typed relations (calls,
references, inheritance…), each relation keeping all its occurrence
sites. Frontends fill a ModelBuilder; analyses read the frozen,
compact Model through EntityRef and RelationRef.
Structs§
- Entity
Id - Index of an entity in its
crate::Model; only meaningful there. - Entity
Ref - An entity of a
Model; cheap to copy. - KeyError
- Language
Id - Open language identifier (
java,typescript,python,pharo…): supporting a new language must not require changing this crate. - Memory
Stats - Approximate heap usage, to watch the cost of keeping every occurrence.
- Model
- Frozen, compact model.
- Model
Builder - Mutable model under construction. Entities are keyed: frontends that
meet the same symbol (tree-sitter, then SCIP) share one entity.
Relations are deduplicated on
(from, kind, to, provenance); each occurrence site is kept. - Package
manager name version; empty parts are written..- Range
- 0-based, end exclusive (same convention as SCIP and tree-sitter points).
Serialised as
[start_line, start_col, end_line, end_col]. - Relation
Id - Index of a relation in its
crate::Model. - Relation
Ref - A relation of a
Modelwith all its occurrence sites; cheap to copy.
Enums§
- Descriptor
- Entity
Kind - Provenance
- Who asserted a fact: lets analyses weigh syntactic guesses against compiler-grade SCIP data.
- Relation
Kind - Kind of a relation. Containment is not a relation: it is the entity’s parent.
- Symbol
Key - Value
Constants§
- SCHEME
- Scheme of keys built by Model frontends (not by a SCIP indexer).
Type Aliases§
- Props
- Open-ended facts a frontend or an analysis attaches to an entity
(annotations, modifiers, visibility, HTTP endpoints…). Keys are
namespaced by convention:
java.annotations,http.endpoints.