:py:mod:`raesl.compile.typechecking.expr_checker` ================================================= .. py:module:: raesl.compile.typechecking.expr_checker .. autoapi-nested-parse:: Check that expressions comply with the language requirements. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: raesl.compile.typechecking.expr_checker.ExprChecker .. py:class:: ExprChecker(vps: Dict[str, Union[raesl.compile.ast.components.VarParam]], diag_store: raesl.compile.diagnostics.DiagnosticStore) Class for checking expressions. :param vps: Variables and parameters defined in the expression context. :param diag_store: Storage for found diagnostics. .. attribute:: reported_names Names of variables and variable parts that have been reported as error, to avoid duplicate error messages. .. py:method:: check_expr(expr: raesl.compile.ast.exprs.Expression) -> bool Check whether the expression follows all rules of the ESL language. :param expr: Expression to check. :returns: Whether the expression is considered to be sufficiently correct to continue checking other parts of the construct around the expression. .. py:method:: check_relation_comparison(expr: raesl.compile.ast.exprs.RelationComparison) -> bool Check the provided relation comparison. :param expr: Relation comparison to check. :returns: Whether the expression is considered to be sufficiently correct. .. py:method:: _check_relation_side(side: raesl.compile.ast.exprs.DataValue) -> Optional[Tuple[raesl.compile.scanner.Token, Optional[raesl.compile.ast.types.BaseType], Optional[Set[str]]]] Check one side in a relation comparison. :param side: Side to check. :returns: Information about the checked side. None means an error has been reported, otherwise a triplet of token, type, and supported units is returned for as far as the side supports each notion. .. py:method:: _check_variable(var: raesl.compile.ast.exprs.VariableValue) -> bool Check that the variable exists in the context. :param var: Variable to check. :returns: Whether the variable was found.