private static StreamTokenizer createTokenizer(String s){
  StreamTokenizer st=new StreamTokenizer(new StringReader(s));
  st.resetSyntax();
  st.wordChars('a','z');
  st.wordChars('A','Z');
  st.wordChars('.','.');
  st.wordChars('0','9');
  st.wordChars('_','_');
  st.wordChars('$','$');
  st.wordChars(128 + 32,255);
  st.whitespaceChars(0,' ');
  st.lowerCaseMode(false);
  st.ordinaryChar('/');
  st.slashSlashComments(false);
  st.slashStarComments(false);
  return st;
}

private static StreamTokenizer createTokenizer ( String s ) { StreamTokenizer st = new StreamTokenizer ( new StringReader ( s ) ) ; st . resetSyntax ( ) ; st . wordChars ( 'a' , 'z' ) ; st . wordChars ( 'A' , 'Z' ) ; st . wordChars ( '.' , '.' ) ; st . wordChars ( '0' , '9' ) ; st . wordChars ( '_' , '_' ) ; st . wordChars ( '$' , '$' ) ; st . wordChars ( 128 + 32 , 255 ) ; st . whitespaceChars ( 0 , ' ' ) ; st . lowerCaseMode ( false ) ; st . ordinaryChar ( '/' ) ; st . slashSlashComments ( false ) ; st . slashStarComments ( false ) ; return st ; }
returns tokenizer for parsing given string . the tokenizer is configured similarly to that used by sun . security . provider . policyparser , except that comments are disabled and no quote character is set ( yet ) .
