engine_t Derived Type

type, public :: engine_t


Components

Type Visibility Attributes Name Initial
type(state_t), public, allocatable :: states(:)
integer, public :: build_error_stat = 0
character(len=:), public, allocatable :: build_error_msg
character(len=:), public, allocatable :: last_message

Last info/prompt string written to the output channel

character(len=:), public, allocatable :: last_error

Last error string written to the error channel


Type-Bound Procedures

procedure, public :: add_state => add_state_engine

Add a concrete or abstract state

  • interface

    Add a concrete state (has a prompt) or abstract state (mix-in, no prompt). Add a command edge to state. Build an integer arg_spec_t. Build a real arg_spec_t. Build a character arg_spec_t. Build a rest arg_spec_t (verbatim remainder of the line; must be last). Return n copies of an integer spec (fixed-size tuple, e.g. a 2D point). Return n copies of a real spec. Successful result, optionally carrying a DoGoto context string. Error result, optionally with a message written to the error channel. Merge all commands from abstract state included into state. The state's own commands override included ones with the same spec. Register a hook called after every successful transition into state. Validate the graph and set the initial state. Sets stat non-zero if a cycle is detected in goto/do_goto edges or if any state reference is unresolved. Run an interactive loop reading from the configured input stream. Execute commands from path, stopping at the first error. Returns .true. if the file ran to completion (or ended with quit). Rewind to the initial state without rebuilding the graph. Clears the stack, contexts, last_message, and last_error. Redirect I/O channels. Pass QUIET_UNIT to suppress a channel. Default: stdin / stdout / stderr. Dispatch one line of input. Performs prefix matching, arg validation, and edge traversal. Name of the active state. Context of the active state. Returns .false. after Quit or stack exhausted. Commands visible in the current state (own + included, help/? excluded). Result depends only on the state name; safe to cache keyed by state name. State names on the stack, bottom-first.

    private module subroutine add_state_engine(this, name, prompt, stat, errmsg)

    Arguments

    Type IntentOptional Attributes Name
    class(engine_t), intent(inout) :: this
    character(len=*), intent(in) :: name

    Unique state identifier

    character(len=*), intent(in), optional :: prompt

    Displayed before each input line; omit for an abstract state

    integer, intent(out), optional :: stat
    character(len=:), intent(out), optional, allocatable :: errmsg

procedure, public :: add_command => add_command_engine

Add a command edge to a state

  • interface

    Add a concrete state (has a prompt) or abstract state (mix-in, no prompt). Add a command edge to state. Build an integer arg_spec_t. Build a real arg_spec_t. Build a character arg_spec_t. Build a rest arg_spec_t (verbatim remainder of the line; must be last). Return n copies of an integer spec (fixed-size tuple, e.g. a 2D point). Return n copies of a real spec. Successful result, optionally carrying a DoGoto context string. Error result, optionally with a message written to the error channel. Merge all commands from abstract state included into state. The state's own commands override included ones with the same spec. Register a hook called after every successful transition into state. Validate the graph and set the initial state. Sets stat non-zero if a cycle is detected in goto/do_goto edges or if any state reference is unresolved. Run an interactive loop reading from the configured input stream. Execute commands from path, stopping at the first error. Returns .true. if the file ran to completion (or ended with quit). Rewind to the initial state without rebuilding the graph. Clears the stack, contexts, last_message, and last_error. Redirect I/O channels. Pass QUIET_UNIT to suppress a channel. Default: stdin / stdout / stderr. Dispatch one line of input. Performs prefix matching, arg validation, and edge traversal. Name of the active state. Context of the active state. Returns .false. after Quit or stack exhausted. Commands visible in the current state (own + included, help/? excluded). Result depends only on the state name; safe to cache keyed by state name. State names on the stack, bottom-first.

    private module subroutine add_command_engine(this, state, spec, kind, target, proc, help, args, stat, errmsg)

    Arguments

    Type IntentOptional Attributes Name
    class(engine_t), intent(inout) :: this
    character(len=*), intent(in) :: state

    Owning state name

    character(len=*), intent(in) :: spec

    Command spec, e.g. p(airs) — required prefix + optional suffix

    integer, intent(in) :: kind

    Edge behaviour (EDGE_* constant)

    character(len=*), intent(in), optional :: target

    Destination state (Goto / DoGoto)

    procedure(action_fun), optional :: proc

    Action / gate proc (Action, DoGoto, DoPop)

    character(len=*), intent(in), optional :: help

    Shown by built-in help command

    type(arg_spec_t), intent(in), optional :: args(:)

    Validated before proc is called

    integer, intent(out), optional :: stat
    character(len=:), intent(out), optional, allocatable :: errmsg

