diff --git a/docs/assets/TCP IP.png b/docs/assets/TCP IP.png deleted file mode 100644 index 93eed8f4..00000000 Binary files a/docs/assets/TCP IP.png and /dev/null differ diff --git a/docs/assets/atm quick start tutorial/0_EmptyWaiting.png b/docs/assets/atm quick start tutorial/0_EmptyWaiting.png deleted file mode 100644 index ada6d7a1..00000000 Binary files a/docs/assets/atm quick start tutorial/0_EmptyWaiting.png and /dev/null differ diff --git a/docs/assets/atm quick start tutorial/1_EjectCard.png b/docs/assets/atm quick start tutorial/1_EjectCard.png deleted file mode 100644 index b939aff7..00000000 Binary files a/docs/assets/atm quick start tutorial/1_EjectCard.png and /dev/null differ diff --git a/docs/assets/atm quick start tutorial/2_InsertCard.png b/docs/assets/atm quick start tutorial/2_InsertCard.png deleted file mode 100644 index 4a868614..00000000 Binary files a/docs/assets/atm quick start tutorial/2_InsertCard.png and /dev/null differ diff --git a/docs/assets/atm quick start tutorial/3_ReturnCard.png b/docs/assets/atm quick start tutorial/3_ReturnCard.png deleted file mode 100644 index cbc76718..00000000 Binary files a/docs/assets/atm quick start tutorial/3_ReturnCard.png and /dev/null differ diff --git a/docs/assets/atm quick start tutorial/4_WrongPin.png b/docs/assets/atm quick start tutorial/4_WrongPin.png deleted file mode 100644 index f9d0f0bd..00000000 Binary files a/docs/assets/atm quick start tutorial/4_WrongPin.png and /dev/null differ diff --git a/docs/assets/atm quick start tutorial/5_RightPin.png b/docs/assets/atm quick start tutorial/5_RightPin.png deleted file mode 100644 index d22d4bb8..00000000 Binary files a/docs/assets/atm quick start tutorial/5_RightPin.png and /dev/null differ diff --git a/docs/assets/atm quick start tutorial/6_CanCheckBalance.png b/docs/assets/atm quick start tutorial/6_CanCheckBalance.png deleted file mode 100644 index b0b68022..00000000 Binary files a/docs/assets/atm quick start tutorial/6_CanCheckBalance.png and /dev/null differ diff --git a/docs/assets/atm quick start tutorial/7_CanDepositMoney.png b/docs/assets/atm quick start tutorial/7_CanDepositMoney.png deleted file mode 100644 index 1c1f3154..00000000 Binary files a/docs/assets/atm quick start tutorial/7_CanDepositMoney.png and /dev/null differ diff --git a/docs/assets/atm quick start tutorial/8_CanWithdrawMoney.png b/docs/assets/atm quick start tutorial/8_CanWithdrawMoney.png deleted file mode 100644 index d22bf283..00000000 Binary files a/docs/assets/atm quick start tutorial/8_CanWithdrawMoney.png and /dev/null differ diff --git a/docs/assets/atm quick start tutorial/ncsu atm diagram.gif b/docs/assets/atm quick start tutorial/ncsu atm diagram.gif deleted file mode 100644 index cd8e6e7d..00000000 Binary files a/docs/assets/atm quick start tutorial/ncsu atm diagram.gif and /dev/null differ diff --git a/docs/assets/bgp.png b/docs/assets/bgp.png deleted file mode 100644 index 8bac81aa..00000000 Binary files a/docs/assets/bgp.png and /dev/null differ diff --git a/docs/assets/compile time claim.png b/docs/assets/compile time claim.png deleted file mode 100644 index 5364724f..00000000 Binary files a/docs/assets/compile time claim.png and /dev/null differ diff --git a/docs/assets/doc light styled.png b/docs/assets/doc light styled.png deleted file mode 100644 index 7bf17bf6..00000000 Binary files a/docs/assets/doc light styled.png and /dev/null differ diff --git a/docs/assets/doc light unstyled.png b/docs/assets/doc light unstyled.png deleted file mode 100644 index 263045b6..00000000 Binary files a/docs/assets/doc light unstyled.png and /dev/null differ diff --git a/docs/assets/eMMC transfer mode.png b/docs/assets/eMMC transfer mode.png deleted file mode 100644 index 50df963e..00000000 Binary files a/docs/assets/eMMC transfer mode.png and /dev/null differ diff --git a/docs/assets/editor.png b/docs/assets/editor.png deleted file mode 100644 index 0d10be68..00000000 Binary files a/docs/assets/editor.png and /dev/null differ diff --git a/docs/assets/http 1.0.png b/docs/assets/http 1.0.png deleted file mode 100644 index 72a1111c..00000000 Binary files a/docs/assets/http 1.0.png and /dev/null differ diff --git a/docs/assets/matter states heat cool.png b/docs/assets/matter states heat cool.png deleted file mode 100644 index da720c61..00000000 Binary files a/docs/assets/matter states heat cool.png and /dev/null differ diff --git a/docs/assets/performance 4.5.1 2015 mac.png b/docs/assets/performance 4.5.1 2015 mac.png deleted file mode 100644 index 7d690ccb..00000000 Binary files a/docs/assets/performance 4.5.1 2015 mac.png and /dev/null differ diff --git a/docs/assets/ryg proceed.png b/docs/assets/ryg proceed.png deleted file mode 100644 index 1e92ac76..00000000 Binary files a/docs/assets/ryg proceed.png and /dev/null differ diff --git a/docs/assets/ryg traffic light console screenshot.png b/docs/assets/ryg traffic light console screenshot.png deleted file mode 100644 index fcd82e98..00000000 Binary files a/docs/assets/ryg traffic light console screenshot.png and /dev/null differ diff --git a/docs/assets/ryg.png b/docs/assets/ryg.png deleted file mode 100644 index fad58c96..00000000 Binary files a/docs/assets/ryg.png and /dev/null differ diff --git a/docs/assets/sip.png b/docs/assets/sip.png deleted file mode 100644 index 0fae4687..00000000 Binary files a/docs/assets/sip.png and /dev/null differ diff --git a/docs/assets/speed claim.png b/docs/assets/speed claim.png deleted file mode 100644 index 8559162f..00000000 Binary files a/docs/assets/speed claim.png and /dev/null differ diff --git a/docs/assets/traffic light quick start tutorial/Off To From RGY.png b/docs/assets/traffic light quick start tutorial/Off To From RGY.png deleted file mode 100644 index 42cc7c8a..00000000 Binary files a/docs/assets/traffic light quick start tutorial/Off To From RGY.png and /dev/null differ diff --git a/docs/assets/traffic light quick start tutorial/Off To RGY.png b/docs/assets/traffic light quick start tutorial/Off To RGY.png deleted file mode 100644 index d6220a55..00000000 Binary files a/docs/assets/traffic light quick start tutorial/Off To RGY.png and /dev/null differ diff --git a/docs/assets/traffic light quick start tutorial/Off To Red.png b/docs/assets/traffic light quick start tutorial/Off To Red.png deleted file mode 100644 index 40911873..00000000 Binary files a/docs/assets/traffic light quick start tutorial/Off To Red.png and /dev/null differ diff --git a/docs/docs/classes/jssm.Machine.html b/docs/docs/classes/jssm.Machine.html index 6b54c3b0..acb2bcb6 100644 --- a/docs/docs/classes/jssm.Machine.html +++ b/docs/docs/classes/jssm.Machine.html @@ -1,4 +1,4 @@ -Machine | JSSM, a JavaScript state machine - the FSM for FSL
Options
All
  • Public
  • Public/Protected
  • All
