:py:mod:`raesl.compile.machine_files.behavior`
==============================================
.. py:module:: raesl.compile.machine_files.behavior
.. autoapi-nested-parse::
Line matchers for the behavior section.
Module Contents
---------------
Functions
~~~~~~~~~
.. autoapisummary::
raesl.compile.machine_files.behavior._process_behavior_header
raesl.compile.machine_files.behavior._process_new_behavior_function
raesl.compile.machine_files.behavior._process_new_case
raesl.compile.machine_files.behavior._process_normal_when_start
raesl.compile.machine_files.behavior._process_otherwise_when_start
raesl.compile.machine_files.behavior._decode_when_comparisons
raesl.compile.machine_files.behavior._process_when_condition
raesl.compile.machine_files.behavior._process_then_start
raesl.compile.machine_files.behavior._decode_result
raesl.compile.machine_files.behavior._process_then_result
Attributes
~~~~~~~~~~
.. autoapisummary::
raesl.compile.machine_files.behavior._BEHAVIOR_HEADER_SPEC
raesl.compile.machine_files.behavior._BEHAVIOR_NAME_SPEC
raesl.compile.machine_files.behavior._BEHAVIOR_CASE_SPEC
raesl.compile.machine_files.behavior._BEHAVIOR_WHEN_SPEC
raesl.compile.machine_files.behavior._BEHAVIOR_WHEN_OTHERWISE_SPEC
raesl.compile.machine_files.behavior._BEHAVIOR_WHEN_CONDITION_SPEC
raesl.compile.machine_files.behavior._BEHAVIOR_THEN_SPEC
raesl.compile.machine_files.behavior._BEHAVIOR_THEN_RESULT_SPEC
raesl.compile.machine_files.behavior.MACHINES
.. py:data:: _BEHAVIOR_HEADER_SPEC
:value: Multiline-String
.. raw:: html
Show Value
.. code-block:: python
"""
behavior_header:
start initial;
start -> s1 [BEHAVIOR_REQUIREMENT_KW] tag=kind;
start -> s1 [BEHAVIOR_CONSTRAINT_KW] tag=kind;
end accept=behavior_header;
s1 -> end [NL_TK];
"""
.. raw:: html
.. py:function:: _process_behavior_header(tags: raesl.compile.machine_files.typing.TokensDict, _accept: str, builder: raesl.compile.typechecking.ast_builder.AstBuilder) -> None
.. py:data:: _BEHAVIOR_NAME_SPEC
:value: Multiline-String
.. raw:: html
Show Value
.. code-block:: python
"""
behavior_name:
start initial;
start -> s1 [NAME] tag=label;
s1 -> s2 [COLON_TK];
end accept=behavior_name;
s2 -> end [NL_TK];
"""
.. raw:: html
.. py:function:: _process_new_behavior_function(tags: raesl.compile.machine_files.typing.TokensDict, _accept: str, builder: raesl.compile.typechecking.ast_builder.AstBuilder) -> None
.. py:data:: _BEHAVIOR_CASE_SPEC
:value: Multiline-String
.. raw:: html
Show Value
.. code-block:: python
"""
behavior_case:
start initial;
start -> s1 [CASE_KW];
s1 -> s2 [NAME] tag=case_name;
s2 -> s3 [COLON_TK];
end accept=behavior_case;
s3 -> end [NL_TK];
"""
.. raw:: html
.. py:function:: _process_new_case(tags: raesl.compile.machine_files.typing.TokensDict, _accept: str, builder: raesl.compile.typechecking.ast_builder.AstBuilder) -> None
.. py:data:: _BEHAVIOR_WHEN_SPEC
:value: Multiline-String
.. raw:: html
Show Value
.. code-block:: python
"""
behavior_when:
start initial;
start -> s1 [WHEN_KW] tag=when;
end accept=behavior_when;
s1 -> end [NL_TK];
"""
.. raw:: html
.. py:function:: _process_normal_when_start(tags: raesl.compile.machine_files.typing.TokensDict, _accept: str, builder: raesl.compile.typechecking.ast_builder.AstBuilder) -> None
.. py:data:: _BEHAVIOR_WHEN_OTHERWISE_SPEC
:value: Multiline-String
.. raw:: html
Show Value
.. code-block:: python
"""
behavior_otherwise:
start initial;
start -> s1 [WHEN_KW] tag=when;
s1 -> s2 [NO_KW];
s2 -> s3 [OTHER_KW];
s3 -> s4 [CASE_KW];
s4 -> s5 [APPLIES_KW];
end accept=behavior_when;
s5 -> end [NL_TK];
"""
.. raw:: html
.. py:function:: _process_otherwise_when_start(tags: raesl.compile.machine_files.typing.TokensDict, _accept: str, builder: raesl.compile.typechecking.ast_builder.AstBuilder) -> None
.. py:data:: _BEHAVIOR_WHEN_CONDITION_SPEC
.. py:function:: _decode_when_comparisons(tags: Dict[str, List[raesl.compile.scanner.Token]]) -> Union[raesl.compile.ast.exprs.Disjunction, raesl.compile.ast.exprs.RelationComparison]
Decode the expression expressed in the tags from _BEHAVIOR_WHEN_CONDITION_SPEC.
Much inspired by 'machine_files.decode_disjunctive_comparisons', but this is
less generic due to lack of 'aux' and objectives.
:param tags: Key pieces of text found in the input.
:returns: The equivalent expression.
.. py:function:: _process_when_condition(tags: raesl.compile.machine_files.typing.TokensDict, _accept: str, builder: raesl.compile.typechecking.ast_builder.AstBuilder) -> None
.. py:data:: _BEHAVIOR_THEN_SPEC
:value: Multiline-String
.. raw:: html
Show Value
.. code-block:: python
"""
behavior_then:
start initial;
start -> s1 [THEN_KW] tag=then;
end accept=behavior_then;
s1 -> end [NL_TK];
"""
.. raw:: html
.. py:function:: _process_then_start(tags: raesl.compile.machine_files.typing.TokensDict, _accept: str, builder: raesl.compile.typechecking.ast_builder.AstBuilder) -> None
.. py:data:: _BEHAVIOR_THEN_RESULT_SPEC
.. py:function:: _decode_result(tags: Dict[str, List[raesl.compile.scanner.Token]]) -> raesl.compile.ast.exprs.Comparison
Decode a result line from collected tags by matching _BEHAVIOR_THEN_RESULT_SPEC.
Much inspired by 'machine_files.decode_disjunctive_comparisons', but this is
simpler as there is no 'or', splitting is thus not needed.
:param tags: Key pieces of text found in the input.
:returns: The expression equivalent to the matched text.
.. py:function:: _process_then_result(tags: raesl.compile.machine_files.typing.TokensDict, _accept: str, builder: raesl.compile.typechecking.ast_builder.AstBuilder) -> None
.. py:data:: MACHINES
:type: raesl.compile.machine_files.typing.MachineTripletList
:value: [('BEHAVIOR_HEADER_MACHINE',), ('BEHAVIOR_NAME_MACHINE',), ('BEHAVIOR_CASE_MACHINE',),...