procedure, public :: add_include => add_include_engine

Merge commands from an abstract state

  • interface

    Add a concrete state (has a prompt) or abstract state (mix-in, no prompt). Add a command edge to state. Build an integer arg_spec_t. Build a real arg_spec_t. Build a character arg_spec_t. Build a rest arg_spec_t (verbatim remainder of the line; must be last). Return n copies of an integer spec (fixed-size tuple, e.g. a 2D point). Return n copies of a real spec. Successful result, optionally carrying a DoGoto context string. Error result, optionally with a message written to the error channel. Merge all commands from abstract state included into state. The state's own commands override included ones with the same spec. Register a hook called after every successful transition into state. Validate the graph and set the initial state. Sets stat non-zero if a cycle is detected in goto/do_goto edges or if any state reference is unresolved. Run an interactive loop reading from the configured input stream. Execute commands from path, stopping at the first error. Returns .true. if the file ran to completion (or ended with quit). Rewind to the initial state without rebuilding the graph. Clears the stack, contexts, last_message, and last_error. Redirect I/O channels. Pass QUIET_UNIT to suppress a channel. Default: stdin / stdout / stderr. Dispatch one line of input. Performs prefix matching, arg validation, and edge traversal. Name of the active state. Context of the active state. Returns .false. after Quit or stack exhausted. Commands visible in the current state (own + included, help/? excluded). Result depends only on the state name; safe to cache keyed by state name. State names on the stack, bottom-first.

    private module subroutine add_include_engine(this, state, included, stat, errmsg)

    Arguments

    Type IntentOptional Attributes Name
    class(engine_t), intent(inout) :: this
    character(len=*), intent(in) :: state
    character(len=*), intent(in) :: included
    integer, intent(out), optional :: stat
    character(len=:), intent(out), optional, allocatable :: errmsg

procedure, public :: set_on_enter => set_on_enter_engine

Register a post-transition hook

  • interface

    Add a concrete state (has a prompt) or abstract state (mix-in, no prompt). Add a command edge to state. Build an integer arg_spec_t. Build a real arg_spec_t. Build a character arg_spec_t. Build a rest arg_spec_t (verbatim remainder of the line; must be last). Return n copies of an integer spec (fixed-size tuple, e.g. a 2D point). Return n copies of a real spec. Successful result, optionally carrying a DoGoto context string. Error result, optionally with a message written to the error channel. Merge all commands from abstract state included into state. The state's own commands override included ones with the same spec. Register a hook called after every successful transition into state. Validate the graph and set the initial state. Sets stat non-zero if a cycle is detected in goto/do_goto edges or if any state reference is unresolved. Run an interactive loop reading from the configured input stream. Execute commands from path, stopping at the first error. Returns .true. if the file ran to completion (or ended with quit). Rewind to the initial state without rebuilding the graph. Clears the stack, contexts, last_message, and last_error. Redirect I/O channels. Pass QUIET_UNIT to suppress a channel. Default: stdin / stdout / stderr. Dispatch one line of input. Performs prefix matching, arg validation, and edge traversal. Name of the active state. Context of the active state. Returns .false. after Quit or stack exhausted. Commands visible in the current state (own + included, help/? excluded). Result depends only on the state name; safe to cache keyed by state name. State names on the stack, bottom-first.

    private module subroutine set_on_enter_engine(this, state, proc, stat, errmsg)

    Arguments

    Type IntentOptional Attributes Name
    class(engine_t), intent(inout) :: this
    character(len=*), intent(in) :: state
    procedure(on_enter_fun) :: proc
    integer, intent(out), optional :: stat
    character(len=:), intent(out), optional, allocatable :: errmsg

