public void CreateMainUIBody() { if (!astTree.HasError()) { SubController bodyController = new SubController(symbolTable, UpdateValue); bodyController.CreateUIBody(astTree.RootNode, (StackPanel)window.GetRootElement()); //Defined in XML, so object has to be casted symbolTable = bodyController.SymbolTable; } else { window.PrintErrorsInGui(astTree.NotificationManager); } }
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); }