Class StructuredConsole
java.lang.Object
com.singularsys.jepexamples.consoles.Console
com.singularsys.extexamples.consoles.StructuredConsole
A console application illustrating the structured programming features
in the
com.singularsys.extensions.structure package.
Since Jep 4.1 this now supports single quote strings and comments starting with a #.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassClass to add a print function.classClass to add a print function.Nested classes/interfaces inherited from class com.singularsys.jepexamples.consoles.Console
Console.JepOutputStream, Console.JepPrintStream, Console.NodeRes, Console.SPEC_ACTION -
Field Summary
Fields inherited from class com.singularsys.jepexamples.consoles.Console
altered, doubleFormat, history, jep, showHistory -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsets up all the needed objects.static voidvoidPrint help message.voidPrints introductory text.processEquation(Node node) Performs the required operation on a node.voidSets the evaluator used.voidShows a summary of function, operator, variable and constant calls.voidshowTree()Shows the call tree with counts and times.Methods inherited from class com.singularsys.jepexamples.consoles.Console
clearVars, finaliseCommand, getCommand, getHistory, getJep, getPrompt, handleError, inputLoop, parseEvaluate, print, printFunctionEntry, printFuns, printHistory, println, printOps, printStdHelp, printVars, processCommand, run, setAlteredCommand, setFormat, setFormat, setIndexShift, setMonitor, split, testSpecialCommands, toString
-
Constructor Details
-
StructuredConsole
public StructuredConsole()
-
-
Method Details
-
initialise
public void initialise()Description copied from class:Consolesets up all the needed objects.- Overrides:
initialisein classConsole
-
setEvaluator
Description copied from class:ConsoleSets the evaluator used. Default method simple callsJep.setComponent(com.singularsys.jep.JepComponent)with the evaluator.- Overrides:
setEvaluatorin classConsole- Parameters:
ev- the evaluator to use
-
showCalls
public void showCalls()Description copied from class:ConsoleShows a summary of function, operator, variable and constant calls. -
showTree
public void showTree()Description copied from class:ConsoleShows the call tree with counts and times. -
processEquation
Description copied from class:ConsolePerforms the required operation on a node. Typically, evaluates the node and prints the value.- Overrides:
processEquationin classConsole- Parameters:
node- Node representing expression- Returns:
- The result of the calculation
- Throws:
JepException- if a Parse or evaluation error
-
printHelp
public void printHelp()Description copied from class:ConsolePrint help message. -
main
- Parameters:
args-
-
printIntroText
public void printIntroText()Description copied from class:ConsolePrints introductory text.- Overrides:
printIntroTextin classConsole
-