procedure, public :: finalize => finalize_engine

Validate the graph and set initial state

  • interface

    Add a concrete state (has a prompt) or abstract state (mix-in, no prompt). Add a command edge to state. Build an integer arg_spec_t. Build a real arg_spec_t. Build a character arg_spec_t. Build a rest arg_spec_t (verbatim remainder of the line; must be last). Return n copies of an integer spec (fixed-size tuple, e.g. a 2D point). Return n copies of a real spec. Successful result, optionally carrying a DoGoto context string. Error result, optionally with a message written to the error channel. Merge all commands from abstract state included into state. The state's own commands override included ones with the same spec. Register a hook called after every successful transition into state. Validate the graph and set the initial state. Sets stat non-zero if a cycle is detected in goto/do_goto edges or if any state reference is unresolved. Run an interactive loop reading from the configured input stream. Execute commands from path, stopping at the first error. Returns .true. if the file ran to completion (or ended with quit). Rewind to the initial state without rebuilding the graph. Clears the stack, contexts, last_message, and last_error. Redirect I/O channels. Pass QUIET_UNIT to suppress a channel. Default: stdin / stdout / stderr. Dispatch one line of input. Performs prefix matching, arg validation, and edge traversal. Name of the active state. Context of the active state. Returns .false. after Quit or stack exhausted. Commands visible in the current state (own + included, help/? excluded). Result depends only on the state name; safe to cache keyed by state name. State names on the stack, bottom-first.

    private module subroutine finalize_engine(this, initial, stat, errmsg)

    Arguments

    Type IntentOptional Attributes Name
    class(engine_t), intent(inout) :: this
    character(len=*), intent(in) :: initial

    Name of the starting state

    integer, intent(out), optional :: stat
    character(len=:), intent(out), optional, allocatable :: errmsg

procedure, public :: run => run_engine

Run an interactive loop on the configured input stream

  • interface

    Add a concrete state (has a prompt) or abstract state (mix-in, no prompt). Add a command edge to state. Build an integer arg_spec_t. Build a real arg_spec_t. Build a character arg_spec_t. Build a rest arg_spec_t (verbatim remainder of the line; must be last). Return n copies of an integer spec (fixed-size tuple, e.g. a 2D point). Return n copies of a real spec. Successful result, optionally carrying a DoGoto context string. Error result, optionally with a message written to the error channel. Merge all commands from abstract state included into state. The state's own commands override included ones with the same spec. Register a hook called after every successful transition into state. Validate the graph and set the initial state. Sets stat non-zero if a cycle is detected in goto/do_goto edges or if any state reference is unresolved. Run an interactive loop reading from the configured input stream. Execute commands from path, stopping at the first error. Returns .true. if the file ran to completion (or ended with quit). Rewind to the initial state without rebuilding the graph. Clears the stack, contexts, last_message, and last_error. Redirect I/O channels. Pass QUIET_UNIT to suppress a channel. Default: stdin / stdout / stderr. Dispatch one line of input. Performs prefix matching, arg validation, and edge traversal. Name of the active state. Context of the active state. Returns .false. after Quit or stack exhausted. Commands visible in the current state (own + included, help/? excluded). Result depends only on the state name; safe to cache keyed by state name. State names on the stack, bottom-first.

    private module subroutine run_engine(this)

    Arguments

    Type IntentOptional Attributes Name
    class(engine_t), intent(inout) :: this

