public static int _splitArgumentList(String actionText,
	                                     int start,
	                                     int targetChar,
	                                     int separatorChar,
	                                     List<Pair<String, Integer>> args) {
		if (actionText == null) {
			return -1;
		}

		actionText = actionText.replaceAll("//[^\\n]*", "");
		int n = actionText.length();
		//System.out.println("actionText@"+start+"->"+(char)targetChar+"="+actionText.substring(start,n));
		int p = start;
		int last = p;
		while (p < n && actionText.charAt(p) != targetChar) {
			int c = actionText.charAt(p);
			switch (c) {
				case '\'':
					p++;
					while (p < n && actionText.charAt(p) != '\'') {
						if (actionText.charAt(p) == '\\' && (p + 1) < n &&
								actionText.charAt(p + 1) == '\'') {
							p++; // skip escaped quote
						}
						p++;
					}
					p++;
					break;
				case '"':
					p++;
					while (p < n && actionText.charAt(p) != '\"') {
						if (actionText.charAt(p) == '\\' && (p + 1) < n &&
								actionText.charAt(p + 1) == '\"') {
							p++; // skip escaped quote
						}
						p++;
					}
					p++;
					break;
				case '(':
					p = _splitArgumentList(actionText, p + 1, ')', separatorChar, args);
					break;
				case '{':
					p = _splitArgumentList(actionText, p + 1, '}', separatorChar, args);
					break;
				case '<':
					if (actionText.indexOf('>', p + 1) >= p) {
						// do we see a matching '>' ahead?  if so, hope it's a generic
						// and not less followed by expr with greater than
						p = _splitArgumentList(actionText, p + 1, '>', separatorChar, args);
					}
					else {
						p++; // treat as normal char
					}
					break;
				case '[':
					p = _splitArgumentList(actionText, p + 1, ']', separatorChar, args);
					break;
				default:
					if (c == separatorChar && targetChar == -1) {
						String arg = actionText.substring(last, p);
						int index = last;
						while (index < p && Character.isWhitespace(actionText.charAt(index))) {
							index++;
						}
						//System.out.println("arg="+arg);
						args.add(new Pair<String, Integer>(arg.trim(), index));
						last = p + 1;
					}
					p++;
					break;
			}
		}
		if (targetChar == -1 && p <= n) {
			String arg = actionText.substring(last, p).trim();
			int index = last;
			while (index < p && Character.isWhitespace(actionText.charAt(index))) {
				index++;
			}
			//System.out.println("arg="+arg);
			if (arg.length() > 0) {
				args.add(new Pair<String, Integer>(arg.trim(), index));
			}
		}
		p++;
		return p;
	}
Given an argument list like
<p>
x, (*a).foo(21,33), 3.2+1, '\n',
"a,oo\nick", {bl, "fdkj"eck}, ["cat\n,", x, 43]
<p>
convert to a list of attributes.  Allow nested square brackets etc...
Set separatorChar to ';' or ',' or whatever you want.
tool/src/org/antlr/v4/parse/ScopeParser.java