private Integer consumeSize(
DmdlSemantics environment, AstAttribute attribute,
Map<String, AstAttributeElement> elements,
String key, long min, long max) {
AstLiteral size = take(environment, attribute, elements, key, LiteralKind.INTEGER);
if (size != null) {
String label = label(key);
BigInteger value = size.toIntegerValue();
if (AttributeUtil.checkRange(environment, size, label, value, min, max)) {
return value.intValue();
}
}
return null;