procedure, public :: run_file => run_file_engine

Execute commands from a file, stopping at first error

  • interface

    Add a concrete state (has a prompt) or abstract state (mix-in, no prompt). Add a command edge to state. Build an integer arg_spec_t. Build a real arg_spec_t. Build a character arg_spec_t. Build a rest arg_spec_t (verbatim remainder of the line; must be last). Return n copies of an integer spec (fixed-size tuple, e.g. a 2D point). Return n copies of a real spec. Successful result, optionally carrying a DoGoto context string. Error result, optionally with a message written to the error channel. Merge all commands from abstract state included into state. The state's own commands override included ones with the same spec. Register a hook called after every successful transition into state. Validate the graph and set the initial state. Sets stat non-zero if a cycle is detected in goto/do_goto edges or if any state reference is unresolved. Run an interactive loop reading from the configured input stream. Execute commands from path, stopping at the first error. Returns .true. if the file ran to completion (or ended with quit). Rewind to the initial state without rebuilding the graph. Clears the stack, contexts, last_message, and last_error. Redirect I/O channels. Pass QUIET_UNIT to suppress a channel. Default: stdin / stdout / stderr. Dispatch one line of input. Performs prefix matching, arg validation, and edge traversal. Name of the active state. Context of the active state. Returns .false. after Quit or stack exhausted. Commands visible in the current state (own + included, help/? excluded). Result depends only on the state name; safe to cache keyed by state name. State names on the stack, bottom-first.

    private module function run_file_engine(this, path, echo, stat, errmsg, line) result(ok)

    Arguments

    Type IntentOptional Attributes Name
    class(engine_t), intent(inout) :: this
    character(len=*), intent(in) :: path
    logical, intent(in), optional :: echo

    If .true., print each prompt+line as it is read

    integer, intent(out), optional :: stat

    RC of the failing dispatch, or RC_OK

    character(len=:), intent(out), optional, allocatable :: errmsg
    integer, intent(out), optional :: line

    1-based line number of the failure

    Return Value logical

procedure, public :: reset => reset_engine

Rewind to initial state without rebuilding the graph

  • interface

    Add a concrete state (has a prompt) or abstract state (mix-in, no prompt). Add a command edge to state. Build an integer arg_spec_t. Build a real arg_spec_t. Build a character arg_spec_t. Build a rest arg_spec_t (verbatim remainder of the line; must be last). Return n copies of an integer spec (fixed-size tuple, e.g. a 2D point). Return n copies of a real spec. Successful result, optionally carrying a DoGoto context string. Error result, optionally with a message written to the error channel. Merge all commands from abstract state included into state. The state's own commands override included ones with the same spec. Register a hook called after every successful transition into state. Validate the graph and set the initial state. Sets stat non-zero if a cycle is detected in goto/do_goto edges or if any state reference is unresolved. Run an interactive loop reading from the configured input stream. Execute commands from path, stopping at the first error. Returns .true. if the file ran to completion (or ended with quit). Rewind to the initial state without rebuilding the graph. Clears the stack, contexts, last_message, and last_error. Redirect I/O channels. Pass QUIET_UNIT to suppress a channel. Default: stdin / stdout / stderr. Dispatch one line of input. Performs prefix matching, arg validation, and edge traversal. Name of the active state. Context of the active state. Returns .false. after Quit or stack exhausted. Commands visible in the current state (own + included, help/? excluded). Result depends only on the state name; safe to cache keyed by state name. State names on the stack, bottom-first.

    private module subroutine reset_engine(this, stat, errmsg)

    Arguments

    Type IntentOptional Attributes Name
    class(engine_t), intent(inout) :: this
    integer, intent(out), optional :: stat
    character(len=:), intent(out), optional, allocatable :: errmsg

procedure, public :: dispatch => dispatch_engine

