From 251419e1f0ab8eb04d21287b708b06a552f4c58a Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Mon, 10 Apr 2017 16:49:31 -0400 Subject: Warning resolution --- .../java/bjc/pratt/blocks/TriggeredParseBlock.java | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'JPratt/src/main/java/bjc/pratt/blocks/TriggeredParseBlock.java') diff --git a/JPratt/src/main/java/bjc/pratt/blocks/TriggeredParseBlock.java b/JPratt/src/main/java/bjc/pratt/blocks/TriggeredParseBlock.java index 5e561fc..76d99de 100644 --- a/JPratt/src/main/java/bjc/pratt/blocks/TriggeredParseBlock.java +++ b/JPratt/src/main/java/bjc/pratt/blocks/TriggeredParseBlock.java @@ -21,10 +21,10 @@ import bjc.utils.parserutils.ParserException; * The state type of the parser. */ public class TriggeredParseBlock implements ParseBlock { - private UnaryOperator onEnter; - private UnaryOperator onExit; + private UnaryOperator onEntr; + private UnaryOperator onExt; - private ParseBlock source; + private ParseBlock sourc; /** * Create a new triggered parse block. @@ -39,21 +39,20 @@ public class TriggeredParseBlock implements ParseBlock { * The block to use for parsing. */ public TriggeredParseBlock(UnaryOperator onEnter, UnaryOperator onExit, ParseBlock source) { - super(); - this.onEnter = onEnter; - this.onExit = onExit; - this.source = source; + onEntr = onEnter; + onExt = onExit; + sourc = source; } @Override public ITree> parse(ParserContext ctx) throws ParserException { - C newState = onEnter.apply(ctx.state); + C newState = onEntr.apply(ctx.state); ParserContext newCtx = new ParserContext<>(ctx.tokens, ctx.parse, newState); - ITree> res = source.parse(newCtx); + ITree> res = sourc.parse(newCtx); - ctx.state = onExit.apply(newState); + ctx.state = onExt.apply(newState); return res; } -- cgit v1.2.3 From 56f07e9a3aaa873fe385d224f088f048dbafa8f7 Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Mon, 10 Apr 2017 16:49:54 -0400 Subject: Cleanup --- .../java/bjc/pratt/blocks/TriggeredParseBlock.java | 25 +++++++++++----------- 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'JPratt/src/main/java/bjc/pratt/blocks/TriggeredParseBlock.java') diff --git a/JPratt/src/main/java/bjc/pratt/blocks/TriggeredParseBlock.java b/JPratt/src/main/java/bjc/pratt/blocks/TriggeredParseBlock.java index 76d99de..bb3d6f7 100644 --- a/JPratt/src/main/java/bjc/pratt/blocks/TriggeredParseBlock.java +++ b/JPratt/src/main/java/bjc/pratt/blocks/TriggeredParseBlock.java @@ -10,7 +10,7 @@ import bjc.utils.parserutils.ParserException; /** * A parse block that can adjust the state before handling its context. - * + * * @author bjculkin * * @param @@ -21,36 +21,37 @@ import bjc.utils.parserutils.ParserException; * The state type of the parser. */ public class TriggeredParseBlock implements ParseBlock { - private UnaryOperator onEntr; - private UnaryOperator onExt; + private final UnaryOperator onEntr; + private final UnaryOperator onExt; - private ParseBlock sourc; + private final ParseBlock sourc; /** * Create a new triggered parse block. - * + * * @param onEnter * The action to fire before parsing the block. - * + * * @param onExit * The action to fire after parsing the block. - * + * * @param source * The block to use for parsing. */ - public TriggeredParseBlock(UnaryOperator onEnter, UnaryOperator onExit, ParseBlock source) { + public TriggeredParseBlock(final UnaryOperator onEnter, final UnaryOperator onExit, + final ParseBlock source) { onEntr = onEnter; onExt = onExit; sourc = source; } @Override - public ITree> parse(ParserContext ctx) throws ParserException { - C newState = onEntr.apply(ctx.state); + public ITree> parse(final ParserContext ctx) throws ParserException { + final C newState = onEntr.apply(ctx.state); - ParserContext newCtx = new ParserContext<>(ctx.tokens, ctx.parse, newState); + final ParserContext newCtx = new ParserContext<>(ctx.tokens, ctx.parse, newState); - ITree> res = sourc.parse(newCtx); + final ITree> res = sourc.parse(newCtx); ctx.state = onExt.apply(newState); -- cgit v1.2.3 From f394306a4b65a3328551f9f6b8d4abff8bfd5b27 Mon Sep 17 00:00:00 2001 From: bjculkin Date: Wed, 12 Apr 2017 10:46:51 -0400 Subject: Package reorganization --- JPratt/src/main/java/bjc/pratt/blocks/TriggeredParseBlock.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'JPratt/src/main/java/bjc/pratt/blocks/TriggeredParseBlock.java') diff --git a/JPratt/src/main/java/bjc/pratt/blocks/TriggeredParseBlock.java b/JPratt/src/main/java/bjc/pratt/blocks/TriggeredParseBlock.java index bb3d6f7..844a4f8 100644 --- a/JPratt/src/main/java/bjc/pratt/blocks/TriggeredParseBlock.java +++ b/JPratt/src/main/java/bjc/pratt/blocks/TriggeredParseBlock.java @@ -2,9 +2,8 @@ package bjc.pratt.blocks; import java.util.function.UnaryOperator; -import bjc.pratt.ParseBlock; import bjc.pratt.ParserContext; -import bjc.pratt.Token; +import bjc.pratt.tokens.Token; import bjc.utils.data.ITree; import bjc.utils.parserutils.ParserException; -- cgit v1.2.3