Menu

Type Parameters

  • mDT

Hierarchy

  • Machine

Index

Constructors

Properties

Accessors

Methods

Constructors

Properties

_actions: Map<string, Map<string, number>>
_any_action_hook: HookHandler<mDT>
_any_transition_hook: HookHandler<mDT>
_arrange_declaration: string[][]
_arrange_end_declaration: string[][]
_arrange_start_declaration: string[][]
_data?: mDT
_dot_preamble: string
_edge_map: Map<string, Map<string, number>>
_edges: JssmTransition<mDT>[]
_entry_hooks: Map<string, HookHandler<mDT>>
_exit_hooks: Map<string, HookHandler<mDT>>
_forced_transition_hook: HookHandler<mDT>
_fsl_version?: string
_global_action_hooks: Map<string, HookHandler<mDT>>
_graph_layout: JssmLayout
_has_basic_hooks: boolean
_has_entry_hooks: boolean
_has_exit_hooks: boolean
_has_global_action_hooks: boolean
_has_hooks: boolean
_has_named_hooks: boolean
_has_post_basic_hooks: boolean
_has_post_entry_hooks: boolean
_has_post_exit_hooks: boolean
_has_post_global_action_hooks: boolean
_has_post_hooks: boolean
_has_post_named_hooks: boolean
_has_post_transition_hooks: boolean
_has_transition_hooks: boolean
_history: circular_buffer<[string, mDT]>
_history_length: number
_hooks: Map<string, HookHandler<mDT>>
_instance_name: string
_machine_author?: string[]
_machine_comment?: string
_machine_contributor?: string[]
_machine_definition?: string
_machine_language?: string
_machine_license?: string
_machine_name?: string
_machine_version?: string
_main_transition_hook: HookHandler<mDT>
_named_hooks: Map<string, HookHandler<mDT>>
_named_transitions: Map<string, number>
_post_any_action_hook: HookHandler<mDT>
_post_any_transition_hook: HookHandler<mDT>
_post_entry_hooks: Map<string, HookHandler<mDT>>
_post_exit_hooks: Map<string, HookHandler<mDT>>
_post_forced_transition_hook: HookHandler<mDT>
_post_global_action_hooks: Map<string, HookHandler<mDT>>
_post_hooks: Map<string, HookHandler<mDT>>
_post_main_transition_hook: HookHandler<mDT>
_post_named_hooks: Map<string, HookHandler<mDT>>
_post_standard_transition_hook: HookHandler<mDT>
_raw_state_declaration?: <internal>.Object[]
_reverse_action_targets: Map<string, Map<string, number>>
_reverse_actions: Map<string, Map<string, number>>
_standard_transition_hook: HookHandler<mDT>
_state: string
_state_declarations: Map<string, JssmStateDeclaration>
_states: Map<string, JssmGenericState>
_theme: FslTheme