Dispatch one line of input

  • interface

    Add a concrete state (has a prompt) or abstract state (mix-in, no prompt). Add a command edge to state. Build an integer arg_spec_t. Build a real arg_spec_t. Build a character arg_spec_t. Build a rest arg_spec_t (verbatim remainder of the line; must be last). Return n copies of an integer spec (fixed-size tuple, e.g. a 2D point). Return n copies of a real spec. Successful result, optionally carrying a DoGoto context string. Error result, optionally with a message written to the error channel. Merge all commands from abstract state included into state. The state's own commands override included ones with the same spec. Register a hook called after every successful transition into state. Validate the graph and set the initial state. Sets stat non-zero if a cycle is detected in goto/do_goto edges or if any state reference is unresolved. Run an interactive loop reading from the configured input stream. Execute commands from path, stopping at the first error. Returns .true. if the file ran to completion (or ended with quit). Rewind to the initial state without rebuilding the graph. Clears the stack, contexts, last_message, and last_error. Redirect I/O channels. Pass QUIET_UNIT to suppress a channel. Default: stdin / stdout / stderr. Dispatch one line of input. Performs prefix matching, arg validation, and edge traversal. Name of the active state. Context of the active state. Returns .false. after Quit or stack exhausted. Commands visible in the current state (own + included, help/? excluded). Result depends only on the state name; safe to cache keyed by state name. State names on the stack, bottom-first.

    private module function dispatch_engine(this, line) result(rc)

    Arguments

    Type IntentOptional Attributes Name
    class(engine_t), intent(inout) :: this
    character(len=*), intent(in) :: line

    Return Value integer

procedure, public :: set_io_units => set_io_units_engine

Redirect I/O channels; pass QUIET_UNIT to suppress

  • interface

    Add a concrete state (has a prompt) or abstract state (mix-in, no prompt). Add a command edge to state. Build an integer arg_spec_t. Build a real arg_spec_t. Build a character arg_spec_t. Build a rest arg_spec_t (verbatim remainder of the line; must be last). Return n copies of an integer spec (fixed-size tuple, e.g. a 2D point). Return n copies of a real spec. Successful result, optionally carrying a DoGoto context string. Error result, optionally with a message written to the error channel. Merge all commands from abstract state included into state. The state's own commands override included ones with the same spec. Register a hook called after every successful transition into state. Validate the graph and set the initial state. Sets stat non-zero if a cycle is detected in goto/do_goto edges or if any state reference is unresolved. Run an interactive loop reading from the configured input stream. Execute commands from path, stopping at the first error. Returns .true. if the file ran to completion (or ended with quit). Rewind to the initial state without rebuilding the graph. Clears the stack, contexts, last_message, and last_error. Redirect I/O channels. Pass QUIET_UNIT to suppress a channel. Default: stdin / stdout / stderr. Dispatch one line of input. Performs prefix matching, arg validation, and edge traversal. Name of the active state. Context of the active state. Returns .false. after Quit or stack exhausted. Commands visible in the current state (own + included, help/? excluded). Result depends only on the state name; safe to cache keyed by state name. State names on the stack, bottom-first.

    private module subroutine set_io_units_engine(this, input_unit, output_unit, error_unit)

    Arguments

    Type IntentOptional Attributes Name
    class(engine_t), intent(inout) :: this
    integer, intent(in), optional :: input_unit
    integer, intent(in), optional :: output_unit
    integer, intent(in), optional :: error_unit

procedure, public :: current_state => current_state_engine

