From 56f07e9a3aaa873fe385d224f088f048dbafa8f7 Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Mon, 10 Apr 2017 16:49:54 -0400 Subject: Cleanup --- .../main/java/bjc/pratt/commands/UnaryCommand.java | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'JPratt/src/main/java/bjc/pratt/commands/UnaryCommand.java') diff --git a/JPratt/src/main/java/bjc/pratt/commands/UnaryCommand.java b/JPratt/src/main/java/bjc/pratt/commands/UnaryCommand.java index 0689210..d36dc24 100644 --- a/JPratt/src/main/java/bjc/pratt/commands/UnaryCommand.java +++ b/JPratt/src/main/java/bjc/pratt/commands/UnaryCommand.java @@ -8,15 +8,15 @@ import bjc.utils.parserutils.ParserException; /** * A unary operator. - * + * * @author bjculkin * * @param * The key type of the tokens. - * + * * @param * The value type of the tokens. - * + * * @param * The state type of the parser. */ @@ -25,22 +25,20 @@ public class UnaryCommand extends AbstractInitialCommand { /** * Create a new unary command. - * + * * @param precedence * The precedence of this operator. */ - public UnaryCommand(int precedence) { - if(precedence < 0) { - throw new IllegalArgumentException("Precedence must be non-negative"); - } - + public UnaryCommand(final int precedence) { + if (precedence < 0) throw new IllegalArgumentException("Precedence must be non-negative"); + nullPwer = precedence; } @Override - protected ITree> intNullDenotation(Token operator, ParserContext ctx) + protected ITree> intNullDenotation(final Token operator, final ParserContext ctx) throws ParserException { - ITree> opr = ctx.parse.parseExpression(nullPwer, ctx.tokens, ctx.state, false); + final ITree> opr = ctx.parse.parseExpression(nullPwer, ctx.tokens, ctx.state, false); return new Tree<>(operator, opr); } -- cgit v1.2.3