public override List <string> Decode(BinaryReader reader) { AxData data = null; AxData.FromStream(reader.BaseStream); try { global::KttK.HspDecompiler.HspConsole.Write("ヘッダー解析中..."); data = AxData.FromStream(reader.BaseStream); global::KttK.HspDecompiler.HspConsole.Write("解析中..."); data.Decompile(); } catch (SystemException e) { throw new HspDecoderException("AxData", "想定外のエラー", e); } List <string> lines = data.GetLines(); return(data.GetLines()); }
// internal List<string> Decode(string axPath) #if AllowDecryption // internal List<string> DecodeAndDecrypt(BinaryReader reader,int fileSize) #endif public override List <string> Decode(BinaryReader reader) { AxData data = new AxData(); LexicalAnalyzer lex = null; TokenCollection stream = null; SyntacticAnalyzer synt = null; List <LogicalLine> lines = null; List <string> stringLines = new List <string>(); try { global::KttK.HspDecompiler.HspConsole.Write("ヘッダー解析中..."); data.LoadStart(reader, dictionary); data.ReadHeader(); global::KttK.HspDecompiler.HspConsole.Write("プリプロセッサ解析中..."); data.ReadPreprocessor(dictionary); global::KttK.HspDecompiler.HspConsole.Write("字句解析中..."); lex = new LexicalAnalyzer(dictionary); stream = lex.Analyze(data); data.LoadEnd(); global::KttK.HspDecompiler.HspConsole.Write("構文解析中..."); synt = new SyntacticAnalyzer(); lines = synt.Analyze(stream, data); global::KttK.HspDecompiler.HspConsole.Write("出力ファイル作成中..."); foreach (LogicalLine line in lines) { if (line.Visible) { string str = new string('\t', line.TabCount); stringLines.Add(str + line.ToString()); } } } catch (SystemException e) { throw new HspDecoderException("AxData", "想定外のエラー", e); } return(stringLines); }