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

    The context passed to the AbstractSemantics handlers of an abstract domain, providing access to the analyzed program (AST, DFG, CFG), the analyzer context, the value domain of the analysis, as well as to the abstract states and values inferred so far.

    interface AbsintContext<Domain extends StateDomain> {
        ast: Pick<NormalizedAst, "idMap">;
        cfg: ControlFlowGraph;
        context: ReadOnlyFlowrAnalyzerContext;
        dfg: DataflowGraph;
        domain: ValueDomain<Domain>;
        getAbstractState(nodeId: NodeId | undefined): Domain | undefined;
        getAbstractValue(
            node: NodeId | RNodeWithParent | undefined,
            state?: Domain,
        ): ValueDomain<Domain> | undefined;
        getAstNode(nodeId: NodeId | undefined): RNodeWithParent | undefined;
        getCfgVertex(vertexId: NodeId | undefined): CfgVertex | undefined;
        getDfgVertex(
            vertexId: NodeId | undefined,
        ): DataflowGraphVertexArgument | undefined;
        getVariableOrigins(nodeId: NodeId): readonly NodeId[];
    }

    Type Parameters

    • Domain extends StateDomain

      Type of the state abstract domain the semantics are defined for

    Index
    ast: Pick<NormalizedAst, "idMap">

    The normalized AST of the analyzed program (the control flow visitor only requires its id map)

    The control flow graph of the analyzed program

    The current flowR analyzer context (e.g. for accessing the configuration or loaded files)

    The dataflow graph of the analyzed program

    The value abstract domain the semantics are defined for (e.g. to create Top or Bottom values)

    • Gets the abstract state inferred at the location of an AST node.

      Parameters

      • nodeId: NodeId | undefined

        The ID of the node to get the abstract state at

      Returns Domain | undefined

      The abstract state at the node, or undefined if the node has no abstract state (i.e. the node has not been visited or is unreachable)

    • Resolves the abstract value inferred for an AST node, by following symbols to their variable origins, arguments to their values, expression lists to their last expression, and pipes and if expressions to their results.

      Parameters

      • node: NodeId | RNodeWithParent | undefined

        The node (or ID of the node) to get the inferred abstract value for

      • Optionalstate: Domain

        An optional abstract state used to resolve the inferred value (defaults to the state at the requested node)

      Returns ValueDomain<Domain> | undefined

      The inferred abstract value of the node, or undefined if no value was inferred for the node