:py:mod:`raesl.compile.typechecking.goal_transform_base` ======================================================== .. py:module:: raesl.compile.typechecking.goal_transform_base .. autoapi-nested-parse:: Base class for goal and transformation processing to improve code sharing. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: raesl.compile.typechecking.goal_transform_base.GoalTransformBaseBuilder .. py:class:: GoalTransformBaseBuilder(diag_store: raesl.compile.diagnostics.DiagnosticStore) Common base class for checking goals and transformations. :param diag_store: Storage for found diagnostics. .. attribute:: reported_names Names of flows with a reported error, to avoid duplicate error generation. .. py:method:: verify_verb_prepos(verb_tok: raesl.compile.scanner.Token, prepos_tok: raesl.compile.scanner.Token, vpps: Set[Tuple[str, str]]) Verify verb and pre-position and report an error if the combination does not exist. :param verb_tok: Token holding the verb text. :param prepos_tok: Token holding the prepos text. :param vpps: Available combinations of verbs and prepositions. .. py:method:: verify_flows(flows: List[raesl.compile.ast.components.Flow], vps: Dict[str, raesl.compile.ast.components.VarParam]) -> bool Check that each flow exists as variable or parameter. Update the link in the Flow object to point to the matching variable or parameter. :param flows: Flows to check. :param vps: Available variables and parameters in the component. :returns: Whether all flows can be matched to a variable or parameter. .. py:method:: resolve_component(compinst_tok: raesl.compile.scanner.Token, cinsts: Dict[str, raesl.compile.ast.components.ComponentInstance]) -> Optional[raesl.compile.ast.components.ComponentInstance] Find a component instance with the provided instance name. If it exists, return it, else report an error and return None, indicating failure. .. py:method:: check_form(sect_name: str, kind: str, doesaux: raesl.compile.scanner.Token, sub_clauses: List[raesl.compile.ast.components.SubClause]) Check whether the requirement or constraint form of the text is correct with respect to the containing section. :param sect_name: Name of the section (goal or transformation). :param kind: Kind of section containing the text (requirement or constraint). :param doesaux: Token in the formulation that is either 'does' or one of the auxiliary verbs. :param sub_clauses: Sub clauses belong to the requirement or constraint. .. py:method:: _check_constraint_expr(expr: Union[raesl.compile.ast.exprs.Disjunction, raesl.compile.ast.exprs.RelationComparison, raesl.compile.ast.exprs.ObjectiveComparison]) Check whether the subclauses have the proper form for a constraint section. Report an error if something wrong is found. .. py:method:: _check_requirement_expr(expr: Union[raesl.compile.ast.exprs.Disjunction, raesl.compile.ast.exprs.RelationComparison, raesl.compile.ast.exprs.ObjectiveComparison]) Check whether the subclauses have the proper form for a requirement section. Report an error if something wrong is found.