-// public static List<RefineHolder> parseRefines(Uses_stmtContext ctx) {
-// List<RefineHolder> refines = new ArrayList<RefineHolder>();
-//
-// for (int i = 0; i < ctx.getChildCount(); i++) {
-// ParseTree child = ctx.getChild(i);
-// if (child instanceof Refine_stmtContext) {
-// final String refineTarget = stringFromNode(child);
-// final RefineHolder refine = new RefineHolder(refineTarget);
-// for (int j = 0; j < child.getChildCount(); j++) {
-// ParseTree refinePom = child.getChild(j);
-// if (refinePom instanceof Refine_pomContext) {
-// for (int k = 0; k < refinePom.getChildCount(); k++) {
-// ParseTree refineStmt = refinePom.getChild(k);
-// if (refineStmt instanceof Refine_leaf_stmtsContext) {
-// parseRefine(refine,
-// (Refine_leaf_stmtsContext) refineStmt);
-// } else if (refineStmt instanceof Refine_container_stmtsContext) {
-// parseRefine(
-// refine,
-// (Refine_container_stmtsContext) refineStmt);
-// } else if (refineStmt instanceof Refine_list_stmtsContext) {
-// parseRefine(refine,
-// (Refine_list_stmtsContext) refineStmt);
-// } else if (refineStmt instanceof Refine_leaf_list_stmtsContext) {
-// parseRefine(
-// refine,
-// (Refine_leaf_list_stmtsContext) refineStmt);
-// } else if (refineStmt instanceof Refine_choice_stmtsContext) {
-// parseRefine(refine,
-// (Refine_choice_stmtsContext) refineStmt);
-// } else if (refineStmt instanceof Refine_anyxml_stmtsContext) {
-// parseRefine(refine,
-// (Refine_anyxml_stmtsContext) refineStmt);
-// }
-// }
-// }
-// }
-// refines.add(refine);
-// }
-// }
-// return refines;
-// }
+ /**
+ * Check this base type.
+ *
+ * @param typeName
+ * base YANG type name
+ * @param moduleName
+ * name of current module
+ * @param line
+ * line in module
+ * @throws YangParseException
+ * if this is one of YANG type which MUST contain additional
+ * informations in its body
+ */
+ public static void checkMissingBody(final String typeName,
+ final String moduleName, final int line) throws YangParseException {
+ if ("decimal64".equals(typeName)) {
+ throw new YangParseException(moduleName, line,
+ "The 'fraction-digits' statement MUST be present if the type is 'decimal64'.");
+ } else if ("identityref".equals(typeName)) {
+ throw new YangParseException(moduleName, line,
+ "The 'base' statement MUST be present if the type is 'identityref'.");
+ } else if ("leafref".equals(typeName)) {
+ throw new YangParseException(moduleName, line,
+ "The 'path' statement MUST be present if the type is 'leafref'.");
+ } else if("bits".equals(typeName)) {
+ throw new YangParseException(moduleName, line,
+ "The 'bit' statement MUST be present if the type is 'bits'.");
+ } else if("enumeration".equals(typeName)) {
+ throw new YangParseException(moduleName, line,
+ "The 'enum' statement MUST be present if the type is 'enumeration'.");
+ }
+ }