}
matcher = DEF_PATTERN.matcher(definition);
if (matcher.find()) {
retVal = matcher.group(2);
if(ruleMap.get(retVal) != null){
throw new InvalidDocumentException("Duplicated rule name :: " + retVal);
}
validRule = true;
String value = matcher.group(3);
Regex rule;
validRule = ((rule = parseToken(retVal, value, ruleMap)) != null);
rule = rule.close();
retVal = matcher.group(2);
if (matcher.group(1) != null) {
rule = rule.mark(retVal);
}
ruleMap.put(retVal, rule);
}
}
if (validRule == false) {
throw new InvalidDocumentException("Not a valid line :: " + definition);
}
}
in.close();
return retVal;