Ejemplo n.º 1
0
        /// <summary>
        /// Validate that a library contains one entry section and no duplicate symbols.
        /// </summary>
        /// <param name="messageHandler">Message handler for errors.</param>
        /// <param name="library">Library to validate.</param>
        private void Validate(IMessageHandler messageHandler, Library library)
        {
            Section          entrySection;
            SymbolCollection allSymbols;

            ArrayList         intermediates = new ArrayList();
            SectionCollection sections      = new SectionCollection();

            StringCollection referencedSymbols    = new StringCollection();
            ArrayList        unresolvedReferences = new ArrayList();

            intermediates.AddRange(library.Intermediates);
            Common.FindEntrySectionAndLoadSymbols((Intermediate[])intermediates.ToArray(typeof(Intermediate)), false, this, out entrySection, out allSymbols);

            foreach (Intermediate intermediate in library.Intermediates)
            {
                foreach (Section section in intermediate.Sections)
                {
                    Common.ResolveReferences(OutputType.Unknown, sections, section, allSymbols, referencedSymbols, unresolvedReferences, this);
                }
            }
        }