This section defines the named entry points for the query. Every named definition in the workspace is an entrypoint and can be executed against a syntax tree.
- Section Offset: Computed (follows TypeNames)
- Record Size: 8 bytes
- Count:
header.entrypoints_count - Ordering: Entries must be sorted lexicographically by the UTF-8 content of their
name(resolved via String Table). This enables binary search at runtime.
#[repr(C)]
struct Entrypoint {
name: u16, // StringId
target: u16, // StepId (into Transitions section)
result_type: u16, // TypeId
_pad: u16, // Padding to 8 bytes
}- name: The name of the export (e.g., "Func", "Class").
StringId. - target: The instruction pointer (
StepId) where execution begins for this definition. This index is relative to the start of the Transitions section. - result_type: The
TypeIdof the structure produced by this query definition. - _pad: Reserved for alignment.
When the user runs a query with a specific entry point (e.g., --entry Func), the runtime:
- Performs a binary search over the entrypoints table, resolving
nameID to string content for comparison. - Sets the initial instruction pointer (
IP) totarget. - Executes the VM.
- Validates that the resulting value matches
result_type.