modify critic

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1375 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
alfred 2006-08-24 03:02:29 +00:00
parent 821709bd1b
commit 8a5cdc3fa6
1 changed files with 43 additions and 39 deletions

View File

@ -54,45 +54,49 @@ public final class Critic {
} else if (line.matches("\\*\\*\\/")) { } else if (line.matches("\\*\\*\\/")) {
incomment = false; incomment = false;
templine.append(line + "\n"); templine.append(line + "\n");
} else if (incomment && line.contains("Routine Description:")) { } else if (incomment) {
description = true; if (line.contains("Routine Description:")) {
arguments = false; description = true;
returns = false; arguments = false;
} else if (incomment && line.contains("Arguments:")) { returns = false;
description = false; } else if (line.contains("Arguments:")) {
arguments = true; description = false;
returns = false; arguments = true;
} else if (incomment && line.contains("Returns:")) { returns = false;
description = false; } else if (line.contains("Returns:")) {
arguments = false; description = false;
returns = true; arguments = false;
} else if (incomment && description) { returns = true;
templine.append(" " + line.trim() + "\n"); } else if (description) {
} else if (incomment && arguments) { if (line.trim().length() != 0) {
mtrcommentequation = ptncommentequation.matcher(line); templine.append(" " + line.trim() + "\n");
if (mtrcommentequation.find()) { }
inequation = true; } else if (arguments) {
templine.append(" @param " + mtrcommentequation.group(1) + " " + mtrcommentequation.group(2) + "\n"); mtrcommentequation = ptncommentequation.matcher(line);
} else if (inequation && line.trim().length() == 0) { if (mtrcommentequation.find()) {
inequation = false; inequation = true;
templine.append(line + "\n"); templine.append(" @param " + mtrcommentequation.group(1) + " " + mtrcommentequation.group(2) + "\n");
} else if (inequation && line.trim().length() != 0) { } else if (inequation && line.trim().length() == 0) {
templine.append("#%#%" + line + "\n"); inequation = false;
} else { templine.append(line + "\n");
templine.append(" " + line.trim() + "\n"); } else if (inequation && line.trim().length() != 0) {
} templine.append("#%#%" + line + "\n");
} else if (incomment && returns) { } else {
mtrcommentequation = ptncommentequation.matcher(line); templine.append(" " + line.trim() + "\n");
if (mtrcommentequation.find()) { }
inequation = true; } else if (returns) {
templine.append(" @retval " + mtrcommentequation.group(1) + " " + mtrcommentequation.group(2) + "\n"); mtrcommentequation = ptncommentequation.matcher(line);
} else if (inequation && line.trim().length() == 0) { if (mtrcommentequation.find()) {
inequation = false; inequation = true;
templine.append(line + "\n"); templine.append(" @retval " + mtrcommentequation.group(1) + " " + mtrcommentequation.group(2) + "\n");
} else if (inequation && line.trim().length() != 0) { } else if (inequation && line.trim().length() == 0) {
templine.append("#%#%" + line + "\n"); inequation = false;
} else { templine.append(line + "\n");
templine.append(" " + line.trim() + "\n"); } else if (inequation && line.trim().length() != 0) {
templine.append("#%#%" + line + "\n");
} else {
templine.append(" " + line.trim() + "\n");
}
} }
} else { } else {
templine.append(line + "\n"); templine.append(line + "\n");