From 42990231fee502552b769b9af4c04ac0dcaeb195 Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Sat, 25 Mar 2017 19:13:42 -0400 Subject: Update Pratt parser --- .../bjc/utils/parserutils/pratt/ParseBlock.java | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 BJC-Utils2/src/main/java/bjc/utils/parserutils/pratt/ParseBlock.java (limited to 'BJC-Utils2/src/main/java/bjc/utils/parserutils/pratt/ParseBlock.java') diff --git a/BJC-Utils2/src/main/java/bjc/utils/parserutils/pratt/ParseBlock.java b/BJC-Utils2/src/main/java/bjc/utils/parserutils/pratt/ParseBlock.java new file mode 100644 index 0000000..4542107 --- /dev/null +++ b/BJC-Utils2/src/main/java/bjc/utils/parserutils/pratt/ParseBlock.java @@ -0,0 +1,37 @@ +package bjc.utils.parserutils.pratt; + +import bjc.utils.data.ITree; +import bjc.utils.parserutils.ParserException; + +/** + * Represents a embedded block in an expression. + * + * @author bjculkin + * + * @param + * The key type of the token. + * + * @param + * The value type of the token. + * + * @param + * The state type of the parser. + */ +@FunctionalInterface +public interface ParseBlock { + + /** + * Parse the block this represents. + * + * @param ctx + * The context for parsing. + * + * @return A AST for this block. + * + * @throws ParserException + * If something goes wrong during parsing, or the block + * fails validation. + */ + ITree> parse(ParserContext ctx) throws ParserException; + +} \ No newline at end of file -- cgit v1.2.3