public void processFile(String top, String subPath) throws FileNotFoundException, UnsupportedEncodingException {
String filePath = subPath == null ? top : top + File.separator + subPath;
FileInputStream fis = new FileInputStream(new File(filePath));
InputStreamReader isr = new InputStreamReader(fis/*, "UTF8"*/);
SGFParser parser = new SGFParser(isr);
while (true) {
int offset = parser.getCharsConsumed();
// parse file to get tree
SGFNode tree = null;
try {
tree = parser.parse();
} catch (SGFEOFException e) {
// DO NOTHING
break;
} catch (SGFParseError e) {
System.out.println("Parse error " + filePath + ":" + e.getMessage());