diff options
| author | bculkin2442 <bjculkin@mix.wvu.edu> | 2017-03-27 23:28:42 -0400 |
|---|---|---|
| committer | bculkin2442 <bjculkin@mix.wvu.edu> | 2017-03-27 23:28:42 -0400 |
| commit | b9d3a95ba1886508910b3e7f25c7f9b0f735600d (patch) | |
| tree | 4aa435b6a4fd36b9dd7d6855084cfc9ef62442cd /BJC-Utils2/src/main/java/bjc/utils | |
| parent | ab727513337a4729c57220367d67eaa8bc6ce6ff (diff) | |
Minor update
Diffstat (limited to 'BJC-Utils2/src/main/java/bjc/utils')
| -rw-r--r-- | BJC-Utils2/src/main/java/bjc/utils/parserutils/pratt/commands/DenestingCommand.java | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/BJC-Utils2/src/main/java/bjc/utils/parserutils/pratt/commands/DenestingCommand.java b/BJC-Utils2/src/main/java/bjc/utils/parserutils/pratt/commands/DenestingCommand.java index d2d7829..01f92bb 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/parserutils/pratt/commands/DenestingCommand.java +++ b/BJC-Utils2/src/main/java/bjc/utils/parserutils/pratt/commands/DenestingCommand.java @@ -6,26 +6,40 @@ import bjc.utils.parserutils.pratt.InitialCommand; import bjc.utils.parserutils.pratt.ParserContext;
import bjc.utils.parserutils.pratt.Token;
-public class DenestingCommand<C, V, K> extends AbstractInitialCommand<K, V, C> {
- private InitialCommand<K, V, C> internal;
+/**
+ * A command that denests a input tree.
+ *
+ * Useful for processing the result of passing a complex parse group to a
+ * command.
+ *
+ * @author bjculkin
+ *
+ * @param <K>
+ * The key type of the tokens.
+ *
+ * @param <V>
+ * The value type of the tokens.
+ *
+ * @param <C>
+ * The state type of the parser.
+ *
+ */
+public class DenestingCommand<K, V, C> extends AbstractInitialCommand<K, V, C> {
+ private InitialCommand<K, V, C> wrapped;
/**
* Create a new transforming initial command.
*
* @param internal
* The initial command to delegate to.
- *
- * @param transform
- * The transform to apply to the returned tree.
*/
public DenestingCommand(InitialCommand<K, V, C> internal) {
- super();
- this.internal = internal;
+ wrapped = internal;
}
@Override
protected ITree<Token<K, V>> intNullDenotation(Token<K, V> operator, ParserContext<K, V, C> ctx)
throws ParserException {
- return internal.denote(operator, ctx).getChild(0);
+ return wrapped.denote(operator, ctx).getChild(0);
}
}
\ No newline at end of file |
