# configuration/strings/bnf.fragment.strings.ts

> 56 lines of code and 2 definitions.

Tree: Site tree
Language: typescript
Layer: product
Canonical: https://banes-lab.com/anatomy/tree#file-configuration-strings-bnf-fragment-strings-ts
Source text: https://banes-lab.com/assets/sources/source.4db1fdacb06651624cde3ba9e36e213e685f63662d33325e9c04cfc3b7c48d4d.generated.txt

## Definitions

- `COORDINATION_RULES` (lexical_declaration, line 3, exported)
- `FLOWCHART_RULES` (lexical_declaration, line 42, exported)

## Source

```typescript
import type { GrammarRule } from "#types/grammar.types";

export const COORDINATION_RULES: readonly GrammarRule[] = [
    {
        grammar:
            '<await_statement> ::= "AWAIT" <awaitable_expression> <optional_result_binding>\n<awaitable_expression> ::= <identifier> | <string> | <tool_invocation>\n<optional_result_binding> ::= "INTO" <identifier> | ε',
        title: "Await",
    },
    { grammar: '<parallel_block> ::= "PARALLEL" ":" <directive>+ "END"', title: "Parallel" },
    {
        grammar:
            '<surface_declaration> ::= "SURFACE" <surface_key> ":" <record_declaration>+\n<record_declaration> ::= "RECORD" <record_id> "subject" ":" <subject_key> <edge_clause>* <item>*\n<item> ::= "ITEM" <item_id> "TO" <reader> ":" <text>\n<edge_clause> ::= <edge_kind> <target_id>\n<edge_kind> ::= "PARENT" | "SATISFIED_BY" | "BLOCKS" | "ANSWERS" | "REFUTES" | "SUPERSEDES"\n<derived_state> ::= "OPEN" | "BLOCKED" | "ABSORBED"\n<wait_statement> ::= "WAIT" "ON" <surface_key> "AS" <reader> "INTO" <diff_binding>\n<barrier_statement> ::= "BARRIER" "ON" <surface_key>\n<swap_statement> ::= "SWAP" <span> "AGAINST" <read>\n<reader> ::= "participant" | "bounded" | <identifier>\n<surface_key> ::= <identifier>\n<record_id> ::= <surface_key> "-" <number>\n<item_id> ::= <record_id> "-" <number>\n<subject_key> ::= <identifier>\n<target_id> ::= <record_id> | <path>\n<diff_binding> ::= <variable_name>\n<span> ::= <text>\n<read> ::= <variable_name>',
        title: "Surface",
    },
    {
        grammar:
            '<state_machine_declaration> ::= "STATE_MACHINE" <machine_name> ":" <state_definition>+ <transition_definition>+\n<state_definition> ::= "STATE" <state_name> <optional_state_type>\n<optional_entry_actions>\n<optional_exit_actions>\n<transition_definition> ::= "TRANSITION" "FROM" <state_name> "TO" <state_name>\n"ON" <event_name>\n<optional_guard>\n<optional_transition_actions>\n<optional_state_type> ::= ":" <state_type> | ε\n<optional_entry_actions> ::= "ENTRY" ":" <directive>+ | ε\n<optional_exit_actions> ::= "EXIT" ":" <directive>+ | ε\n<optional_guard> ::= "GUARD" ":" <condition> | ε\n<optional_transition_actions> ::= ":" <directive>+ | ε\n<machine_name> ::= <variable_name>\n<state_name> ::= <variable_name>\n<state_type> ::= <identifier>\n<event_name> ::= <variable_name>',
        title: "State machine",
    },
    {
        grammar:
            '<dag_declaration> ::= "DAG" <dag_name> ":" <dag_item>+\n<dag_item> ::= <node_definition> | <parallel_group>\n<node_definition> ::= "NODE" <node_name> <optional_node_type>\n<optional_depends_on>\n<optional_after>\n<optional_before>\n":" <directive>+\n<parallel_group> ::= "PARALLEL_GROUP" ":" <node_name_list>\n<dependency_list> ::= <node_name> ("," <node_name>)*\n<dependent_list> ::= <node_name> ("," <node_name>)*\n<node_name_list> ::= <node_name> ("," <node_name>)*\n<optional_node_type> ::= ":" <node_type> | ε\n<optional_depends_on> ::= "DEPENDS_ON" "[" <dependency_list> "]" | ε\n<optional_after> ::= "AFTER" <dependency_list> | ε\n<optional_before> ::= "BEFORE" <dependent_list> | ε\n<dag_name> ::= <variable_name>\n<node_type> ::= <identifier>',
        title: "DAG",
    },
    {
        grammar:
            '<priority_queue_declaration> ::= "PRIORITY_QUEUE" <queue_name>\n<optional_comparison>\n":"\n<priority_queue_operation> ::= <enqueue_statement>\n| <dequeue_statement>\n| <peek_statement>\n| <heapify_statement>\n<enqueue_statement> ::= "ENQUEUE" <value> "TO" <queue_name>\n<optional_priority>\n<dequeue_statement> ::= "DEQUEUE" "FROM" <queue_name>\n<optional_target>\n<peek_statement> ::= "PEEK" <queue_name>\n<optional_target>\n<heapify_statement> ::= "HEAPIFY" <queue_name>\n<comparison_function> ::= <function_name>\n| "(" <optional_param_list> ")" "→" <expression>\n<optional_comparison> ::= "COMPARE_BY" <comparison_function> | ε\n<optional_priority> ::= "PRIORITY" "=" <priority_value> | ε\n<optional_target> ::= "TO" <target_variable> | ε\n<queue_name> ::= <variable_name>\n<priority_value> ::= <number> | <expression>\n<target_variable> ::= <variable_name>',
        title: "Priority queue",
    },
    {
        grammar:
            '<cross_reference_statement> ::= <collect_from_statement>\n| <find_in_statement>\n| <reference_statement>\n| <link_statement>\n<collect_from_statement> ::= "FROM" <file_path_pattern> "COLLECT" <selector> "TO" <target_variable>\n<find_in_statement> ::= "FROM" <file_path_pattern> "FIND" <search_term> "TO" <target_variable>\n<reference_statement> ::= "REFERENCE" <file_path_pattern> <optional_alias>\n<link_statement> ::= "LINK" <source_expression> "TO" <file_reference>\n<file_path_pattern> ::= <string> | <glob_pattern>\n<glob_pattern> ::= <string>\n<file_reference> ::= <string> <optional_anchor>\n<optional_anchor> ::= "#" <identifier> | ε\n<selector> ::= <expression> | "*"\n<search_term> ::= <string> | <regex_literal>\n<target_variable> ::= <variable_name>\n<source_expression> ::= <expression>\n<alias> ::= <identifier>\n<optional_alias> ::= "AS" <alias> | ε',
        title: "Cross reference",
    },
    {
        grammar:
            '<tool_invocation> ::= <semantic_operation> <tool_target> <optional_tool_param_clause> <optional_tool_result_clause>\n<tool_target> ::= <string> | <identifier> | <file_path> | <expression>\n<optional_tool_param_clause> ::= <tool_param_clause> | ε\n<tool_param_clause> ::= "WITH" <tool_param_list>\n| "USING" <tool_param_list>\n<tool_param_list> ::= <tool_param_pair> ("," <tool_param_pair>)*\n<tool_param_pair> ::= <tool_param_name> ":" <tool_param_value>\n| <tool_param_name> "=" <tool_param_value>\n| <tool_param_name>\n<tool_param_name> ::= <identifier>\n<tool_param_value> ::= <string>\n| <number>\n| <boolean>\n| <identifier>\n| <array_literal>\n| <object_literal>\n<optional_tool_result_clause> ::= <tool_result_clause> | ε\n<tool_result_clause> ::= "->" <tool_result_binding>\n| "INTO" <tool_result_binding>\n| "AS" <tool_result_binding>\n<tool_result_binding> ::= <identifier>',
        title: "Semantic operation",
    },
];

export const FLOWCHART_RULES: readonly GrammarRule[] = [
    {
        grammar:
            '<flowchart_declaration> ::= "FLOWCHART" <flowchart_name> <optional_flowchart_state> <optional_flowchart_layout> ":" <flowchart_body>\n<optional_flowchart_layout> ::= "LAYOUT" <flowchart_layout> | ε\n<flowchart_body> ::= <flowchart_line>+ <optional_error_handler>\n<optional_error_handler> ::= <error_handler> | ε\n<error_handler> ::= "ON" "ERROR" ":" <directive>+\n<flowchart_line> ::= <flowchart_node>\n| <flowchart_edge>\n| <flowchart_branch>\n| <flowchart_merge>\n| <flowchart_loop>\n<flowchart_node> ::= <node_label> <node_shape> <optional_shape_type> <optional_node_content>\n<node_label> ::= <identifier> | <string>\n<node_shape> ::= "[" <text> "]"\n| "(" <text> ")"\n| "{" <text> "}"\n| "<" <text> ">"\n| "((" <text> "))"\n| "[[" <text> "]]"\n<optional_shape_type> ::= ":" <flowchart_shape_types> | ε\n<optional_node_content> ::= <node_content> | ε\n<node_content> ::= ":" <node_block>\n<node_block> ::= <directive>+\n| "EVALUATE" <condition>\n| "EXECUTE" <function_call>\n| "TRY" ":" <directive>+ "CATCH" ":" <directive>+\n<optional_flowchart_state> ::= "WITH" "STATE" <state_declaration>+ | ε\n<state_declaration> ::= <variable_name> ":" <type_annotation> "=" <expression>\n<flowchart_edge> ::= <edge_source> <edge_arrow> <edge_target> <optional_edge_label>\n<edge_source> ::= <identifier>\n<edge_target> ::= <identifier>\n<edge_arrow> ::= "→" | "↓" | "↑" | "←" | "↔"\n| "-->" | "--->" | "==>" | "-.->>"\n| "|"\n<optional_edge_label> ::= ":" <string> | ε\n<flowchart_branch> ::= <branch_source> "/" <branch_option>+\n<branch_source> ::= <identifier>\n<branch_option> ::= <branch_condition> "→" <branch_target>\n<branch_condition> ::= <condition> | <string>\n<branch_target> ::= <identifier>\n<flowchart_merge> ::= <merge_source>+ "◄" <merge_target>\n<merge_source> ::= <identifier>\n<merge_target> ::= <identifier>\n<flowchart_loop> ::= "LOOP" <loop_source> "→" <loop_target> <optional_loop_limit>\n<loop_source> ::= <identifier>\n<loop_target> ::= <identifier>\n<optional_loop_limit> ::= "MAX" <number> | ε\n<flowchart_shape_types> ::= "process"\n| "decision"\n| "start_end"\n| "input_output"\n| "subprocess"\n| "database"\n<flowchart_layout> ::= "vertical" | "horizontal" | "lr" | "rl" | "tb" | "bt"\n<flowchart_name> ::= <variable_name>',
        title: "Flowchart",
    },
    {
        grammar:
            '<ascii_flowchart_block> ::= <ascii_flowchart_line>+\n<ascii_flowchart_line> ::= <ascii_node_line>\n| <ascii_connector_line>\n| <ascii_branch_line>\n| <ascii_merge_line>\n<ascii_node_line> ::= <indent> <ascii_node>\n<ascii_node> ::= "[" <text> "]"\n| "(" <text> ")"\n| "{" <text> "}"\n| "<" <text> ">"\n<ascii_connector_line> ::= <indent> "|"\n| <indent> "│"\n| <indent> "▼"\n| <indent> "▲"\n| <indent> "►"\n| <indent> "◄"\n<ascii_branch_line> ::= <indent> "/" <indent> "\\"\n| <indent> "▼" <indent> "▼"\n<ascii_merge_line> ::= <indent> "\\" <indent> "/"\n| <indent> "◄" "─" "┘"\n<indent> ::= <whitespace>*',
        title: "ASCII flowchart",
    },
    {
        grammar:
            '<mermaid_declaration> ::= "MERMAID" <mermaid_type> ":" <mermaid_body>\n<mermaid_type> ::= "flowchart" | "graph" | "sequence" | "class" | "state" | "er"\n<mermaid_body> ::= <mermaid_line>+\n<mermaid_line> ::= <mermaid_node_def>\n| <mermaid_connection>\n| <mermaid_subgraph>\n| <mermaid_style>\n<mermaid_node_def> ::= <node_id> <mermaid_node_shape> <optional_node_text>\n<node_id> ::= <identifier>\n<mermaid_node_shape> ::= "[" <text> "]"\n| "(" <text> ")"\n| "{" <text> "}"\n| "((" <text> "))"\n| "[[" <text> "]]"\n| "[/" <text> "/]"\n| "[\\" <text> "\\]"\n<optional_node_text> ::= <text> | ε\n<mermaid_connection> ::= <node_id> <mermaid_arrow> <node_id> <optional_connection_text>\n<mermaid_arrow> ::= "-->" | "--->" | "==>" | "-.->" | "--"\n<optional_connection_text> ::= "|" <text> "|" | ε\n<mermaid_subgraph> ::= "subgraph" <subgraph_title> <mermaid_line>+ "end"\n<subgraph_title> ::= <string>\n<mermaid_style> ::= "style" <node_id> <style_properties>\n<style_properties> ::= <style_property> ("," <style_property>)*\n<style_property> ::= <identifier> ":" <string>',
        title: "Mermaid flowchart",
    },
];
```
