summaryrefslogtreecommitdiff
path: root/BJC-Utils2/src/examples/java/bjc
diff options
context:
space:
mode:
authorstudent <student@192.168.1.186>2017-03-27 11:46:59 -0400
committerstudent <student@192.168.1.186>2017-03-27 11:46:59 -0400
commitf6c19bb14bf5be44c2d7bf1fef014d170f1c4343 (patch)
tree4e0f7164005a35a2029f691e30cf4a25580f61cb /BJC-Utils2/src/examples/java/bjc
parent572551b78e7f36b65185cb258bea31114d9992f6 (diff)
Update FDS
Diffstat (limited to 'BJC-Utils2/src/examples/java/bjc')
-rw-r--r--BJC-Utils2/src/examples/java/bjc/utils/examples/cli/FDSExample.java19
1 files changed, 10 insertions, 9 deletions
diff --git a/BJC-Utils2/src/examples/java/bjc/utils/examples/cli/FDSExample.java b/BJC-Utils2/src/examples/java/bjc/utils/examples/cli/FDSExample.java
index 38b9e0c..f9cf08e 100644
--- a/BJC-Utils2/src/examples/java/bjc/utils/examples/cli/FDSExample.java
+++ b/BJC-Utils2/src/examples/java/bjc/utils/examples/cli/FDSExample.java
@@ -10,8 +10,8 @@ import bjc.utils.cli.fds.SimpleFDSMode;
import bjc.utils.cli.fds.FDSState.InputMode;
import bjc.utils.ioutils.BlockReader;
import bjc.utils.ioutils.PushbackBlockReader;
-import bjc.utils.ioutils.SimpleBlockReader;
-import bjc.utils.ioutils.TriggeredBlockReader;
+
+import static bjc.utils.ioutils.BlockReaders.*;
/**
* Simple example for FDS.
@@ -31,7 +31,7 @@ public class FDSExample {
* Main method.
*
* @param args
- * Unused CLI arguments.
+ * Unused CLI arguments.
*/
public static void main(String[] args) {
System.out.println("Entering rudimentary FDS");
@@ -43,21 +43,22 @@ public class FDSExample {
InputStreamReader reader = new InputStreamReader(System.in);
try {
- BlockReader input = new SimpleBlockReader("\\R", reader);
+ BlockReader input = simple("\\R", reader);
Prompter comPrompter = new Prompter();
Prompter dataPrompter = new Prompter();
- BlockReader rawComInput = new TriggeredBlockReader(input, comPrompter);
- BlockReader rawDataInput = new TriggeredBlockReader(input, dataPrompter);
+ BlockReader rawComInput = trigger(input, comPrompter);
+ BlockReader rawDataInput = trigger(input, dataPrompter);
- PushbackBlockReader comInput = new PushbackBlockReader(rawComInput);
- PushbackBlockReader dataInput = new PushbackBlockReader(rawDataInput);
+ PushbackBlockReader comInput = pushback(rawComInput);
+ PushbackBlockReader dataInput = pushback(rawDataInput);
FDSState<TestContext> fdsState = new FDSState<>(ctx, InputMode.CHORD, comInput::addBlock,
dataInput::addBlock);
+ fdsState.modes.push(testMode);
- FDS.runFDS(comInput, dataInput, System.out, testMode, fdsState);
+ FDS.runFDS(comInput, dataInput, System.out, fdsState);
} catch (FDSException fex) {
fex.printStackTrace();
}