public class TextUI extends Object
Modifier and Type | Field and Description |
---|---|
protected static boolean |
DEBUG
Turn this on to see stack traces upon errors.
|
protected PrintWriter |
output_
The current output stream
|
protected Stack<ZLiveResult> |
stack_ |
protected ZLive |
zlive_
The animator engine
|
Constructor and Description |
---|
TextUI(ZLive zlive,
PrintWriter output)
Constructs a new ZLive textual user interface.
|
Modifier and Type | Method and Description |
---|---|
void |
doApplyRule(String args)
Implements the 'apply rulename expr' command.
|
void |
doConjectures()
Tries to prove all the conjectures in the current section.
|
void |
doEvalExprPred(String args,
PrintWriter out) |
String |
doLoadSpec(String filename)
Loads the given specification file into ZLive.
|
protected void |
doMove(int offset) |
void |
doUnknownCmd(String cmd,
String args)
This is called for commands that processCmd does not handle.
|
PrintWriter |
getOutput()
The current output stream for messages and errors.
|
ZLive |
getZLive()
Get the instance of ZLive that is used for evaluation.
|
static void |
main(String[] args)
main entry point, which runs ZLive with System.in and System.out.
|
void |
mainLoop(BufferedReader input)
The main read-process loop.
|
net.sourceforge.czt.z.ast.Expr |
parseExpr(String args,
PrintWriter out)
Same as parseTerm, but insists on the result being an Expr.
|
net.sourceforge.czt.base.ast.Term |
parseTerm(String args,
PrintWriter out)
Parses and typechecks the string args into a Pred or an Expr.
|
void |
printHelp(PrintWriter out)
Prints the ZLive help/usage message
|
void |
printSettings(PrintWriter out)
Prints the current values of all the ZLive settings.
|
void |
printSettingsHelp(PrintWriter out)
Prints a help message about all the settings.
|
String |
printTerm(net.sourceforge.czt.base.ast.Term term,
net.sourceforge.czt.session.Markup markup) |
void |
printTypes(String sectName)
Prints the names and types of the definitions in the given section.
|
void |
processCmd(String cmd,
String args)
Process one input command.
|
void |
setOutput(PrintWriter output)
Set the current output writer.
|
void |
setSetting(String name,
String value)
Set one of the ZLive settings to the given value.
|
net.sourceforge.czt.base.ast.Term |
unfoldTerm(net.sourceforge.czt.base.ast.Term term)
Returns the preprocessed form of a term, before evaluation
starts.
|
protected ZLive zlive_
protected static boolean DEBUG
protected PrintWriter output_
protected Stack<ZLiveResult> stack_
public TextUI(ZLive zlive, PrintWriter output)
zlive
- The animation engine.output
- The output writer (optional).public ZLive getZLive()
public PrintWriter getOutput()
public void setOutput(PrintWriter output)
public static void main(String[] args) throws IOException, net.sourceforge.czt.session.CommandException
IOException
net.sourceforge.czt.session.CommandException
public void mainLoop(BufferedReader input) throws IOException
IOException
public void processCmd(String cmd, String args)
public void doUnknownCmd(String cmd, String args)
cmd
- args
- public String doLoadSpec(String filename) throws net.sourceforge.czt.session.CommandException
net.sourceforge.czt.session.CommandException
public void doEvalExprPred(String args, PrintWriter out) throws IOException, net.sourceforge.czt.session.CommandException
IOException
net.sourceforge.czt.session.CommandException
protected void doMove(int offset)
public void doConjectures() throws net.sourceforge.czt.session.CommandException
net.sourceforge.czt.session.CommandException
public void doApplyRule(String args) throws net.sourceforge.czt.session.CommandException, IOException, UnboundJokerException
args
- net.sourceforge.czt.session.CommandException
IOException
UnboundJokerException
public void printSettings(PrintWriter out)
public void printSettingsHelp(PrintWriter out)
public void setSetting(String name, String value) throws net.sourceforge.czt.session.CommandException
net.sourceforge.czt.session.CommandException
public void printHelp(PrintWriter out)
public void printTypes(String sectName) throws net.sourceforge.czt.session.CommandException
net.sourceforge.czt.session.CommandException
public String printTerm(net.sourceforge.czt.base.ast.Term term, net.sourceforge.czt.session.Markup markup)
public net.sourceforge.czt.base.ast.Term parseTerm(String args, PrintWriter out) throws IOException, net.sourceforge.czt.session.CommandException
args
- String containing an expression or predicateout
- Where to print error and progress messages.IOException
net.sourceforge.czt.session.CommandException
public net.sourceforge.czt.z.ast.Expr parseExpr(String args, PrintWriter out) throws IOException, net.sourceforge.czt.session.CommandException
IOException
net.sourceforge.czt.session.CommandException
public net.sourceforge.czt.base.ast.Term unfoldTerm(net.sourceforge.czt.base.ast.Term term) throws net.sourceforge.czt.session.CommandException, EvalException, UnboundJokerException
net.sourceforge.czt.session.CommandException
EvalException
UnboundJokerException
Copyright © 2003–2016 Community Z Tools Project. All rights reserved.