Name of the active state

  • interface

    Add a concrete state (has a prompt) or abstract state (mix-in, no prompt). Add a command edge to state. Build an integer arg_spec_t. Build a real arg_spec_t. Build a character arg_spec_t. Build a rest arg_spec_t (verbatim remainder of the line; must be last). Return n copies of an integer spec (fixed-size tuple, e.g. a 2D point). Return n copies of a real spec. Successful result, optionally carrying a DoGoto context string. Error result, optionally with a message written to the error channel. Merge all commands from abstract state included into state. The state's own commands override included ones with the same spec. Register a hook called after every successful transition into state. Validate the graph and set the initial state. Sets stat non-zero if a cycle is detected in goto/do_goto edges or if any state reference is unresolved. Run an interactive loop reading from the configured input stream. Execute commands from path, stopping at the first error. Returns .true. if the file ran to completion (or ended with quit). Rewind to the initial state without rebuilding the graph. Clears the stack, contexts, last_message, and last_error. Redirect I/O channels. Pass QUIET_UNIT to suppress a channel. Default: stdin / stdout / stderr. Dispatch one line of input. Performs prefix matching, arg validation, and edge traversal. Name of the active state. Context of the active state. Returns .false. after Quit or stack exhausted. Commands visible in the current state (own + included, help/? excluded). Result depends only on the state name; safe to cache keyed by state name. State names on the stack, bottom-first.

    private module function current_state_engine(this) result(name)

    Arguments

    Type IntentOptional Attributes Name
    class(engine_t), intent(in) :: this

    Return Value character(len=:), allocatable

procedure, public :: current_context => current_context_engine

Context of the active state

  • interface

    Add a concrete state (has a prompt) or abstract state (mix-in, no prompt). Add a command edge to state. Build an integer arg_spec_t. Build a real arg_spec_t. Build a character arg_spec_t. Build a rest arg_spec_t (verbatim remainder of the line; must be last). Return n copies of an integer spec (fixed-size tuple, e.g. a 2D point). Return n copies of a real spec. Successful result, optionally carrying a DoGoto context string. Error result, optionally with a message written to the error channel. Merge all commands from abstract state included into state. The state's own commands override included ones with the same spec. Register a hook called after every successful transition into state. Validate the graph and set the initial state. Sets stat non-zero if a cycle is detected in goto/do_goto edges or if any state reference is unresolved. Run an interactive loop reading from the configured input stream. Execute commands from path, stopping at the first error. Returns .true. if the file ran to completion (or ended with quit). Rewind to the initial state without rebuilding the graph. Clears the stack, contexts, last_message, and last_error. Redirect I/O channels. Pass QUIET_UNIT to suppress a channel. Default: stdin / stdout / stderr. Dispatch one line of input. Performs prefix matching, arg validation, and edge traversal. Name of the active state. Context of the active state. Returns .false. after Quit or stack exhausted. Commands visible in the current state (own + included, help/? excluded). Result depends only on the state name; safe to cache keyed by state name. State names on the stack, bottom-first.

    private module function current_context_engine(this) result(ctx)

    Arguments

    Type IntentOptional Attributes Name
    class(engine_t), intent(in) :: this

    Return Value character(len=:), allocatable

procedure, public :: is_running => is_running_engine

False after Quit or stack exhausted

  • interface

    Add a concrete state (has a prompt) or abstract state (mix-in, no prompt). Add a command edge to state. Build an integer arg_spec_t. Build a real arg_spec_t. Build a character arg_spec_t. Build a rest arg_spec_t (verbatim remainder of the line; must be last). Return n copies of an integer spec (fixed-size tuple, e.g. a 2D point). Return n copies of a real spec. Successful result, optionally carrying a DoGoto context string. Error result, optionally with a message written to the error channel. Merge all commands from abstract state included into state. The state's own commands override included ones with the same spec. Register a hook called after every successful transition into state. Validate the graph and set the initial state. Sets stat non-zero if a cycle is detected in goto/do_goto edges or if any state reference is unresolved. Run an interactive loop reading from the configured input stream. Execute commands from path, stopping at the first error. Returns .true. if the file ran to completion (or ended with quit). Rewind to the initial state without rebuilding the graph. Clears the stack, contexts, last_message, and last_error. Redirect I/O channels. Pass QUIET_UNIT to suppress a channel. Default: stdin / stdout / stderr. Dispatch one line of input. Performs prefix matching, arg validation, and edge traversal. Name of the active state. Context of the active state. Returns .false. after Quit or stack exhausted. Commands visible in the current state (own + included, help/? excluded). Result depends only on the state name; safe to cache keyed by state name. State names on the stack, bottom-first.

    private module function is_running_engine(this) result(b)

    Arguments

    Type IntentOptional Attributes Name
    class(engine_t), intent(in) :: this

    Return Value logical