Accessors

  • get history(): [string, mDT][]
  • actions(whichState?: string): string[]

Returns boolean

  • actions(whichState?: string): string[]
  • List all actions available from this state. Please note that the order of the actions is not guaranteed.

    import { sm } from 'jssm';

    const machine = sm`
    red 'next' -> green 'next' -> yellow 'next' -> red;
    [red yellow green] 'shutdown' ~> off 'start' -> red;
    `;

    console.log( machine.state() ); // logs 'red'
    console.log( machine.actions() ); // logs ['next', 'shutdown']

    machine.action('next'); // true
    console.log( machine.state() ); // logs 'green'
    console.log( machine.actions() ); // logs ['next', 'shutdown']

    machine.action('shutdown'); // true
    console.log( machine.state() ); // logs 'off'
    console.log( machine.actions() ); // logs ['start']

    machine.action('start'); // true
    console.log( machine.state() ); // logs 'red'
    console.log( machine.actions() ); // logs ['next', 'shutdown']

    Parameters

    • whichState: string = ...

      The state whose actions to have listed

      -

    Returns string[]

  • current_action_for(action: string): number
  • data(): mDT

Returns string[]

  • current_action_for(action: string): number
  • data(): mDT
  • Get the current data of a machine.

    import * as jssm from 'jssm';

    const switch = jssm.from('on <=> off;', {data: 1});
    console.log( switch.data() ); // 1
    -

    Returns mDT

  • dot_preamble(): string
  • force_transition(newState: string, newData?: mDT): boolean
  • dot_preamble(): string
  • force_transition(newState: string, newData?: mDT): boolean
  • Instruct the machine to complete a forced transition (which will reject if called with a normal transition call.)

    const light = sm`red -> green -> yellow -> red; [red yellow green] 'shutdown' ~> off 'start' -> red;`;

    light.state(); // 'red'
    light.transition('off'); // false
    light.state(); // 'red'
    light.force_transition('off'); // true
    light.state(); // 'off' @@ -59,43 +59,43 @@

    The state to switch to

  • Optional newData: mDT

    The data change to insert during the transition

    -

