summaryrefslogtreecommitdiff
path: root/dice-lang/src/bjc/dicelang/scl/StreamEngine.java
diff options
context:
space:
mode:
authorbjculkin <bjculkin@mix.wvu.edu>2017-04-11 17:51:13 -0400
committerbjculkin <bjculkin@mix.wvu.edu>2017-04-11 17:51:13 -0400
commit40858cee415643769ee5f6216b0cd4335996ff2f (patch)
tree86b1c334fa2e5b79cddc16984f5ad43c3c72e41f /dice-lang/src/bjc/dicelang/scl/StreamEngine.java
parent767ca1b248da19b754d42a814b71b43ef16090be (diff)
General cleanup and fixes
Diffstat (limited to 'dice-lang/src/bjc/dicelang/scl/StreamEngine.java')
-rw-r--r--dice-lang/src/bjc/dicelang/scl/StreamEngine.java26
1 files changed, 25 insertions, 1 deletions
diff --git a/dice-lang/src/bjc/dicelang/scl/StreamEngine.java b/dice-lang/src/bjc/dicelang/scl/StreamEngine.java
index f8d6e09..26b99c4 100644
--- a/dice-lang/src/bjc/dicelang/scl/StreamEngine.java
+++ b/dice-lang/src/bjc/dicelang/scl/StreamEngine.java
@@ -71,10 +71,11 @@ public class StreamEngine {
}
/**
- * Process a possibly interleaved set of streams from toks into dest.
+ * Process a possibly interleaved set of streams.
*
* @param toks
* The raw token to read streams from.
+ *
* @param dest
* The list to write the final stream to.
*
@@ -120,10 +121,18 @@ public class StreamEngine {
return true;
}
+ /**
+ * Create a new stream.
+ */
public void newStream() {
streams.insertAfter(new FunctionalList<>());
}
+ /**
+ * Move to a stream to the right.
+ *
+ * @return Whether or not the move was successful.
+ */
public boolean rightStream() {
if(!streams.right()) {
Errors.inst.printError(EK_STRM_NONEX);
@@ -134,6 +143,11 @@ public class StreamEngine {
return true;
}
+ /**
+ * Move to a stream to the left.
+ *
+ * @return Whether or not the move was successful.
+ */
public boolean leftStream() {
if(!streams.left()) {
Errors.inst.printError(EK_STRM_NONEX);
@@ -144,6 +158,11 @@ public class StreamEngine {
return true;
}
+ /**
+ * Delete the current stream.
+ *
+ * @return Whether or not the delete succeeded.
+ */
public boolean deleteStream() {
if(streams.size() == 1) {
Errors.inst.printError(EK_STRM_LAST);
@@ -156,6 +175,11 @@ public class StreamEngine {
return true;
}
+ /**
+ * Merge the current stream into the previous stream.
+ *
+ * @return Whether or not the merge succeded.
+ */
public boolean mergeStream() {
if(streams.size() == 1) {
Errors.inst.printError(EK_STRM_LAST);