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

    Builder for the FlowrAnalyzer, use it to configure all analysis aspects before creating the analyzer instance with .build() or .buildSync().

    You can add new files and folders to analyze using the .addRequest() method on the resulting analyzer.

    const analyzer = new FlowrAnalyzerBuilder()
    .setParser(new TreeSitterExecutor())
    .buildSync()
    .addRequest('file:///path/to/script.R')

    If you now want to get the dataflow information for the file, you can do this:

    const dfInfo = await analyzer.dataflow();
    console.log(dfInfo);
    Index

    Constructors

    Methods

    • Apply an amendment to the configuration the builder currently holds. This is mostly intended for more complex logic to transform the config. Please consider using FlowrAnalyzerBuilder.configure to set/amend individual values Per default, the value returned by FlowrConfig.default is used.

      Parameters

      • func: (
            config: {
                abstractInterpretation: {
                    dataFrame: {
                        maxColNames: number;
                        readLoadedData: { maxReadLines: number; readExternalFiles: boolean };
                    };
                    wideningThreshold: number;
                };
                defaultEngine?: "r-shell"
                | "tree-sitter";
                engines: (
                    | { rPath?: string; type: "r-shell"; [key: string]: unknown }
                    | {
                        lax?: boolean;
                        treeSitterWasmPath?: string;
                        type: "tree-sitter";
                        wasmPath?: string;
                        [key: string]: unknown;
                    }
                )[];
                ignoreSourceCalls: boolean;
                project: { resolveUnknownPathsOnDisk: boolean };
                repl: { dfProcessorHeat: boolean; quickStats: boolean };
                semantics: {
                    environment: {
                        overwriteBuiltIns: {
                            definitions: (
                                | {
                                    assumePrimitive?: boolean;
                                    config: { constructName?: "s7"; readIndices: boolean };
                                    names: (
                                        BrandedIdentifier
                                        | [id: ..., namespace: ..., internal?: ...]
                                    )[];
                                    suffixes: ("<<-" | "<-")[];
                                    type: "replacement";
                                }
                                | {
                                    assumePrimitive?: boolean;
                                    names: (
                                        BrandedIdentifier
                                        | [id: ..., namespace: ..., internal?: ...]
                                    )[];
                                    type: "constant";
                                    value: unknown;
                                }
                                | {
                                    assumePrimitive?: boolean;
                                    config?: | {
                                        forceArgs?: (...)
                                        | (...)
                                        | (...);
                                        libFn?: (...) | (...) | (...);
                                        treatIndicesAsString: boolean;
                                    }
                                    | {
                                        indexOfFunction?: (...)
                                        | (...);
                                        libFn?: (...) | (...) | (...);
                                        nameOfFunctionArgument?: (...) | (...);
                                        resolveInEnvironment?: (...) | (...) | (...);
                                        resolveValue?: (...) | (...) | (...);
                                        unquoteFunction?: (...) | (...) | (...);
                                        [key: string]: unknown;
                                    }
                                    | {
                                        canBeReplacement?: (...)
                                        | (...)
                                        | (...);
                                        forceArgs?: (...) | (...) | (...);
                                        libFn?: (...) | (...) | (...);
                                        makeMaybe?: (...) | (...) | (...);
                                        mayHaveMoreArgs?: (...) | (...) | (...);
                                        modesForFn?: (...) | (...);
                                        quoteSource?: (...) | (...) | (...);
                                        superAssignment?: (...) | (...) | (...);
                                        swapSourceAndTarget?: (...) | (...) | (...);
                                        targetVariable?: (...) | (...) | (...);
                                    }
                                    | {
                                        canBeReplacement?: (...)
                                        | (...)
                                        | (...);
                                        forceArgs?: (...) | (...) | (...);
                                        libFn?: (...) | (...) | (...);
                                        makeMaybe?: (...) | (...) | (...);
                                        mayHaveMoreArgs?: (...) | (...) | (...);
                                        modesForFn?: (...) | (...);
                                        quoteSource?: (...) | (...) | (...);
                                        source: { idx?: ...; name: ... };
                                        superAssignment?: (...) | (...) | (...);
                                        swapSourceAndTarget?: (...) | (...) | (...);
                                        target: { idx?: ...; name: ... };
                                        targetVariable?: (...) | (...) | (...);
                                    }
                                    | {
                                        cfg?: (...)
                                        | (...);
                                        forceArgs?: (...) | (...) | (...);
                                        hasUnknownSideEffects?: (...) | (...) | (...) | (...) | (...);
                                        libFn?: (...) | (...) | (...);
                                        readAllArguments?: (...) | (...) | (...);
                                        returnsNthArgument?: (...) | (...) | (...);
                                        treatAsFnCall?: (...) | (...);
                                        useAsProcessor?: (...) | (...);
                                    }
                                    | {
                                        forceArgs?: (...)
                                        | (...)
                                        | (...);
                                        libFn?: (...) | (...) | (...);
                                        useAsProcessor?: (...) | (...);
                                    }
                                    | {
                                        includeFunctionCall?: (...)
                                        | (...)
                                        | (...);
                                        libFn?: (...) | (...) | (...);
                                    }
                                    | { args?: (...)
                                    | (...); libFn?: (...) | (...) | (...) }
                                    | { args: { env: ...; expr: ... }; libFn?: (...) | (...) | (...) }
                                    | {
                                        assignLhs: boolean;
                                        libFn?: (...) | (...) | (...);
                                        pipePlaceholderName: BrandedIdentifier;
                                        returnLhs: boolean;
                                        rhsMightBeSymbol?: (...) | (...) | (...);
                                    }
                                    | {
                                        ".f": { index: ...; name: ... };
                                        args: { [key: ...]: ... };
                                        ignore?: (...) | (...);
                                        libFn?: (...) | (...) | (...);
                                        returnArg?: (...) | (...);
                                    }
                                    | {
                                        envArgIndex?: (...)
                                        | (...);
                                        forceArgs?: (...) | (...) | (...);
                                        libFn?: (...) | (...) | (...);
                                        quoteArgumentsWithIndex: number;
                                    }
                                    | {
                                        libFn?: (...)
                                        | (...)
                                        | (...);
                                        unknownOnNonZeroArg?: (...) | (...) | (...);
                                    }
                                    | {
                                        args: { add?: ...; after?: ...; expr: ... };
                                        hook: OnFnExit;
                                        libFn?: (...) | (...) | (...);
                                    }
                                    | {
                                        assignmentOperator?: (...)
                                        | (...)
                                        | (...);
                                        assignRootId?: (...) | (...);
                                        constructName?: (...) | (...);
                                        forceArgs?: (...) | (...) | (...);
                                        libFn?: (...) | (...) | (...);
                                        makeMaybe?: (...) | (...) | (...);
                                        readIndices?: (...) | (...) | (...);
                                    }
                                    | {
                                        args: { generic: ...; object: ... };
                                        inferFromClosure?: (...) | (...) | (...);
                                        libFn?: (...) | (...) | (...);
                                    }
                                    | {
                                        args: { dispatchArg: ...; fun: ...; name: ... };
                                        libFn?: (...) | (...) | (...);
                                    }
                                    | {
                                        forceFollow?: (...)
                                        | (...)
                                        | (...);
                                        includeFunctionCall?: (...) | (...) | (...);
                                        libFn?: (...) | (...) | (...);
                                    }
                                    | {
                                        evalRhsWhen: boolean;
                                        forceArgs?: (...)
                                        | (...)
                                        | (...);
                                        lazy: boolean;
                                        libFn?: (...) | (...) | (...);
                                    }
                                    | {
                                        block: string;
                                        handlers: { error?: ...; finally?: ... };
                                        libFn?: (...) | (...) | (...);
                                    };
                                    evalHandler?: string;
                                    names: (
                                        BrandedIdentifier
                                        | [id: ..., namespace: ..., internal?: ...]
                                    )[];
                                    processor:
                                        | Access
                                        | Apply
                                        | Assignment
                                        | AssignmentLike
                                        | Default
                                        | DefaultReadAllArgs
                                        | Eval
                                        | ExpressionList
                                        | ForLoop
                                        | FunctionDefinition
                                        | Get
                                        | IfThenElse
                                        | Library
                                        | List
                                        | Local
                                        | Pipe
                                        | PurrrFormula
                                        | Quote
                                        | Recall
                                        | RegisterHook
                                        | RepeatLoop
                                        | Replacement
                                        | Rm
                                        | S3Dispatch
                                        | S7NewGeneric
                                        | S7Dispatch
                                        | Source
                                        | SpecialBinOp
                                        | StopIfNot
                                        | Try
                                        | Vector
                                        | WhileLoop;
                                    type: "function";
                                }
                            )[];
                            loadDefaults?: boolean;
                        };
                    };
                };
                solver: {
                    evalStrings: boolean;
                    instrument: {
                        dataflowExtractors?: (
                            extractor: DataflowProcessors<ParentInformation>,
                            ctx: FlowrAnalyzerContext,
                        ) => DataflowProcessors<ParentInformation>;
                    };
                    resolveSource?: {
                        applyReplacements?: { [key: string]: string }[];
                        dropPaths: DropPathsOption;
                        ignoreCapitalization: boolean;
                        inferWorkingDirectory: InferWorkingDirectory;
                        repeatedSourceLimit?: number;
                        searchPath: string[];
                        [key: string]: unknown;
                    };
                    slicer?: { autoExtend?: boolean; threshold?: number };
                    variables: VariableResolve;
                };
                [key: string]: unknown;
            },
        ) => void
        | FlowrConfig

        Receives the current configuration of the builder and allows for amendment.

      Returns this