modify critic

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1312 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
alfred 2006-08-17 10:22:09 +00:00
parent 35a9542410
commit 63406ead63
1 changed files with 7 additions and 6 deletions

View File

@ -17,7 +17,7 @@ import java.io.*;
public class Critic implements Common.ForDoAll {
private static Pattern ptnheadcomment = Pattern.compile("^\\/\\*\\+\\+(.*?)\\-\\-\\*\\/",Pattern.DOTALL);
private static Pattern ptnfunccomment = Pattern.compile("([\\w\\d]*\\s*[_\\w][_\\w\\d]*\\s*\\([^\\)\\(]*\\)\\s*)\\/\\*\\+\\+(.*?)\\-\\-\\*\\/(\\s*.*?)([\\{;])",Pattern.DOTALL);
private static Pattern ptnfunccomment = Pattern.compile("([\\};\\/]\\s*)([\\w\\s]*?[_\\w][_\\w\\d]*\\s*\\([^\\)\\(]*\\)\\s*)\\/\\*\\+\\+(.*?)\\-\\-\\*\\/(\\s*.*?)([\\{;])",Pattern.DOTALL);
//private static Pattern ptncommentstructure = Pattern.compile("\\/\\*\\+\\+\\s*Routine Description:\\s*(.*?)\\s*Arguments:\\s*(.*?)\\s*Returns:\\s*(.*?)\\s*\\-\\-\\*\\/",Pattern.DOTALL);
private static Pattern ptninfequation = Pattern.compile("([^\\s]*)\\s*-\\s*(.*)\\s*");
private static Matcher mtrinfequation;
@ -36,8 +36,9 @@ public class Critic implements Common.ForDoAll {
System.out.println("Criticing " + filepath);
String wholeline = Common.file2string(filepath);
wholeline = wholeline.replaceAll("\t", " ");
wholeline = Common.replaceAll(wholeline, ptnheadcomment, "/** @file$1**/");
wholeline = Common.replaceAll(wholeline, ptnfunccomment, "/**$2**/$3$1$4");
wholeline = Common.replaceAll(wholeline, ptnfunccomment, "$1/**$3**/$4$2$5");
//wholeline = Common.replaceAll(wholeline, ptncommentstructure, "/**\n#%\n$1\n%#\n#%%\n$2\n%%#\n#%%%\n$3\n%%%#\n**/");
rd = new BufferedReader(new StringReader(wholeline));