[]Trait lark_parser::ParserDatabase

pub trait ParserDatabase: GetQueryTable<FileNamesQuery> + GetQueryTable<FileTextQuery> + GetQueryTable<EntitySpanQuery> + GetQueryTable<CharacteristicEntitySpanQuery> + GetQueryTable<LineOffsetsQuery> + GetQueryTable<LocationQuery> + GetQueryTable<ByteIndexQuery> + GetQueryTable<FileTokensQuery> + GetQueryTable<ParsedFileQuery> + GetQueryTable<ChildParsedEntitiesQuery> + GetQueryTable<ParsedEntityQuery> + GetQueryTable<ChildEntitiesQuery> + GetQueryTable<DescendantEntitiesQuery> + GetQueryTable<FnBodyQuery> + GetQueryTable<HoverTargetsQuery> + GetQueryTable<MembersQuery> + GetQueryTable<MemberEntityQuery> + GetQueryTable<TyQuery> + GetQueryTable<SignatureQuery> + GetQueryTable<GenericDeclarationsQuery> + GetQueryTable<ResolveNameQuery> + AsRef<GlobalIdentifierTables> + AsRef<EntityTables> + AsRef<DeclarationTables> + Database {
    fn file_names(&self) -> Seq<FileName> { ... }
fn file_text(&self, id: FileName) -> Text { ... }
fn entity_span(&self, entity: Entity) -> Span<FileName> { ... }
fn characteristic_entity_span(&self, entity: Entity) -> Span<FileName> { ... }
fn line_offsets(&self, id: FileName) -> Seq<usize> { ... }
fn location(&self, id: FileName, index: ByteIndex) -> Location { ... }
fn byte_index(&self, id: FileName, line: u64, column: u64) -> ByteIndex { ... }
fn file_tokens(
        &self,
        id: FileName
    ) -> WithError<Seq<Spanned<LexToken, FileName>>> { ... }
fn parsed_file(&self, id: FileName) -> WithError<ParsedFile> { ... }
fn child_parsed_entities(
        &self,
        entity: Entity
    ) -> WithError<Seq<ParsedEntity>> { ... }
fn parsed_entity(&self, entity: Entity) -> ParsedEntity { ... }
fn child_entities(&self, entity: Entity) -> Seq<Entity> { ... }
fn descendant_entities(&self, entity: Entity) -> Seq<Entity> { ... }
fn fn_body(&self, key: Entity) -> WithError<Arc<FnBody>> { ... }
fn hover_targets(
        &self,
        file: FileName,
        index: ByteIndex
    ) -> Seq<HoverTarget> { ... }
fn members(&self, key: Entity) -> Result<Seq<Member>, ErrorReported> { ... }
fn member_entity(
        &self,
        entity: Entity,
        kind: MemberKind,
        id: GlobalIdentifier
    ) -> Option<Entity> { ... }
fn ty(&self, key: Entity) -> WithError<Ty<Declaration>> { ... }
fn signature(
        &self,
        key: Entity
    ) -> WithError<Result<Signature<Declaration>, ErrorReported>> { ... }
fn generic_declarations(
        &self,
        key: Entity
    ) -> WithError<Result<Arc<GenericDeclarations>, ErrorReported>> { ... }
fn resolve_name(
        &self,
        scope: Entity,
        name: GlobalIdentifier
    ) -> Option<Entity> { ... } }

Provided methods

fn file_names(&self) -> Seq<FileName>

fn file_text(&self, id: FileName) -> Text

fn entity_span(&self, entity: Entity) -> Span<FileName>

fn characteristic_entity_span(&self, entity: Entity) -> Span<FileName>

fn line_offsets(&self, id: FileName) -> Seq<usize>

Returns, for each line in the given file, the start index -- the final element is the length of the file (there is kind of a "pseudo-empty line" at the end, so to speak). So for the input "a\nb\r\nc" you would get [0, 2, 5, 6].

fn location(&self, id: FileName, index: ByteIndex) -> Location

fn byte_index(&self, id: FileName, line: u64, column: u64) -> ByteIndex

Given a (zero-based) line number line and column within the line, gives a byte-index into the file's text.

fn file_tokens(
    &self,
    id: FileName
) -> WithError<Seq<Spanned<LexToken, FileName>>>

fn parsed_file(&self, id: FileName) -> WithError<ParsedFile>

fn child_parsed_entities(&self, entity: Entity) -> WithError<Seq<ParsedEntity>>

fn parsed_entity(&self, entity: Entity) -> ParsedEntity

fn child_entities(&self, entity: Entity) -> Seq<Entity>

Returns the immediate children of entity in the entity tree.

fn descendant_entities(&self, entity: Entity) -> Seq<Entity>

Transitive closure of child_entities.

fn fn_body(&self, key: Entity) -> WithError<Arc<FnBody>>

Get the fn-body for a given def-id.

fn hover_targets(&self, file: FileName, index: ByteIndex) -> Seq<HoverTarget>

Given a span, find the things that it may have been referring to.

fn members(&self, key: Entity) -> Result<Seq<Member>, ErrorReported>

Get the list of member names and their def-ids for a given struct.

fn member_entity(
    &self,
    entity: Entity,
    kind: MemberKind,
    id: GlobalIdentifier
) -> Option<Entity>

Gets the def-id for a field of a given class.

fn ty(&self, key: Entity) -> WithError<Ty<Declaration>>

Get the type of something.

fn signature(
    &self,
    key: Entity
) -> WithError<Result<Signature<Declaration>, ErrorReported>>

Get the signature of a function.

fn generic_declarations(
    &self,
    key: Entity
) -> WithError<Result<Arc<GenericDeclarations>, ErrorReported>>

Get the generic declarations from a particular item.

fn resolve_name(&self, scope: Entity, name: GlobalIdentifier) -> Option<Entity>

Resolve a type name that appears in the given entity.

Loading content...

Implementors

Loading content...