Returns boolean

  • fsl_version(): string
  • get_transition_by_state_names(from: string, to: string): number
  • graph_layout(): string
  • has_completes(): boolean
  • has_state(whichState: string): boolean

Returns boolean

  • fsl_version(): string
  • get_transition_by_state_names(from: string, to: string): number
  • graph_layout(): string
  • has_completes(): boolean
  • has_state(whichState: string): boolean
  • Check whether the machine knows a given state.

    import * as jssm from 'jssm';

    const switch = jssm.from('on <=> off;');

    console.log( switch.has_state('off') ); // true
    console.log( switch.has_state('dance') ); // false

    Parameters

    • whichState: string

      The state to be checked for extance

      -

    Returns boolean

  • has_terminals(): boolean
  • has_unenterables(): boolean
  • hook_action(from: string, to: string, action: string, handler: HookHandler<mDT>): Machine<mDT>
  • instance_name(): string
  • is_complete(): boolean
  • is_final(): boolean

Returns boolean

  • has_terminals(): boolean
  • has_unenterables(): boolean
  • hook_action(from: string, to: string, action: string, handler: HookHandler<mDT>): Machine<mDT>
  • instance_name(): string
  • is_complete(): boolean
  • is_final(): boolean
  • Check whether the current state is final (either has no exits or is marked complete.)

    import { sm, state_is_final } from 'jssm';

    const final_test = sm`first -> second;`;

    console.log( final_test.is_final() ); // false
    state.transition('second');
    console.log( final_test.is_final() ); // true
    -

    Returns boolean

  • is_terminal(): boolean
  • is_unenterable(whichState: string): boolean
  • list_actions(): string[]
  • is_terminal(): boolean
  • is_unenterable(whichState: string): boolean
  • list_actions(): string[]
  • Lists all edges of a machine.

    import { sm } from 'jssm';

    const lswitch = sm`on 'toggle' <=> 'toggle' off;`;

    lswitch.list_edges();
    [
    {
    from: 'on',
    to: 'off',
    kind: 'main',
    forced_only: false,
    main_path: true,
    action: 'toggle'
    },
    {
    from: 'off',
    to: 'on',
    kind: 'main',
    forced_only: false,
    main_path: true,
    action: 'toggle'
    }
    ]
    -

    Returns JssmTransition<mDT>[]

  • list_entrances(whichState?: string): string[]
  • list_entrances(whichState?: string): string[]
  • List all entrances attached to the current state. Please note that the order of the list is not defined.

    import { sm } from 'jssm';

    const light = sm`red 'next' -> green 'next' -> yellow 'next' -> red; [red yellow green] 'shutdown' ~> off 'start' -> red;`;

    light.state(); // 'red'
    light.list_entrances(); // [ 'yellow', 'off' ]

    Parameters

    • whichState: string = ...

      The state whose entrances to have listed

      -

    Returns string[]

  • list_exit_actions(whichState?: string): string[]
  • list_exits(whichState?: string): string[]

