@eagleoutice/flowr - v2.10.2
    Preparing search index...

    Interface ReadonlyFlowrAnalysisProvider<Parser>

    Exposes the central analyses and information provided by the FlowrAnalyzer to the linter, search, and query APIs. This allows us to exchange the underlying implementation of the analyzer without affecting the APIs. You can also use parseStandalone to parse standalone R code snippets.

    interface ReadonlyFlowrAnalysisProvider<
        Parser extends KnownParser = KnownParser,
    > {
        callGraph(force?: boolean): Promise<CallGraph>;
        controlflow(
            simplifications?: readonly (
                | "unique-cf-sets"
                | "analyze-dead-code"
                | "remove-dead-code"
                | "to-basic-blocks"
            )[],
            kind?: CfgKind,
            force?: boolean,
        ): Promise<ControlFlowInformation<CfgVertex>>;
        dataflow(
            force?: boolean,
        ): Promise<DataflowInformation & PipelinePerStepMetaInformation>;
        flowrConfig: FlowrConfig;
        inspectContext(): ReadOnlyFlowrAnalyzerContext;
        normalize(
            force?: boolean,
        ): Promise<
            NormalizedAst<ParentInformation, RProject<ParentInformation>> & PipelinePerStepMetaInformation,
        >;
        normalizeStandalone(data: string | RParseRequest): NormalizedAst;
        parse(
            force?: boolean,
        ): Promise<NonNullable<AnalyzerCacheType<Parser>["parse"]>>;
        parserInformation(): KnownParserInformation;
        parseStandalone(data: string | RParseRequest): Tree;
        peekCallGraph(): CallGraph | undefined;
        peekControlflow(
            simplifications?: readonly (
                | "unique-cf-sets"
                | "analyze-dead-code"
                | "remove-dead-code"
                | "to-basic-blocks"
            )[],
            kind?: CfgKind,
        ): ControlFlowInformation<CfgVertex> | undefined;
        peekDataflow(): | DataflowInformation & PipelinePerStepMetaInformation
        | undefined;
        peekNormalize(): | NormalizedAst<
            ParentInformation,
            RProject<ParentInformation>,
        > & PipelinePerStepMetaInformation
        | undefined;
        peekParse(): NonNullable<AnalyzerCacheType<Parser>["parse"]> | undefined;
        query<
            Types extends
                | "search"
                | "origin"
                | "call-context"
                | "config"
                | "dataflow"
                | "does-call"
                | "call-graph"
                | "control-flow"
                | "dataflow-lens"
                | "files"
                | "df-shape"
                | "normalized-ast"
                | "id-map"
                | "dataflow-cluster"
                | "static-slice"
                | "dependencies"
                | "location-map"
                | "happens-before"
                | "inspect-exception"
                | "inspect-higher-order"
                | "inspect-recursion"
                | "resolve-value"
                | "project"
                | "linter"
                | "provenance"
                | "input-sources" = | "search"
            | "origin"
            | "call-context"
            | "config"
            | "dataflow"
            | "does-call"
            | "call-graph"
            | "control-flow"
            | "dataflow-lens"
            | "files"
            | "df-shape"
            | "normalized-ast"
            | "id-map"
            | "dataflow-cluster"
            | "static-slice"
            | "dependencies"
            | "location-map"
            | "happens-before"
            | "inspect-exception"
            | "inspect-higher-order"
            | "inspect-recursion"
            | "resolve-value"
            | "project"
            | "linter"
            | "provenance"
            | "input-sources",
        >(
            query: Queries<Types>,
        ): Promise<QueryResults<Types>>;
        runFull(force?: boolean): Promise<void>;
        runSearch<Search extends FlowrSearchLike>(
            search: Search,
        ): Promise<GetSearchElements<SearchOutput<Search>>>;
    }

    Type Parameters

    Hierarchy (View Summary)

    Implemented by

    Hierarchy-Diagram

    UML class diagram of ReadonlyFlowrAnalysisProvider
    Index

    Properties

    flowrConfig: FlowrConfig

    This is the config used for the analyzer

    Methods

    • Get the control flow graph (CFG) for the request.

      Parameters

      • Optionalsimplifications: readonly (
            | "unique-cf-sets"
            | "analyze-dead-code"
            | "remove-dead-code"
            | "to-basic-blocks"
        )[]

        Simplification passes to be applied to the CFG.

      • Optionalkind: CfgKind

        The kind of CFG that is requested. By default, the CFG without dataflow information is returned.

      • Optionalforce: boolean

        Do not use the cache, instead force new analyses.

      Returns Promise<ControlFlowInformation<CfgVertex>>

      ReadonlyFlowrAnalysisProvider#peekControlflow - to get the CFG if already available without triggering a new computation.

    • Peek at the control flow graph (CFG) for the request, if it was already computed.

      Parameters

      • Optionalsimplifications: readonly (
            | "unique-cf-sets"
            | "analyze-dead-code"
            | "remove-dead-code"
            | "to-basic-blocks"
        )[]
      • Optionalkind: CfgKind

      Returns ControlFlowInformation<CfgVertex> | undefined

    • Access the query API for the request.

      Type Parameters

      • Types extends
            | "search"
            | "origin"
            | "call-context"
            | "config"
            | "dataflow"
            | "does-call"
            | "call-graph"
            | "control-flow"
            | "dataflow-lens"
            | "files"
            | "df-shape"
            | "normalized-ast"
            | "id-map"
            | "dataflow-cluster"
            | "static-slice"
            | "dependencies"
            | "location-map"
            | "happens-before"
            | "inspect-exception"
            | "inspect-higher-order"
            | "inspect-recursion"
            | "resolve-value"
            | "project"
            | "linter"
            | "provenance"
            | "input-sources" =
            | "search"
            | "origin"
            | "call-context"
            | "config"
            | "dataflow"
            | "does-call"
            | "call-graph"
            | "control-flow"
            | "dataflow-lens"
            | "files"
            | "df-shape"
            | "normalized-ast"
            | "id-map"
            | "dataflow-cluster"
            | "static-slice"
            | "dependencies"
            | "location-map"
            | "happens-before"
            | "inspect-exception"
            | "inspect-higher-order"
            | "inspect-recursion"
            | "resolve-value"
            | "project"
            | "linter"
            | "provenance"
            | "input-sources"

      Parameters

      Returns Promise<QueryResults<Types>>

    • This executes all steps of the core analysis (parse, normalize, dataflow).

      Parameters

      • Optionalforce: boolean

      Returns Promise<void>