Reach.OTP.GenStatem (Reach v2.6.1)

Copy Markdown View Source

Extracts gen_statem states, transitions, and event handlers from module IR.

Summary

Functions

Extracts gen_statem state machine information from module IR nodes.

Detects gen_statem from @behaviour :gen_statem or callback_mode/0.

Functions

analyze(ir_nodes)

@spec analyze([Reach.IR.Node.t()]) :: map() | nil

Extracts gen_statem state machine information from module IR nodes.

Returns a map with :callback_mode, :init_state, :states, and :transitions. Each state has its event handlers. Each transition has source, target, event type, and the function node that triggers it.

detect?(all_nodes)

Detects gen_statem from @behaviour :gen_statem or callback_mode/0.