Class DataFrameShapeInferenceVisitor<OtherInfo, ControlFlow, Ast, Dfg, Config>

The control flow graph visitor to infer the shape of data frames using abstract interpretation

Type Parameters

Hierarchy (View Summary)

Hierarchy-Diagram

UML class diagram of DataFrameShapeInferenceVisitor

Constructors

Properties

config: Config & {
    defaultVisitingOrder: "forward";
    defaultVisitingType: "exit";
}
visited: Map<NodeId, number>

Methods

  • Protected

    This event triggers for every function call that is not handled by a specific overload, and hence may be a function that targets a user-defined function. In a way, these are functions that are named, but flowR does not specifically care about them (currently) wrt. to their dataflow impact.

    Use SemanticCfgGuidedVisitor#getOrigins|getOrigins to get the origins of the call.

    For example, this triggers for foo(x) in

    foo <- function(x) { x + 1 }
    foo(x)

    This explicitly will not trigger for scenarios in which the function has no name (i.e., if it is anonymous). For such cases, you may rely on the SemanticCfgGuidedVisitor#onUnnamedCall|onUnnamedCall event. The main reason for this separation is part of flowR's handling of these functions, as anonymous calls cannot be resolved using the active environment.

    Parameters

    Returns void

  • Protected

    This event triggers for every anonymous call within the program.

    For example, (function(x) { x + 1 })(42) or the second call in a()().

    This is separate from SemanticCfgGuidedVisitor#onDefaultFunctionCall|onDefaultFunctionCall which is used for named function calls that do not trigger any of these events. The main differentiation for these calls is that you may not infer their semantics from any name alone and probably have to rely on SemanticCfgGuidedVisitor#getOrigins|getOrigins to get more information.

    Parameters

    Returns void