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/RepeatingParseBlock.java | 27 +++++++++++----------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'JPratt/src/main/java/bjc/pratt/blocks/RepeatingParseBlock.java') 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 - * 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 RepeatingParseBlock implements ParseBlock { private final ParseBlock innerBlock; @@ -37,30 +37,29 @@ public class RepeatingParseBlock implements ParseBlock { * 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 inner, final K delimiter, final K terminator, final Token marker, final UnaryOperator 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 implements ParseBlock { Token tok = ctx.tokens.current(); - while (!tok.getKey().equals(term)) { + while(!tok.getKey().equals(term)) { final ITree> kid = innerBlock.parse(ctx); ret.addChild(kid); @@ -86,7 +85,7 @@ public class RepeatingParseBlock implements ParseBlock { ctx.tokens.expect(delim, term); - if (onDelim != null) { + if(onDelim != null) { ctx.state = onDelim.apply(ctx.state); } } -- cgit v1.2.3