+ /**
+ * Common string splitter. Given a string representation of a grouping's name, it creates a prefix/name
+ * pair and returns it.
+ *
+ * @param groupingString Grouping string reference
+ * @param module Module which we are processing
+ * @param line Module line which we are processing
+ * @return An array of two strings, first one is the module prefix, the second is the grouping name.
+ */
+ private static String[] getPrefixAndName(final String groupingString, final ModuleBuilder module, final int line) {
+ final String[] ret = new String[2];
+
+ if (groupingString.indexOf(':') != -1) {
+ if (groupingString.indexOf('/') != -1) {
+ throw new YangParseException(module.getName(), line, "Invalid name of target grouping");
+ }
+
+ final Iterator<String> split = COLON_SPLITTER.split(groupingString).iterator();
+ ret[0] = split.next();
+ ret[1] = split.next();
+ if (split.hasNext()) {
+ throw new YangParseException(module.getName(), line, "Invalid name of target grouping");
+ }
+ } else {
+ ret[0] = module.getPrefix();
+ ret[1] = groupingString;
+ }
+
+ return ret;
+ }
+