public FileAnalyzer(StreamReader filestream, ICCMNotify callback, object context, bool suppressMethodSignatures, string filename, ParserSwitchBehavior switchBehavior = ParserSwitchBehavior.TraditionalInclude) { this.buffer = new CharBuffer(filestream.BaseStream.Length); this.buffer.ReadEntireStream(filestream); var processStream = new StreamReader(buffer.GetBytesMemoryStream()); // run through preprocessor before setting up parser... Preprocessor preprocessor = new Preprocessor(processStream); StreamReader stream = preprocessor.Process(); // this construct should be fixed and support OCP if (filename.ToLower().EndsWith(".js") || filename.ToLower().EndsWith(".ts")) { this.parser = LookAheadLangParser.CreateJavascriptParser(stream); } else { this.parser = LookAheadLangParser.CreateCppParser(stream); } this.callback = callback; this.context = context; this.suppressMethodSignatures = suppressMethodSignatures; this.filename = filename; this.switchBehavior = switchBehavior; }
public FileAnalyzer(StreamReader filestream, ICCMNotify callback, object context, bool suppressMethodSignatures, string filename) { this.buffer = new char[filestream.BaseStream.Length]; filestream.Read(this.buffer, 0, this.buffer.Length); var processStream = new StreamReader(new MemoryStream(Encoding.Default.GetBytes(this.buffer))); // run through preprocessor before setting up parser... Preprocessor preprocessor = new Preprocessor(processStream); StreamReader stream = preprocessor.Process(); // this construct should be fixed and support OCP if (filename.ToLower().EndsWith(".js") || filename.ToLower().EndsWith(".ts")) { this.parser = LookAheadLangParser.CreateJavascriptParser(stream); } else { this.parser = LookAheadLangParser.CreateCppParser(stream); } this.callback = callback; this.context = context; this.suppressMethodSignatures = suppressMethodSignatures; this.filename = filename; }