public static exprType makeAttribute(String attrString) {
List<String> dotSplit = StringUtils.dotSplit(attrString);
Assert.isTrue(dotSplit.size() > 1);
exprType first = null;
Attribute last = null;
Attribute attr = null;
for (int i = dotSplit.size() - 1; i > 0; i--) {
Call call = null;
String part = dotSplit.get(i);
if (part.endsWith("()")) {
if (i == dotSplit.size() - 1) {
part = part.substring(0, part.length() - 2);
call = new Call(null, new exprType[0], new keywordType[0], null, null);
first = call;
} else {
throw new RuntimeException("Call only accepted in the last part.");
}
}
attr = new Attribute(null, new NameTok(part, NameTok.Attrib), Attribute.Load);
if (call != null) {
call.func = attr;
}
if (last != null) {
last.value = attr;