private void parseLine(CNode root, String line, NormalizedDefinition nd) throws IllegalArgumentException {
        line = NormalizedDefinition.normalize(line);
        line = line.trim();
        if (line.length() == 0) {
            // If having empty lines in between comments, that is logically a break in the comment too
            if (!comment.isEmpty()) {
                comment += "\n";
            }
            return;
        }
        Matcher commentMatch = commentPattern.matcher(line);
        if (commentMatch.matches()) {
            parseCommentLine(commentMatch);
            return;
        }
        Matcher versionMatch = versionPattern.matcher(line);
        if (versionMatch.matches()) {
            printSystemErr("Warning: In config definition '" + name + "': version is deprecated and ignored, please remove, support will be removed in Vespa 9");
            return;
        }
        Matcher namespaceMatcher = namespacePattern.matcher(line);
        if (namespaceMatcher.matches()) {
            parseNamespaceLine(namespaceMatcher.group(2));
            nd.addNormalizedLine(line);
            return;
        }
        Matcher packageMatcher = packagePattern.matcher(line);
        if (packageMatcher.matches()) {
            parsePackageLine(packageMatcher.group(2));
            nd.addNormalizedLine(line);
            return;
        }
        // Only add lines that are not namespace or comment lines
        nd.addNormalizedLine(line);
        DefLine defLine = new DefLine(line, systemErrEnabled);
        root.setLeaf(root.getName() + "." + defLine.getName(), defLine, comment);
        comment = "";
    }
Parses one line from def-file and adds it to the tree.
TODO: Method too long!

@param root     The root CNode in the tree.
@param line     A line from the def-file.
@param nd       A NormalizedDefinition object
@throws IllegalArgumentException upon error in line.
configgen/src/main/java/com/yahoo/config/codegen/DefParser.java