raesl.compile.typechecking.compdef_vargroup_builder#

Variable groups in a component.

Module Contents#

Classes#

CollectedVarGroup

Temporary data storage of found variable groups.

CompDefVarGroupBuilder

Collect and check variable groups of a component definition.

class raesl.compile.typechecking.compdef_vargroup_builder.CollectedVarGroup(name_tok: raesl.compile.scanner.Token, child_name_toks: List[raesl.compile.scanner.Token])#

Temporary data storage of found variable groups.

class raesl.compile.typechecking.compdef_vargroup_builder.CompDefVarGroupBuilder(comp_child_builders: raesl.compile.typechecking.compdef_builder.CompDefChildBuilders)#

Collect and check variable groups of a component definition.

Parameters:

comp_child_builders – Storage of child builders for a component definition.

collected_var_groups#

Collected var group instances in the component.

last_vgroup#

Link to last added instance to allow adding instance arguments.

new_vargroup(name_tok: raesl.compile.scanner.Token)#

Parser found the start of a new variable group definition. Create a new group for it.

Parameters:

name_tok – Name of the new variable group.

vgroup_add_vars(varpart_name_toks: List[raesl.compile.scanner.Token])#

Parser found a line with variables that are part of the group. Store them for further processing afterwards.

Parameters:

varpart_name_toks – Name of variable parts that should become included in the last defined variable group.

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

Check the collected variable groups, report errors, and add the instances to the given component.

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

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