public static void Validate(SemanticModel semanticModel, IDiagnosticWriter diagnosticWriter)
        {
            var visitor = new IntegerValidatorVisitor(semanticModel, diagnosticWriter);

            // visiting writes diagnostics in some cases
            visitor.Visit(semanticModel.SourceFile.ProgramSyntax);
        }
        public static void Validate(ProgramSyntax programSyntax, IDiagnosticWriter diagnosticWriter)
        {
            var visitor = new IntegerValidatorVisitor(diagnosticWriter);

            // visiting writes diagnostics in some cases
            visitor.Visit(programSyntax);
        }
        public static EmitLimitationInfo Calculate(SemanticModel model)
        {
            var diagnosticWriter = ToListDiagnosticWriter.Create();

            var moduleScopeData   = ScopeHelper.GetModuleScopeInfo(model, diagnosticWriter);
            var resourceScopeData = ScopeHelper.GetResourceScopeInfo(model, diagnosticWriter);

            DeployTimeConstantValidator.Validate(model, diagnosticWriter);
            ForSyntaxValidatorVisitor.Validate(model, diagnosticWriter);
            FunctionPlacementValidatorVisitor.Validate(model, diagnosticWriter);
            IntegerValidatorVisitor.Validate(model, diagnosticWriter);

            DetectDuplicateNames(model, diagnosticWriter, resourceScopeData, moduleScopeData);
            DetectIncorrectlyFormattedNames(model, diagnosticWriter);
            DetectUnexpectedResourceLoopInvariantProperties(model, diagnosticWriter);
            DetectUnexpectedModuleLoopInvariantProperties(model, diagnosticWriter);
            DetectUnsupportedModuleParameterAssignments(model, diagnosticWriter);

            return(new EmitLimitationInfo(diagnosticWriter.GetDiagnostics(), moduleScopeData, resourceScopeData));
        }