raesl.compile.typechecking.compdef_varparam_builder#

Variables and components in a component definition.

Module Contents#

Classes#

CompDefVarParamBuilder

Collect and check variables of a component definition.

Functions#

_make_varnodes(name_tok, the_type, varparam_counter)

Make a VarNode tree that matches the shape of the type.

class raesl.compile.typechecking.compdef_varparam_builder.CompDefVarParamBuilder(comp_child_builders: raesl.compile.typechecking.compdef_builder.CompDefChildBuilders, varparam_counter: raesl.compile.typechecking.compdef_builder.Counter)#

Collect and check variables of a component definition.

Parameters:
  • comp_child_builders – Storage of child builders for a component definition.

  • varparam_counter – Object for handing out unique numbers to elementary var/param nodes.

variables#

Variables of the component.

parameters#

Parameters of the component.

add_variables(new_vars: List[raesl.compile.ast.components.VarParam])#

Add variables of the component definition to the collection.

add_parameters(new_params: List[raesl.compile.ast.components.VarParam])#

Add parameters of the component definition to the collection.

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

Check the collected variables and parameters, report errors, and add the instances to the given component.

Parameters:
  • comp_def – Component definition to extend with the found variables and parameters.

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

raesl.compile.typechecking.compdef_varparam_builder._make_varnodes(name_tok: raesl.compile.scanner.Token, the_type: raesl.compile.ast.types.BaseType, varparam_counter: raesl.compile.typechecking.compdef_builder.Counter)#

Make a VarNode tree that matches the shape of the type.