+ private static Integer parseMinElements(Min_elements_stmtContext ctx) {
+ Integer result = null;
+ try {
+ for (int j = 0; j < ctx.getChildCount(); j++) {
+ ParseTree minArg = ctx.getChild(j);
+ if (minArg instanceof Min_value_argContext) {
+ result = Integer.valueOf(stringFromNode(minArg));
+ }
+ }
+ if (result == null) {
+ throw new IllegalArgumentException();
+ }
+ return result;
+ } catch (Exception e) {
+ throw new YangParseException(ctx.getStart().getLine(),
+ "Failed to parse min-elements.", e);
+ }
+ }
+
+ private static Integer parseMaxElements(Max_elements_stmtContext ctx) {
+ Integer result = null;
+ try {
+ for (int j = 0; j < ctx.getChildCount(); j++) {
+ ParseTree maxArg = ctx.getChild(j);
+ if (maxArg instanceof Max_value_argContext) {
+ result = Integer.valueOf(stringFromNode(maxArg));
+ }
+ }
+ if (result == null) {
+ throw new IllegalArgumentException();
+ }
+ return result;
+ } catch (Exception e) {
+ throw new YangParseException(ctx.getStart().getLine(),
+ "Failed to parse max-elements.", e);
+ }
+ }
+