Statifier.Parser.SCXML.StateStack (statifier v1.9.0)

View Source

Manages the parsing state stack for hierarchical SCXML document construction.

This module handles adding and removing elements from the parsing stack, and updating parent elements when child elements are completed.

Summary

Functions

Handle the end of an assign element by adding it to the parent onentry/onexit block.

Handle text content for elements that support it (like <content> and <data>).

Handle the end of a content element (child of send).

Handle the end of a data element by adding it to the document's datamodel.

Handle the end of a datamodel element by simply popping it from the stack.

Handle the end of an else element by adding it to the if container as final block.

Handle the end of an elseif element by adding it to the if container and switching blocks.

Handle the end of a foreach element by creating a ForeachAction from collected actions.

Handle the end of an if element by creating an IfAction from collected conditional blocks.

Handle the end of an invoke element by adding it to its parent context.

Handle the end of a log element by adding it to the parent onentry/onexit block.

Handle the end of an onentry element by moving collected actions to parent state.

Handle the end of an onexit element by moving collected actions to parent state.

Handle the end of a param element (child of send or invoke).

Handle the end of a raise element by adding it to the parent onentry/onexit block.

Handle the end of a send element.

Handle the end of a state element by adding it to its parent.

Handle the end of a transition element by adding it to its parent state.

Peek at the type of the top element on the stack without modifying the stack. Returns nil if stack is empty.

Pop an element from the parsing stack.

Push an element onto the parsing stack.

Functions

handle_assign_end(state)

@spec handle_assign_end(map()) :: {:ok, map()}

Handle the end of an assign element by adding it to the parent onentry/onexit block.

handle_characters(character_data, state)

@spec handle_characters(String.t(), map()) :: {:ok, map()} | :not_handled

Handle text content for elements that support it (like <content> and <data>).

handle_content_end(state)

@spec handle_content_end(map()) :: {:ok, map()}

Handle the end of a content element (child of send).

handle_data_end(state)

@spec handle_data_end(map()) :: {:ok, map()}

Handle the end of a data element by adding it to the document's datamodel.

handle_datamodel_end(state)

@spec handle_datamodel_end(map()) :: {:ok, map()}

Handle the end of a datamodel element by simply popping it from the stack.

handle_else_end(state)

@spec handle_else_end(map()) :: {:ok, map()}

Handle the end of an else element by adding it to the if container as final block.

handle_elseif_end(state)

@spec handle_elseif_end(map()) :: {:ok, map()}

Handle the end of an elseif element by adding it to the if container and switching blocks.

handle_foreach_end(state)

@spec handle_foreach_end(map()) :: {:ok, map()}

Handle the end of a foreach element by creating a ForeachAction from collected actions.

handle_if_end(state)

@spec handle_if_end(map()) :: {:ok, map()}

Handle the end of an if element by creating an IfAction from collected conditional blocks.

handle_invoke_end(state)

@spec handle_invoke_end(map()) :: {:ok, map()}

Handle the end of an invoke element by adding it to its parent context.

handle_log_end(state)

@spec handle_log_end(map()) :: {:ok, map()}

Handle the end of a log element by adding it to the parent onentry/onexit block.

handle_onentry_end(state)

@spec handle_onentry_end(map()) :: {:ok, map()}

Handle the end of an onentry element by moving collected actions to parent state.

handle_onexit_end(state)

@spec handle_onexit_end(map()) :: {:ok, map()}

Handle the end of an onexit element by moving collected actions to parent state.

handle_param_end(state)

@spec handle_param_end(map()) :: {:ok, map()}

Handle the end of a param element (child of send or invoke).

handle_raise_end(state)

@spec handle_raise_end(map()) :: {:ok, map()}

Handle the end of a raise element by adding it to the parent onentry/onexit block.

handle_send_end(state)

@spec handle_send_end(map()) :: {:ok, map()}

Handle the end of a send element.

handle_state_end(state)

@spec handle_state_end(map()) :: {:ok, map()}

Handle the end of a state element by adding it to its parent.

handle_transition_end(state)

@spec handle_transition_end(map()) :: {:ok, map()}

Handle the end of a transition element by adding it to its parent state.

peek_element_type(map)

@spec peek_element_type(map()) :: String.t() | nil

Peek at the type of the top element on the stack without modifying the stack. Returns nil if stack is empty.

pop_element(state)

@spec pop_element(map()) :: map()

Pop an element from the parsing stack.

push_element(state, element_name, element_data)

@spec push_element(map(), String.t(), any()) :: map()

Push an element onto the parsing stack.