Package jjparse

Class Parsing.Parser<T>

java.lang.Object
jjparse.Parsing.Parser<T>
Type Parameters:
T - The covariant type of the value that is the result of running this Parsing.Parser.
All Implemented Interfaces:
Function<Input<I>,Parsing<I>.Result<T>>
Enclosing class:
Parsing<I>

public abstract class Parsing.Parser<T> extends Object implements Function<Input<I>,Parsing<I>.Result<T>>
The abstract base class of a Parsing.Parser.

Very similar to recursive descent parsing, a Parsing.Parser is just a Function that takes an Input and produces a Parsing.Result. In order to implement a Parsing.Parser it therefore suffices to implement the apply(jjparse.input.Input<I>) method.

Note: This class is intended to be immutable and hence covariant in its type parameter.

Implementation Note: Unfortunately, Java does not support instance interfaces which is why this class is not a FunctionalInterface and we cannot use the lambda syntax to implement a Parsing.Parser.
Author:
Björn Lötters