public static ASTResult GetTypeCheckDiagnosis(ASTResult astResult)
        {
            //Precondition: no previous errors
            if (astResult.HasError()) // if it already has errors, refuse to add more
                return astResult;

            Form rootNode = astResult.RootNode;
            INotificationManager manager = new NotificationManager();

            manager.Combine(new IdentifierChecker(manager).AnalyzeAndReport(rootNode));

            manager.Combine(new ExpressionContainerChecker(manager, GetIdentifierTypes(rootNode))
                            .AnalyzeAndReport(rootNode.GetBody())
                );

            manager.Combine(new CyclicDependencyChecker(manager).AnalyzeAndReport(rootNode.GetBody()));
            manager.Combine(new LabelChecker().AnalyzeAndReport(rootNode.GetBody()));

            astResult.CombineNotifications(manager);

            return astResult;
        }
 public MainController(MainWindow mainWindow, ASTResult ast)
 {
     window = mainWindow;
     astTree = ast;
 }