public static void MakeDoc(string output, string rawsFolder, string extension, bool isDirectory, string header, string footer) { LanguageProcessor languageProcessor = new LanguageProcessor(true, (IComparer <ICodeTemplate>) new TemplateComparer(), Program.stringComparer); if (isDirectory) { languageProcessor.ProcessCode(rawsFolder, extension); } else { languageProcessor.ProcessCode(rawsFolder); } using (StreamWriter text = File.CreateText(output)) { if (header != null) { text.WriteLine(File.ReadAllText(header)); text.WriteLine(); } languageProcessor.WriteDocs((TextWriter)text); if (footer == null) { return; } text.WriteLine(File.ReadAllText(footer)); text.WriteLine(); } }
private static void LoadCodes(bool collectDoc) { Program.languages = (IDictionary <string, EACodeLanguage>) new Dictionary <string, EACodeLanguage> (); LanguageProcessor languageProcessor = new LanguageProcessor(collectDoc, new TemplateComparer(), Program.stringComparer); IPointerMaker pointerMaker = (IPointerMaker) new GBAPointerMaker(); if (Program.RunConfig.isDirectory) { languageProcessor.ProcessCode(Program.RunConfig.rawsFolder, Program.RunConfig.rawsExtension); } else { languageProcessor.ProcessCode(Program.RunConfig.rawsFolder); } foreach (KeyValuePair <string, ICodeTemplateStorer> language in languageProcessor.Languages) { Tuple <string, List <Priority> >[][] pointerList; switch (language.Key) { case "FE6": pointerList = FE6CodeLanguage.PointerList; break; case "FE7": case "FE7J": pointerList = FE7CodeLanguage.PointerList; break; case "FE8": case "FE8J": // pointerList = DummyCodeLanguage.PointerList; pointerList = FE8CodeLanguage.PointerList; break; default: pointerList = DummyCodeLanguage.PointerList; break; // throw new NotSupportedException ("Language " + language.Key + " not supported."); } Program.languages [language.Key] = new EACodeLanguage( language.Key, pointerMaker, pointerList, language.Value, Program.stringComparer ); } }