private static void unlink(PythonLexer lexer, PythonParser parser) {
   ATNSimulator simulator = parser.getInterpreter();
   simulator.clearDFA();
   lexer.setInterpreter(
       new LexerATNSimulator(
           lexer,
           lexer.getATN(),
           lexer.getInterpreter().decisionToDFA,
           new PredictionContextCache()));
   parser.setInterpreter(
       new ParserATNSimulator(
           parser,
           parser.getATN(),
           parser.getInterpreter().decisionToDFA,
           new PredictionContextCache()));
 }
  public static ParserRuleContext getParseTree(String fileName) throws Exception {
    FileOpener fo = new FileOpener(fileName);
    String contents = fo.getTrimmedContents();

    org.antlr.v4.runtime.CharStream input = new org.antlr.v4.runtime.ANTLRInputStream(contents);
    PythonLexer lexer = new PythonLexer(input);

    org.antlr.v4.runtime.CommonTokenStream tokens =
        new org.antlr.v4.runtime.CommonTokenStream(lexer);
    PythonParser parser = new PythonParser(tokens);
    parser.setErrorHandler(new BailErrorStrategy());

    try {
      ParserRuleContext context = parser.file_input();
      File2Tree.unlink(lexer, parser);
      return context;
    } catch (Exception ex) {
      File2Tree.unlink(lexer, parser);
      throw ex;
    }
  }