- while (ii.hasNext()) {\r
- StringBuffer wholefile = new StringBuffer();\r
- ifile = ii.next();\r
- rd = new BufferedReader(new FileReader(modulepath + File.separator + "temp" + File.separator + ifile));\r
- while ((line = rd.readLine()) != null) {\r
- wholefile.append(line + '\n');\r
- }\r
- line = wholefile.toString();\r
- \r
- // if this is a Pei phase module , add these library class to .msa\r
- matentrypoint = patentrypoint.matcher(line);\r
- if (matentrypoint.find()) {\r
- entrypoint = matentrypoint.group(2);\r
- if (matentrypoint.group(1).matches("PEIM")) {\r
- hashrequiredr9libs.add("PeimEntryPoint");\r
- } else {\r
- hashrequiredr9libs.add("UefiDriverEntryPoint");\r
- }\r
- }\r
- \r
- // find guid\r
- matguid = Guid.ptnguid.matcher(line); // several ways to implement this , which one is faster ? :\r
- while (matguid.find()) { // 1.currently , find once , then call to identify which is it\r
- if ((temp = Guid.register(matguid, this, db)) != null) { // 2.use 3 different matchers , search 3 times to find each\r
- //matguid.appendReplacement(result, db.getR9Guidname(temp)); // search the database for all 3 kinds of guids , high cost\r
- }\r
- }\r
- //matguid.appendTail(result);\r
- //line = result.toString();\r
+ ModuleReader.ModuleScan(mi);\r
+ //ModuleInfo.ui.yesOrNo("go on replace?");\r
+ SourceFileReplacer.flush(mi); // some adding library actions are taken here,so it must be put before "MsaWriter"\r