Ejemplo n.º 1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Initializes a new instance of the <see cref="IdhCommentProcessor"/> class.
        /// </summary>
        /// <param name="fileNames">List of names of IDH files.</param>
        /// ------------------------------------------------------------------------------------
        public IdhCommentProcessor(StringCollection fileNames)
        {
            m_Comments = new Dictionary<string,CommentInfo>();

            if (fileNames == null || fileNames.Count == 0)
                return;

            foreach (string fileName in fileNames)
            {
                using (var reader = new StreamReader(fileName))
                {
                    var lexer = new IdhLexer(reader);
                    lexer.setFilename(fileName);
                    var parser = new IdhParser(lexer);
                    parser.setFilename(fileName);
                    var info = parser.idhfile();

                    foreach (string iface in info.Children.Keys)
                        m_Comments.Add(iface, info.Children[iface]);
                }
            }

            CleanupComments(m_Comments);
        }
Ejemplo n.º 2
0
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Creates the parser.
 /// </summary>
 /// <param name="input">The input.</param>
 /// <returns></returns>
 /// ------------------------------------------------------------------------------------
 private IdhParser CreateParser(string input)
 {
     m_Reader = new StringReader(input);
     var lexer = new IdhLexer(m_Reader);
     return new IdhParser(lexer);
 }