private static int parseGroupId(char[] data, int i, int end, Term term, HashMap<String, Integer> gmap, char closer) throws PatternSyntaxException {
        int id;
        int nstart = i;
        if (Character.isDigit(data[i])) {
            while (Character.isDigit(data[i])) {
                i++;
                if (i == end) throw new PatternSyntaxException("group_id expected");
            }
            id = makeNumber(nstart, i, data);
        } else {
            while (Category.IdentifierPart.contains(data[i])) {
                i++;
                if (i == end) throw new PatternSyntaxException("group_id expected");
            }
            String s = new String(data, nstart, i - nstart);
            Integer no = gmap.get(s);
            if (no == null) throw new PatternSyntaxException("backreference to unknown group: " + s);
            id = no;
        }
        while (Category.Space.contains(data[i])) {
            i++;
            if (i == end) throw new PatternSyntaxException("'" + closer + "' expected");
        }

        int c = data[i++];

        if (c != closer) throw new PatternSyntaxException("'" + closer + "' expected");

        term.memreg = id;
        return i;
    }
private static int parseGroupId ( char [ ] data , int i , int end , Term term , HashMap < String , Integer > gmap , char closer ) throws PatternSyntaxException { int id ; int nstart = i ; if ( Character . isDigit ( data [ i ] ) ) { while ( Character . isDigit ( data [ i ] ) ) { i ++ ; if ( i == end ) throw new PatternSyntaxException ( "group_id expected" ) ; } id = makeNumber ( nstart , i , data ) ; } else { while ( Category . IdentifierPart . contains ( data [ i ] ) ) { i ++ ; if ( i == end ) throw new PatternSyntaxException ( "group_id expected" ) ; } String s = new String ( data , nstart , i - nstart ) ; Integer no = gmap . get ( s ) ; if ( no == null ) throw new PatternSyntaxException ( "backreference to unknown group: " + s ) ; id = no ; } while ( Category . Space . contains ( data [ i ] ) ) { i ++ ; if ( i == end ) throw new PatternSyntaxException ( "'" + closer + "' expected" ) ; } int c = data [ i ++ ] ; if ( c != closer ) throw new PatternSyntaxException ( "'" + closer + "' expected" ) ; term . memreg = id ; return i ; }
/*
static boolean isIdentifierPart()
{

}