SPPCompiler.SemanticAnalysis.Asts.Mixins.TypeInferrableAst module

class SPPCompiler.SemanticAnalysis.Asts.Mixins.TypeInferrableAst.TypeInferrable

Bases: object

The TypeInferrable class allows for the resulting type of evaluating the code that created an AST, to be determined. Every expression-based AST, and a few others, are type inferrable.

abstractmethod infer_type(sm, **kwargs)

Given the AST, and the scope manager (with knowledge o the current scope etc), determine the resulting type of this AST. A lot of ASTs will recursively call this method on their children for more type information. :type sm: :param sm: The scope manager. :type kwargs: :param kwargs: Additional keyword arguments. :return: The resulting type of the AST.