// Add generic whitespace rule.
rules.add(new WhitespaceRule(new JavaWhitespaceDetector()));
// Add word rule for keywords, types, and constants.
WordRule wordRule = new WordRule(new JavaWordDetector(), other);
List<String> keywords = Keywords.getValues(Keywords.KEYWORDS);
for( int i = 0; i < keywords.size(); i++ )
wordRule.addWord(keywords.get(i), keywordTok);