From 5028ad9a1faad0e363d017f18363e8062ba59871 Mon Sep 17 00:00:00 2001 From: bjculkin Date: Thu, 15 Feb 2018 15:25:09 -0500 Subject: Formatting and things --- .../java/bjc/pratt/blocks/SimpleParseBlock.java | 34 +++++++++++----------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'JPratt/src/main/java/bjc/pratt/blocks/SimpleParseBlock.java') diff --git a/JPratt/src/main/java/bjc/pratt/blocks/SimpleParseBlock.java b/JPratt/src/main/java/bjc/pratt/blocks/SimpleParseBlock.java index 1ff561c..4148472 100644 --- a/JPratt/src/main/java/bjc/pratt/blocks/SimpleParseBlock.java +++ b/JPratt/src/main/java/bjc/pratt/blocks/SimpleParseBlock.java @@ -13,13 +13,13 @@ import bjc.utils.parserutils.ParserException; * @author bjculkin * * @param - * The key type of the tokens. + * The key type of the tokens. * * @param - * The value type of the tokens. + * The value type of the tokens. * * @param - * The state type of the parser. + * The state type of the parser. */ public class SimpleParseBlock implements ParseBlock { private final int pow; @@ -32,16 +32,16 @@ public class SimpleParseBlock implements ParseBlock { * Create a new block. * * @param precedence - * The precedence of this block. + * The precedence of this block. * @param validator - * The predicate to apply to blocks. + * The predicate to apply to blocks. * @param terminator - * The token type that terminates the block. If this is - * null, don't check for a terminator. + * The token type that terminates the block. If this is null, + * don't check for a terminator. */ public SimpleParseBlock(final int precedence, final Predicate>> validator, final K terminator) { - if (precedence < 0) throw new IllegalArgumentException("Precedence must be non-negative"); + if(precedence < 0) throw new IllegalArgumentException("Precedence must be non-negative"); pow = precedence; term = terminator; @@ -52,11 +52,11 @@ public class SimpleParseBlock implements ParseBlock { public ITree> parse(final ParserContext ctx) throws ParserException { final ITree> res = ctx.parse.parseExpression(pow, ctx.tokens, ctx.state, false); - if (term != null) { + if(term != null) { ctx.tokens.expect(term); } - if (validatr == null || validatr.test(res)) return res; + if(validatr == null || validatr.test(res)) return res; throw new ParserException("Block failed validation"); } @@ -75,17 +75,17 @@ public class SimpleParseBlock implements ParseBlock { @Override public boolean equals(final Object obj) { - if (this == obj) return true; - if (obj == null) return false; - if (!(obj instanceof SimpleParseBlock)) return false; + if(this == obj) return true; + if(obj == null) return false; + if(!(obj instanceof SimpleParseBlock)) return false; final SimpleParseBlock other = (SimpleParseBlock) obj; - if (pow != other.pow) return false; + if(pow != other.pow) return false; - if (term == null) { - if (other.term != null) return false; - } else if (!term.equals(other.term)) return false; + if(term == null) { + if(other.term != null) return false; + } else if(!term.equals(other.term)) return false; return true; } -- cgit v1.2.3