Returns string[]

  • list_exit_actions(whichState?: string): string[]
  • list_exits(whichState?: string): string[]
  • List all exits attached to the current state. Please note that the order of the list is not defined.

    import { sm } from 'jssm';

    const light = sm`red 'next' -> green 'next' -> yellow 'next' -> red; [red yellow green] 'shutdown' ~> off 'start' -> red;`;

    light.state(); // 'red'
    light.list_exits(); // [ 'green', 'off' ]

    Parameters

    • whichState: string = ...

      The state whose exits to have listed

      -

    Returns string[]

  • list_named_transitions(): Map<string, number>
  • list_states_having_action(whichState: string): string[]

Returns string[]

  • list_named_transitions(): Map<string, number>
  • list_states_having_action(whichState: string): string[]
  • List all states that have a specific action attached. Please note that the order of the states is not guaranteed.

    import { sm } from 'jssm';

    const machine = sm`
    red 'next' -> green 'next' -> yellow 'next' -> red;
    [red yellow green] 'shutdown' ~> off 'start' -> red;
    `;

    console.log( machine.list_states_having_action('next') ); // ['red', 'green', 'yellow']
    console.log( machine.list_states_having_action('start') ); // ['off']

    Parameters

    • whichState: string

      The action to be checked for associated states

      -

    Returns string[]

Returns string[]

  • List all transitions attached to the current state, sorted by entrance and exit. The order of each sublist is not defined. A node could appear in both lists.

    @@ -103,23 +103,23 @@

    Parameters

    • whichState: string = ...

      The state whose transitions to have listed

      -

    Returns JssmTransitionList

  • machine_author(): string[]
  • machine_comment(): string
  • machine_contributor(): string[]
  • machine_definition(): string
  • machine_language(): string
  • machine_license(): string
  • machine_name(): string
  • machine_version(): string
  • post_hook_action(from: string, to: string, action: string, handler: HookHandler<mDT>): Machine<mDT>
  • probabilistic_histo_walk(n: number): Map<string, number>
  • probabilistic_transition(): boolean
  • probabilistic_walk(n: number): string[]
  • probable_action_exits(whichState?: string): any[]
  • state(): string

Returns JssmTransitionList

  • machine_author(): string[]
  • machine_comment(): string
  • machine_contributor(): string[]
  • machine_definition(): string
  • machine_language(): string
  • machine_license(): string
  • machine_name(): string
  • machine_version(): string
  • post_hook_action(from: string, to: string, action: string, handler: HookHandler<mDT>): Machine<mDT>
  • probabilistic_histo_walk(n: number): Map<string, number>
  • probabilistic_transition(): boolean
  • probabilistic_walk(n: number): string[]
  • probable_action_exits(whichState?: string): any[]
  • state(): string
  • Get the current state of a machine.

    import * as jssm from 'jssm';

    const switch = jssm.from('on <=> off;');
    console.log( switch.state() ); // 'on'

    switch.transition('off');
    console.log( switch.state() ); // 'off'
    -

    Returns string

  • state_is_complete(whichState: string): boolean
  • state_is_final(whichState: string): boolean
  • state_is_complete(whichState: string): boolean
  • state_is_final(whichState: string): boolean
  • Check whether a given state is final (either has no exits or is marked complete.)

    import { sm, state_is_final } from 'jssm';

    const final_test = sm`first -> second;`;

    console.log( final_test.state_is_final('first') ); // false
    console.log( final_test.state_is_final('second') ); // true

    Parameters

    • whichState: string

      The name of the state to check for finality

      -

    Returns boolean

  • state_is_terminal(whichState: string): boolean
  • states(): string[]

