示例#1
0
        public override string ReadLine()
        {
            // when ReadLine returns null we are at the end of the file.
            var line = NextLine();

            // after we exit the top loop, line will be the first non-header line.
            while (line != null)
            {
                if (PreprocessorStateManager.IsPreprocessorStatement(line))
                {
                    manager.ExecutePreprocessorStatement(line);
                }
                else if (manager.IsActiveRegion)
                {
                    return(line);
                }

                line = NextLine();
            }
            return(null);
        }
示例#2
0
 public SourceTextReader(TextReader reader)
 {
     this.reader = reader;
     manager     = new PreprocessorStateManager();
     Line        = 0;
 }