use of de.be4.classicalb.core.parser.node.AConcatExpression in project probparsers by bendisposto.
the class RulesMachineChecker method countPlaceHoldersInExpression.
private Integer countPlaceHoldersInExpression(PExpression param) {
if (param instanceof AConcatExpression) {
AConcatExpression con = (AConcatExpression) param;
Integer left = countPlaceHoldersInExpression(con.getLeft());
Integer right = countPlaceHoldersInExpression(con.getRight());
if (left == null || right == null) {
return null;
} else {
return left + right;
}
} else if (param instanceof AStringExpression) {
AStringExpression string = (AStringExpression) param;
String content = string.getContent().getText();
String subString = "~w";
return countOccurrences(content, subString);
} else {
return null;
}
}
Aggregations