Class SimpleParser<T>
java.lang.Object
dev.prozilla.pine.common.util.Parser<T>
dev.prozilla.pine.common.util.parser.SimpleParser<T>
- All Implemented Interfaces:
Printable
A simple parser that uses a parsing function.
-
Field Summary
Fields inherited from class dev.prozilla.pine.common.util.Parser
GENERIC_ERROR, UNEXPECTED_END_OF_INPUT_ERROR -
Constructor Summary
ConstructorsConstructorDescriptionSimpleParser(ParseFunction<T> parseFunction) Creates a simple parser using a parsing function. -
Method Summary
Modifier and TypeMethodDescriptionstatic SimpleParser<Boolean> Creates a simple parser usingParseFunction.parseBoolean(String).static SimpleParser<Float> Creates a simple parser usingParseFunction.parseFloat(String).static SimpleParser<Integer> Creates a simple parser usingParseFunction.parseInt(String).booleanParses a string.Methods inherited from class dev.prozilla.pine.common.util.Parser
fail, fail, getError, getResult, read, succeed, toString
-
Constructor Details
-
SimpleParser
Creates a simple parser using a parsing function.- Parameters:
parseFunction- The parsing function to use
-
-
Method Details
-
parse
Description copied from class:ParserParses a string. -
intParser
Creates a simple parser usingParseFunction.parseInt(String). -
floatParser
Creates a simple parser usingParseFunction.parseFloat(String). -
booleanParser
Creates a simple parser usingParseFunction.parseBoolean(String).
-