public static List<ClangLine> toLines(ClangTokenGroup group) {

		List<ClangNode> alltoks = new ArrayList<>();
		group.flatten(alltoks);
		if (alltoks.isEmpty()) {
			return new ArrayList<>();
		}

		int i = 0;
		int lineNumber = 1;
		ClangBreak brk;
		ClangLine current;
		ArrayList<ClangLine> lines = new ArrayList<>();
		if (alltoks.get(0) instanceof ClangBreak) { // If first token is linebreak
			brk = (ClangBreak) alltoks.get(0);
			current = new ClangLine(lineNumber++, brk.getIndent()); // use its indent
			i += 1;
		}
		else {
			current = new ClangLine(lineNumber++, 0); // otherwise use zero indent
		}

		StringBuilder commentBuilder = new StringBuilder();
		for (; i < alltoks.size(); ++i) {

			ClangToken tok = (ClangToken) alltoks.get(i);
			if (tok instanceof ClangBreak) {
				lines.add(current);
				brk = (ClangBreak) tok;
				current = new ClangLine(lineNumber++, brk.getIndent());
			}
			else if (tok instanceof ClangCommentToken) {
				i = consumeCommentTokens(alltoks, i, (ClangCommentToken) tok, current,
					commentBuilder);
				i -= 1;
			}
			else {
				tok.setLineParent(current);
				current.addToken(tok);
			}
		}

		lines.add(current);
		return lines;
	}
A token hierarchy is flattened and then split into individual lines at the
ClangBreak tokens.  An array of the lines, each as a ClangLine object that owns
its respective tokens, is returned.  Sequences of comment tokens are collapsed into
a single ClangCommentToken.
@param group is the token hierarchy
@return the array of ClangLine objects
Ghidra/Features/Decompiler/src/main/java/ghidra/app/decompiler/component/DecompilerUtils.java