raesl.compile.typechecking.compdef_transform_builder#

Code for collecting and type checking of transformations.

Module Contents#

Classes#

CompDefTransformBuilder

Collect transformations of a component from the parser, check them, and add them

class raesl.compile.typechecking.compdef_transform_builder.CompDefTransformBuilder(comp_child_builders: raesl.compile.typechecking.compdef_builder.CompDefChildBuilders)#

Bases: raesl.compile.typechecking.goal_transform_base.GoalTransformBaseBuilder

Collect transformations of a component from the parser, check them, and add them to the component definition.

Parameters:

comp_child_builders – Storage of child builders for a component definition.

transforms#

Collected transformations.

transform_kind#

Last found kind of transformation kind, either ‘requirement’ or ‘constraint’.

new_transform_header(transform_kind: raesl.compile.scanner.Token)#

New transform section line found.

Parameters:

transform_kind – Kind of transformations that will follow.

add_transform(transform: raesl.compile.ast.components.Transformation)#

A new transformation has been found, add it to the collection.

Parameters:

transform – Transformation to add.

add_transform_subclause(sub_clause: raesl.compile.ast.components.SubClause)#

Add a found subclause that belongs to the last transformation.

finish_comp(comp_def: raesl.compile.ast.components.ComponentDefinition, spec: raesl.compile.ast.specification.Specification)#

Check the found transformations, and add them to the component.

Parameters:
  • comp_def – Component definition to extend with the found relation instances. Also a source of available variables, parameters, and variable groups.

  • spec – Specification being constructed. Source for types and relation definitions processed previously.