summaryrefslogtreecommitdiff
path: root/JPratt/src/main/java/bjc/pratt/blocks/RepeatingParseBlock.java
diff options
context:
space:
mode:
authorbjculkin <bjculkin@mix.wvu.edu>2018-02-15 15:25:09 -0500
committerbjculkin <bjculkin@mix.wvu.edu>2018-02-15 15:25:09 -0500
commit5028ad9a1faad0e363d017f18363e8062ba59871 (patch)
tree80df30dc24a2cd79abf7533b98fcfcd28b1f4fee /JPratt/src/main/java/bjc/pratt/blocks/RepeatingParseBlock.java
parent1112bb1b44bb3aabe439a2b9f88a51a9c1e435de (diff)
Formatting and things
Diffstat (limited to 'JPratt/src/main/java/bjc/pratt/blocks/RepeatingParseBlock.java')
-rw-r--r--JPratt/src/main/java/bjc/pratt/blocks/RepeatingParseBlock.java27
1 files changed, 13 insertions, 14 deletions
diff --git a/JPratt/src/main/java/bjc/pratt/blocks/RepeatingParseBlock.java b/JPratt/src/main/java/bjc/pratt/blocks/RepeatingParseBlock.java
index 4146648..3673f5f 100644
--- a/JPratt/src/main/java/bjc/pratt/blocks/RepeatingParseBlock.java
+++ b/JPratt/src/main/java/bjc/pratt/blocks/RepeatingParseBlock.java
@@ -15,13 +15,13 @@ import bjc.utils.parserutils.ParserException;
* @author bjculkin
*
* @param <K>
- * The key type of the tokens.
+ * The key type of the tokens.
*
* @param <V>
- * The value type of the tokens.
+ * The value type of the tokens.
*
* @param <C>
- * The state type of the parser.
+ * The state type of the parser.
*/
public class RepeatingParseBlock<K, V, C> implements ParseBlock<K, V, C> {
private final ParseBlock<K, V, C> innerBlock;
@@ -37,30 +37,29 @@ public class RepeatingParseBlock<K, V, C> implements ParseBlock<K, V, C> {
* Create a new repeating block.
*
* @param inner
- * The inner block for elements.
+ * The inner block for elements.
*
* @param delimiter
- * The token that delimits elements in the sequence.
+ * The token that delimits elements in the sequence.
*
* @param terminator
- * The token that terminates the sequence.
+ * The token that terminates the sequence.
*
* @param marker
- * The token to use as the node in the AST.
+ * The token to use as the node in the AST.
*
* @param action
- * The action to apply to the state after every
- * delimiter.
+ * The action to apply to the state after every delimiter.
*/
public RepeatingParseBlock(final ParseBlock<K, V, C> inner, final K delimiter, final K terminator,
final Token<K, V> marker, final UnaryOperator<C> action) {
super();
- if (inner == null)
+ if(inner == null)
throw new NullPointerException("Inner block must not be null");
- else if (delimiter == null)
+ else if(delimiter == null)
throw new NullPointerException("Delimiter must not be null");
- else if (terminator == null) throw new NullPointerException("Terminator must not be null");
+ else if(terminator == null) throw new NullPointerException("Terminator must not be null");
innerBlock = inner;
@@ -78,7 +77,7 @@ public class RepeatingParseBlock<K, V, C> implements ParseBlock<K, V, C> {
Token<K, V> tok = ctx.tokens.current();
- while (!tok.getKey().equals(term)) {
+ while(!tok.getKey().equals(term)) {
final ITree<Token<K, V>> kid = innerBlock.parse(ctx);
ret.addChild(kid);
@@ -86,7 +85,7 @@ public class RepeatingParseBlock<K, V, C> implements ParseBlock<K, V, C> {
ctx.tokens.expect(delim, term);
- if (onDelim != null) {
+ if(onDelim != null) {
ctx.state = onDelim.apply(ctx.state);
}
}