private static IGrammar createGrammar(boolean generateTree, int grammarVersion, char[] charArray) {
IGrammar grammar;
FastCharStream in = new FastCharStream(charArray);
switch (grammarVersion) {
case IPythonNature.GRAMMAR_PYTHON_VERSION_2_4:
grammar = new PythonGrammar24(generateTree, in);
break;
case IPythonNature.GRAMMAR_PYTHON_VERSION_2_5:
grammar = new PythonGrammar25(generateTree, in);
break;
case IPythonNature.GRAMMAR_PYTHON_VERSION_2_6: