T - The AST node this parser will be returning.public interface Parser<T>
| Modifier and Type | Method and Description |
|---|---|
default <R> Parser<R> |
map(java.util.function.Function<T,R> function)
Helper for converting a result of the parser into another type.
|
T |
parse(ParserContext context)
The core of the parsing logic.
|
default T |
parse(java.lang.String input)
Helper function to parse whole strings.
|
@Nullable T parse(ParserContext context)
ParserContext.advance(int), or through the use of snapshotting (see
ParserContext.snapshot()).
context - Context of the parser containing the parsed string and the position in that
string.default T parse(java.lang.String input)
input - A string to parse.default <R> Parser<R> map(java.util.function.Function<T,R> function)
Stream.map(Function).R - The return type of the new parser.function - Function that should be used to map the result of the given parser.