use of org.grupolys.samulan.analyser.operation.ShiftOperation in project uuusa by aghie.
the class RuleManager method parseShiftOperation.
private Operation parseShiftOperation(String operation, String form) {
ShiftOperation successor = null;
ScopeStrategy strategy = null;
float shiftValue;
Pattern p = Pattern.compile("(\\(.*\\))");
Matcher m = p.matcher(operation);
m.find();
String[] parameters = m.group(1).replace("(", "").replace(")", "").split(",");
if (parameters[0].equals(SENTIDATA)) {
shiftValue = this.d.getValue(Operation.SHIFT, form, true);
} else
shiftValue = Float.parseFloat(parameters[0]);
for (int i = parameters.length - 1; i >= 0; i--) {
strategy = getScopeStrategy(parameters[i], parameters);
successor = new ShiftOperation(null, strategy, successor, shiftValue);
successor.setAlwaysShift(isAlwaysShift());
}
return successor;
}
Aggregations