procedure, public :: available_commands => available_commands_engine

Commands visible in the current state

  • interface

    Add a concrete state (has a prompt) or abstract state (mix-in, no prompt). Add a command edge to state. Build an integer arg_spec_t. Build a real arg_spec_t. Build a character arg_spec_t. Build a rest arg_spec_t (verbatim remainder of the line; must be last). Return n copies of an integer spec (fixed-size tuple, e.g. a 2D point). Return n copies of a real spec. Successful result, optionally carrying a DoGoto context string. Error result, optionally with a message written to the error channel. Merge all commands from abstract state included into state. The state's own commands override included ones with the same spec. Register a hook called after every successful transition into state. Validate the graph and set the initial state. Sets stat non-zero if a cycle is detected in goto/do_goto edges or if any state reference is unresolved. Run an interactive loop reading from the configured input stream. Execute commands from path, stopping at the first error. Returns .true. if the file ran to completion (or ended with quit). Rewind to the initial state without rebuilding the graph. Clears the stack, contexts, last_message, and last_error. Redirect I/O channels. Pass QUIET_UNIT to suppress a channel. Default: stdin / stdout / stderr. Dispatch one line of input. Performs prefix matching, arg validation, and edge traversal. Name of the active state. Context of the active state. Returns .false. after Quit or stack exhausted. Commands visible in the current state (own + included, help/? excluded). Result depends only on the state name; safe to cache keyed by state name. State names on the stack, bottom-first.

    private module function available_commands_engine(this) result(cmds)

    Arguments

    Type IntentOptional Attributes Name
    class(engine_t), intent(in) :: this

    Return Value type(command_info_t), allocatable, (:)

procedure, public :: state_path => state_path_engine

State names on the stack, bottom-first

  • interface

    Add a concrete state (has a prompt) or abstract state (mix-in, no prompt). Add a command edge to state. Build an integer arg_spec_t. Build a real arg_spec_t. Build a character arg_spec_t. Build a rest arg_spec_t (verbatim remainder of the line; must be last). Return n copies of an integer spec (fixed-size tuple, e.g. a 2D point). Return n copies of a real spec. Successful result, optionally carrying a DoGoto context string. Error result, optionally with a message written to the error channel. Merge all commands from abstract state included into state. The state's own commands override included ones with the same spec. Register a hook called after every successful transition into state. Validate the graph and set the initial state. Sets stat non-zero if a cycle is detected in goto/do_goto edges or if any state reference is unresolved. Run an interactive loop reading from the configured input stream. Execute commands from path, stopping at the first error. Returns .true. if the file ran to completion (or ended with quit). Rewind to the initial state without rebuilding the graph. Clears the stack, contexts, last_message, and last_error. Redirect I/O channels. Pass QUIET_UNIT to suppress a channel. Default: stdin / stdout / stderr. Dispatch one line of input. Performs prefix matching, arg validation, and edge traversal. Name of the active state. Context of the active state. Returns .false. after Quit or stack exhausted. Commands visible in the current state (own + included, help/? excluded). Result depends only on the state name; safe to cache keyed by state name. State names on the stack, bottom-first.

    private module function state_path_engine(this) result(names)

    Arguments

    Type IntentOptional Attributes Name
    class(engine_t), intent(in) :: this

    Return Value character(len=:), allocatable, (:)