public static Pair<Integer, Integer> _parsePrefixDecl(Attribute attr, String decl, ActionAST a, Grammar g) {
		// walk backwards looking for start of an ID
		boolean inID = false;
		int start = -1;
		for (int i = decl.length() - 1; i >= 0; i--) {
			char ch = decl.charAt(i);
			// if we haven't found the end yet, keep going
			if (!inID && Character.isLetterOrDigit(ch)) {
				inID = true;
			}
			else if (inID && !(Character.isLetterOrDigit(ch) || ch == '_')) {
				start = i + 1;
				break;
			}
		}
		if (start < 0 && inID) {
			start = 0;
		}
		if (start < 0) {
			g.tool.errMgr.grammarError(ErrorType.CANNOT_FIND_ATTRIBUTE_NAME_IN_DECL, g.fileName, a.token, decl);
		}

		// walk forward looking for end of an ID
		int stop = -1;
		for (int i = start; i < decl.length(); i++) {
			char ch = decl.charAt(i);
			// if we haven't found the end yet, keep going
			if (!(Character.isLetterOrDigit(ch) || ch == '_')) {
				stop = i;
				break;
			}
			if (i == decl.length() - 1) {
				stop = i + 1;
			}
		}

		// the name is the last ID
		attr.name = decl.substring(start, stop);

		// the type is the decl minus the ID (could be empty)
		attr.type = decl.substring(0, start);
		if (stop <= decl.length() - 1) {
			attr.type += decl.substring(stop, decl.length());
		}

		attr.type = attr.type.trim();
		if (attr.type.length() == 0) {
			attr.type = null;
		}
		return new Pair<Integer, Integer>(start, stop);
	}
For decls like "String foo" or "char *foo32[]" compute the ID
and type declarations.  Also handle "int x=3" and 'T t = new T("foo")'
but if the separator is ',' you cannot use ',' in the initvalue
unless you escape use "\," escape.
tool/src/org/antlr/v4/parse/ScopeParser.java