summaryrefslogtreecommitdiff
path: root/JPratt/src/main/java/bjc/pratt/commands/PostCircumfixCommand.java
diff options
context:
space:
mode:
authorbculkin2442 <bjculkin@mix.wvu.edu>2017-04-10 16:49:54 -0400
committerbculkin2442 <bjculkin@mix.wvu.edu>2017-04-10 16:49:54 -0400
commit56f07e9a3aaa873fe385d224f088f048dbafa8f7 (patch)
tree64fae78f95fd1c233689ecf3dda2e2b645bb8d33 /JPratt/src/main/java/bjc/pratt/commands/PostCircumfixCommand.java
parent251419e1f0ab8eb04d21287b708b06a552f4c58a (diff)
Cleanup
Diffstat (limited to 'JPratt/src/main/java/bjc/pratt/commands/PostCircumfixCommand.java')
-rw-r--r--JPratt/src/main/java/bjc/pratt/commands/PostCircumfixCommand.java28
1 files changed, 13 insertions, 15 deletions
diff --git a/JPratt/src/main/java/bjc/pratt/commands/PostCircumfixCommand.java b/JPratt/src/main/java/bjc/pratt/commands/PostCircumfixCommand.java
index 6bed0ff..e7d2eea 100644
--- a/JPratt/src/main/java/bjc/pratt/commands/PostCircumfixCommand.java
+++ b/JPratt/src/main/java/bjc/pratt/commands/PostCircumfixCommand.java
@@ -9,41 +9,39 @@ import bjc.utils.parserutils.ParserException;
/**
* A post-circumfix operator, like array indexing.
- *
+ *
* @author bjculkin
*
* @param <K>
* The key type of the tokens.
- *
+ *
* @param <V>
* The value type of the tokens.
- *
+ *
* @param <C>
* The state type of the parser.
*/
public class PostCircumfixCommand<K, V, C> extends BinaryPostCommand<K, V, C> {
- private ParseBlock<K, V, C> innerBlock;
+ private final ParseBlock<K, V, C> innerBlock;
- private Token<K, V> mark;
+ private final Token<K, V> mark;
/**
* Create a new post-circumfix operator.
- *
+ *
* @param precedence
* The precedence of the operator.
- *
+ *
* @param inner
* The block inside the expression.
- *
+ *
* @param marker
* The token to use as the node for the AST.
*/
- public PostCircumfixCommand(int precedence, ParseBlock<K, V, C> inner, Token<K, V> marker) {
+ public PostCircumfixCommand(final int precedence, final ParseBlock<K, V, C> inner, final Token<K, V> marker) {
super(precedence);
- if (inner == null) {
- throw new NullPointerException("Inner block must not be null");
- }
+ if (inner == null) throw new NullPointerException("Inner block must not be null");
innerBlock = inner;
@@ -51,9 +49,9 @@ public class PostCircumfixCommand<K, V, C> extends BinaryPostCommand<K, V, C> {
}
@Override
- public ITree<Token<K, V>> denote(ITree<Token<K, V>> operand, Token<K, V> operator, ParserContext<K, V, C> ctx)
- throws ParserException {
- ITree<Token<K, V>> inside = innerBlock.parse(ctx);
+ public ITree<Token<K, V>> denote(final ITree<Token<K, V>> operand, final Token<K, V> operator,
+ final ParserContext<K, V, C> ctx) throws ParserException {
+ final ITree<Token<K, V>> inside = innerBlock.parse(ctx);
return new Tree<>(mark, operand, inside);
}