diff options
| author | bculkin2442 <bjculkin@mix.wvu.edu> | 2017-04-11 21:57:37 -0400 |
|---|---|---|
| committer | bculkin2442 <bjculkin@mix.wvu.edu> | 2017-04-11 21:57:37 -0400 |
| commit | 3f74e1e25fd572adab34e53eb90edcf49404fbe5 (patch) | |
| tree | 1a960016d2e58414f91fb1e43348c29c2ab6db20 /JPratt/src/main/java/bjc/pratt/commands | |
| parent | 7a510ceb37780a7d0da37117a5cfce23c2919257 (diff) | |
Cleanup
Diffstat (limited to 'JPratt/src/main/java/bjc/pratt/commands')
| -rw-r--r-- | JPratt/src/main/java/bjc/pratt/commands/BlockInitialCommand.java | 14 | ||||
| -rw-r--r-- | JPratt/src/main/java/bjc/pratt/commands/BlockNonInitialCommand.java | 31 |
2 files changed, 23 insertions, 22 deletions
diff --git a/JPratt/src/main/java/bjc/pratt/commands/BlockInitialCommand.java b/JPratt/src/main/java/bjc/pratt/commands/BlockInitialCommand.java index f0448f7..ca2d31a 100644 --- a/JPratt/src/main/java/bjc/pratt/commands/BlockInitialCommand.java +++ b/JPratt/src/main/java/bjc/pratt/commands/BlockInitialCommand.java @@ -8,33 +8,33 @@ import bjc.utils.parserutils.ParserException; /** * An initial command that delegates all the work to a {@link ParseBlock} - * + * * @author bjculkin * @param <K> * The token key type. - * + * * @param <V> * The token value type. - * + * * @param <C> * The parser state type. * */ public class BlockInitialCommand<K, V, C> extends AbstractInitialCommand<K, V, C> { - private ParseBlock<K, V, C> blck; + private final ParseBlock<K, V, C> blck; /** * Create a new block initial command. - * + * * @param block * The block to delegate to. */ - public BlockInitialCommand(ParseBlock<K, V, C> block) { + public BlockInitialCommand(final ParseBlock<K, V, C> block) { blck = block; } @Override - protected ITree<Token<K, V>> intNullDenotation(Token<K, V> operator, ParserContext<K, V, C> ctx) + protected ITree<Token<K, V>> intNullDenotation(final Token<K, V> operator, final ParserContext<K, V, C> ctx) throws ParserException { return blck.parse(ctx); } diff --git a/JPratt/src/main/java/bjc/pratt/commands/BlockNonInitialCommand.java b/JPratt/src/main/java/bjc/pratt/commands/BlockNonInitialCommand.java index 9a5ffc9..c361c73 100644 --- a/JPratt/src/main/java/bjc/pratt/commands/BlockNonInitialCommand.java +++ b/JPratt/src/main/java/bjc/pratt/commands/BlockNonInitialCommand.java @@ -10,42 +10,43 @@ import bjc.utils.parserutils.ParserException; /** * A non-initial command that delegates all of the work to a {@link ParseBlock} - * + * * @author bjculkin * * @param <K> * The token key type. - * + * * @param <V> * The token value type. - * + * * @param <C> * The parser state type. */ public class BlockNonInitialCommand<K, V, C> extends NonInitialCommand<K, V, C> { - private ParseBlock<K, V, C> innr; + private final ParseBlock<K, V, C> innr; - private int lftBind; - private int nxtBind; + private final int lftBind; + private final int nxtBind; - private Token<K, V> trm; + private final Token<K, V> trm; /** * Create a new non-initial command that delegates to a parse block. - * + * * @param inner * The parse block to delegate to. - * + * * @param leftBind * The left binding power (precedence). - * + * * @param rightBind * The right binding power (associativity control). - * + * * @param term * The token to use as the node in the AST. */ - public BlockNonInitialCommand(ParseBlock<K, V, C> inner, int leftBind, int rightBind, Token<K, V> term) { + public BlockNonInitialCommand(final ParseBlock<K, V, C> inner, final int leftBind, final int rightBind, + final Token<K, V> term) { innr = inner; lftBind = leftBind; @@ -55,9 +56,9 @@ public class BlockNonInitialCommand<K, V, C> extends NonInitialCommand<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>> expression = innr.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>> expression = innr.parse(ctx); return new Tree<>(trm, expression); } |
