annotations.add(curLine);
// System.out.println(curLine);
// Initial settings for matching lines
- // "\*/( |\t)*$"
- Pattern regexpEnd = Pattern.compile("\\*/( |\\t)*$");
+ // "\*/\s*$"
+ Pattern regexpEnd = Pattern.compile("\\*/\\s*$");
Matcher matcher = regexpEnd.matcher(curLine);
- if (matcher.find()) { // The beginning line is also the end line
- annotations.add(curLine);
+ if (matcher.find()) {
+ // The beginning line is also the end line
+ // In this case, we have already add the curLine
return annotations;
} else {
try {
lineReader = new LineNumberReader(br);
// "/\*\*\s*@(DeclareState|Interface)"
Pattern regexpBegin = Pattern
- .compile("/\\*\\*\\s*@(DeclareState|Interface|Define)");
+ .compile("/\\*\\*\\s*@(DeclareState|Interface|PreCondition|Transition|PostCondition|Define)");
Matcher matcher = regexpBegin.matcher("");
String line;
if (constructName.equals(SpecNaming.DeclareState)) {
extractGlobalConstruct(file, lineReader, line,
beginLineNum);
- } else if (constructName.equals(SpecNaming.Interface)) {
+ } else if (constructName.equals(SpecNaming.Interface)
+ || constructName.equals(SpecNaming.PreCondition)
+ || constructName.equals(SpecNaming.Transition)
+ || constructName.equals(SpecNaming.PostCondition)) {
extractInterfaceConstruct(file, lineReader, line,
beginLineNum);
} else if (constructName.equals(SpecNaming.Define)) {