String errorMsg = "Error: unable to parse rewriting rule, check the existence of feature 'sem'";
logger.error(errorMsg);
throw new Exception(errorMsg);
}
Semantics sem = InputReader.readSemantics(semStr);
RuleOperator operator = null;
if (name.equals("add"))
operator = new AddOperator(sem);
else if (name.equals("del"))
operator = new DelOperator(sem);
else if (name.equals("replace-by"))
operator = new ReplaceOperator(sem, matchRule.getMatch());
else if (name.equals("replace"))
{
Semantics by = InputReader.readSemantics(attributes.getValue("by"));
operator = new ReplaceOperator(by, sem);
}
operator.addConstants(newConstValues);
matchRule.addOperator(operator);
}