code: public static Pair<TregexPattern, TsurgeonPattern> getOperationFromReader(BufferedReader reader, TregexPatternCompiler compiler) throws IOException {
      String patternString = getPatternFromFile(reader);
      // System.err.println("Read tregex pattern: " + patternString);
      if ("".equals(patternString)) {
        return null;
      }
      TregexPattern matchPattern = compiler.compile(patternString);
  
      TsurgeonPattern collectedPattern = getTsurgeonOperationsFromReader(reader);
      return new Pair<TregexPattern,TsurgeonPattern>(matchPattern,collectedPattern);
    }
docs: Parses a tsurgeon script text input and compiles a tregex pattern and a list
  of tsurgeon operations into a pair.
  
  @param reader Reader to read patterns from
  @return A pair of a tregex and tsurgeon pattern read from a file, or <code>null</code>
  when the operations in the Reader have been exhausted
  @throws IOException If any IO problem