Returns boolean

  • state_is_terminal(whichState: string): boolean
  • states(): string[]
  • List all the states known by the machine. Please note that the order of these states is not guaranteed.

    import * as jssm from 'jssm';

    const switch = jssm.from('on <=> off;');
    console.log( switch.states() ); // ['on', 'off']
    -

    Returns string[]

  • transition(newState: string, newData?: mDT): boolean
  • transition(newState: string, newData?: mDT): boolean
  • Instruct the machine to complete a transition.

    const light = sm`red -> green -> yellow -> red; [red yellow green] 'shutdown' ~> off 'start' -> red;`;

    light.state(); // 'red'
    light.transition('green'); // true
    light.state(); // 'green'
    @@ -127,4 +127,4 @@

    The state to switch to

  • Optional newData: mDT

    The data change to insert during the transition

    -

Returns boolean

  • transition_impl(newStateOrAction: string, newData: mDT, wasForced: boolean, wasAction: boolean): boolean
  • Parameters

    • newStateOrAction: string
    • newData: mDT
    • wasForced: boolean
    • wasAction: boolean

    Returns boolean

  • valid_action(action: string, _newData?: mDT): boolean
  • valid_force_transition(newState: string, _newData?: mDT): boolean
  • valid_transition(newState: string, _newData?: mDT): boolean

Generated using TypeDoc

\ No newline at end of file +

Returns boolean

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/docs/classes/jssm_error.JssmError.html b/docs/docs/classes/jssm_error.JssmError.html index 07a7f84a..aa7669f4 100644 --- a/docs/docs/classes/jssm_error.JssmError.html +++ b/docs/docs/classes/jssm_error.JssmError.html @@ -1,4 +1,4 @@ -JssmError | JSSM, a JavaScript state machine - the FSM for FSL
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

Properties

base_message: string
message: string
name: string
requested_state: string
stack?: string
prepareStackTrace?: ((err: <internal>.Error, stackTraces: CallSite[]) => any)

Type declaration

  • Compile a machine's JSON intermediate representation to a config object. If you're using this (probably don't,) you're probably also using parse to get the IR, and the object constructor @@ -43,7 +43,7 @@

    Hey!

    The type of the machine data member; usually omitted

Parameters

  • tree: JssmParseTree

    The parse tree to be boiled down into a machine config

    -

Returns JssmGenericConfig<mDT>

Returns JssmGenericConfig<mDT>

  • Create a state machine from an implementation string. This is one of the two main paths for working with JSSM, alongside sm.

    Use this method when you want to conveniently pull a state machine from a @@ -57,7 +57,7 @@

    Hey!

    The FSL code to evaluate

  • Optional ExtraConstructorFields: Partial<JssmGenericConfig<mDT>>

    Extra non-code configuration to pass at creation time

    -

Returns Machine<mDT>

  • is_hook_rejection<mDT>(hr: HookResult<mDT>): boolean

Returns Machine<mDT>

  • is_hook_rejection<mDT>(hr: HookResult<mDT>): boolean
  • An internal convenience wrapper for parsing then compiling a machine string. Not generally meant for external use. Please see compile or sm.

    @@ -65,7 +65,7 @@

    Hey!

    The type of the machine data member; usually omitted

Parameters

  • plan: string

    The FSL code to be evaluated and built into a machine config

    -

Returns JssmGenericConfig<mDT>

Returns JssmGenericConfig<mDT>

  • This method wraps the parser call that comes from the peg grammar, parse. Generally neither this nor that should be used directly unless you mean to develop plugins or extensions for the machine.

    @@ -96,7 +96,7 @@

    Hey!

    The FSL code to be evaluated

  • Optional options: <internal>.Object

    Things to control about the instance

    -

Returns any

Returns any

  • Create a state machine from a template string. This is one of the two main paths for working with JSSM, alongside from.

    Use this method when you want to work directly and conveniently with a @@ -110,7 +110,7 @@

    Hey!

    The assembled code

  • Rest ...remainder: any[]

    The mechanic for template argument insertion

    -

Returns Machine<mDT>

Returns Machine<mDT>