public static RegExpr createKeyword ( String str ) { int i ; RegExpr [ ] chars ; if ( str . length ( ) == 1 ) { return new Range ( str . charAt ( 0 ) ) ; } else { chars = new RegExpr [ str . length ( ) ] ; for ( i = 0 ; i < chars . length ; i ++ ) { chars [ i ] = new Range ( str . charAt ( i ) ) ; } return new Sequence ( chars ) ; } }
returns a Range for strings of length 1