Class ProjogConsole
java.lang.Object
org.projog.tools.ProjogConsole
Command line interface to Prolog.

Provides a mechanism for users to interact with Projog via a read-evaluate-print loop (REPL).

-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate final Scannerprivate final PrintStreamprivate final Projogprivate booleanprivate static final PredicateKeyCommand user can enter to exit the console application.private static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidconsultScript(String startupScriptName) private voidconsultScripts(List<String> scriptFilenames) private booleanevaluateOnce(QueryResult r, Set<String> variableIds) ReturnstrueifQueryResultcan be re-triedprivate static booleanisNotEmpty(String input) static voidprivate voidparseAndExecute(String inputSyntax) private voidprintOutcome(boolean success, long timing) private voidprivate voidprintVariableAssignments(QueryResult r, Set<String> variableIds) private void(package private) voidprivate boolean
-
Field Details
-
QUIT_COMMAND
Command user can enter to exit the console application. -
CONTINUE_EVALUATING
- See Also:
-
STOP_EVALUATING
- See Also:
-
in
-
out
-
projog
-
quit
private boolean quit
-
-
Constructor Details
-
ProjogConsole
ProjogConsole(InputStream in, PrintStream out)
-
-
Method Details
-
run
- Throws:
IOException
-
printPrompt
private void printPrompt() -
isNotEmpty
-
consultScripts
-
consultScript
-
parseAndExecute
-
shouldContinue
private boolean shouldContinue() -
processThrowable
-
evaluateOnce
ReturnstrueifQueryResultcan be re-tried -
printVariableAssignments
-
printOutcome
private void printOutcome(boolean success, long timing) -
main
- Throws:
IOException
-