private Object lookupAndCreateTerm(Matcher res, int start)
throws PermErrorException {
for (int k = start + 1; k < res.groupCount(); k++) {
if (res.group(k) != null && k != TERM_STEP_REGEX_QUALIFIER_POS) {
TermDefinition c = (TermDefinition) matchResultPositions.get(k);
Configuration subres = new MatcherBasedConfiguration(res, k, c
.getMatchSize());
try {
return termsFactory.createTerm(c.getTermDef(), subres);
} catch (InstantiationException e) {
e.printStackTrace();