you should consider making this static. Something like:

    public static Grammar getGrammarFor(Context context, Definition def) {
        KSyntaxToGrammarStatesFilter filter = new KSyntaxToGrammarStatesFilter(context);
        fllter.accept(def);
        filter.grammar.addWhitespace();
        filter.grammar.compile(); 
        return filter.grammar;

Then you could make the constructor for this visitor private. As far as I can tell this is the only usage pattern we ever expect to have for this class...