public void run() {
        try {
            System.out.println("Prolog Interpreter 0.9: ");
            System.out.println(" Type 'exit.' to quit this application.");
            System.out.println(" Type '[...].' to load a file containing facts and rules.");
            System.out.println(" Otherwise just enter a Prolog query.");
            System.out.println(" (Note that you can load some default rules if you enter '[classpath:/family].')");
            System.out.print("> ");

            ParserReader reader = new ParserReader('.');
            reader.read(console, new ParserReader.ParserHandler() {
                public boolean handleContent(String content) throws IOException, ParseException {
                    content = content.trim();

                    if (content.equals("exit.")) {
                        return false;
                    } else if (content.startsWith("[") && content.endsWith("].")) {
                        String file = content.substring(1, content.length() - 2) + ".pl";
                        loadFile(file);
                    } else {
                        content = content.substring(0, content.indexOf('.'));
                        proveQuery(content);
                    }

                    System.out.print("> ");
                    return true;
                }
            });
        } catch (IOException ex) {
            ex.printStackTrace();
        } catch (ParseException ex) {
            ex.printStackTrace();
        }
    }