/// <summary> /// Run the PreProcessor on the stream /// </summary> /// <param name="result"></param> /// <param name="readerBag"></param> /// <returns></returns> /// <remarks></remarks> private TextReaderBag RunPreProcessorImpl(NativeCodeAnalyzerResult result, TextReaderBag readerBag) { ThrowIfNull(result); ThrowIfNull(readerBag); // Create the options PreProcessorOptions opts = new PreProcessorOptions(); opts.FollowIncludes = this.FollowIncludes; opts.IncludePathList.AddRange(this.IncludePathList); opts.InitialMacroList.AddRange(_initialMacroList); opts.Trace = this.Trace; PreProcessorEngine preprocessor = new PreProcessorEngine(opts); // Process the file string ret = preprocessor.Process(readerBag); // Process the results result.ErrorProvider.Append(preprocessor.ErrorProvider); foreach (KeyValuePair <string, Macro> pair in preprocessor.MacroMap) { if (_includeInitialMacroInResult || pair.Value.IsFromParse) { result.MacroMap.Add(pair.Key, pair.Value); } } return(new TextReaderBag(new StringReader(ret))); }
public PreProcessorEngine(PreProcessorOptions options) { _eval = new ExpressionEvaluator(_macroMap); _options = options; }