Top Description Fields Constructors Methods
org.jparsec

public final Class Parsers

extends Object
Class Inheritance
Imports
java.util.ArrayList, .Collection, .List, java.util.function.BiFunction, org.jparsec.functors.Map3, .Map4, .Map5, .Map6, .Map7, .Map8, .Pair, .Tuple3, .Tuple4, .Tuple5, org.jparsec.internal.annotations.Private, org.jparsec.internal.util.Lists

Provides common Parser implementations.
Author
Ben Yu

Field Summary

Modifier and TypeField and Description
private static final Parser<T>
public static final Parser<Object>
ANY_TOKEN

A Parser that consumes a token.

public static final Parser<?>
EOF

Parser that succeeds only if EOF is met.

pack-priv static final Parser<Boolean>
public static final Parser<Integer>
INDEX

Deprecated Use SOURCE_LOCATION instead.
A Parser that retrieves the current index in the source.
private static final Parser<T>
public static final Parser<SourceLocation>
SOURCE_LOCATION

A Parser that returns the current location in the source.

pack-priv static final Parser<Boolean>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static Parser<Object>
alt(Parser<?>... alternatives)

Allows the overloads of "or()" to call the varargs version of "or" with no ambiguity.

public static <T> Parser<T>
always()

Parser that always succeeds.

public static Parser<Object[]>
array(final Parser<?>... parsers)

A Parser that sequentially runs parsers one by one and collects the return values in an array.

public static <T> Parser<T>
between(Parser<?> before, Parser<T> parser, Parser<?> after)

Equivalent to Parser#between(Parser, Parser).

public static <T> Parser<T>
constant(final T v)

A Parser that always returns v regardless of input.

pack-priv static Parser<?>
eof(final String message)

A Parser that succeeds only if EOF is met.

public static <T> Parser<T>
expect(final String name)

A Parser that fails and reports that name is logically expected.

public static <T> Parser<T>
fail(final String message)

A Parser that always fails with message.

public static <T> Parser<List<T>>
list(Iterable<? extends Parser<? extends T>> parsers)

A Parser that sequentially runs parsers one by one and collects the return values in a List.

public static <T> Parser<T>
longer(Parser<? extends T> p1, Parser<? extends T> p2)

A Parser that runs both p1 and p2 and selects the longer match.

public static <T> Parser<T>
longest(Parser<? extends T>... parsers)

A Parser that runs every element of parsers and selects the longest match.

public static <T> Parser<T>
longest(Iterable<? extends Parser<? extends T>> parsers)

A Parser that runs every element of parsers and selects the longest match.

pack-priv static <T> Parser<T>

Returns:

the new Parser object.
nested
(final Parser<Token[]>
the lexer object that returns an array of Tok objects.
lexer
,
final Parser<? extends T>
the token level parser object.
parser
)

A Parser that takes as input the array of Token returned from lexer, and feeds the tokens as input into parser.

public static <T> Parser<T>
never()

Parser that always fails.

public static <T> Parser<T>
or(Parser<? extends T> p1, Parser<? extends T> p2)

A Parser that tries 2 alternative parser objects.

public static <T> Parser<T>
or(Parser<? extends T> p1, Parser<? extends T> p2, Parser<? extends T> p3)

A Parser that tries 3 alternative parser objects.

public static <T> Parser<T>
or(Parser<? extends T> p1, Parser<? extends T> p2, Parser<? extends T> p3, Parser<? extends T> p4)

A Parser that tries 4 alternative parser objects.

public static <T> Parser<T>
or(Parser<? extends T> p1, Parser<? extends T> p2, Parser<? extends T> p3, Parser<? extends T> p4, Parser<? extends T> p5)

A Parser that tries 5 alternative parser objects.

public static <T> Parser<T>
or(Parser<? extends T> p1, Parser<? extends T> p2, Parser<? extends T> p3, Parser<? extends T> p4, Parser<? extends T> p5, Parser<? extends T> p6)

A Parser that tries 6 alternative parser objects.

public static <T> Parser<T>
or(Parser<? extends T> p1, Parser<? extends T> p2, Parser<? extends T> p3, Parser<? extends T> p4, Parser<? extends T> p5, Parser<? extends T> p6, Parser<? extends T> p7)

A Parser that tries 7 alternative parser objects.

public static <T> Parser<T>
or(Parser<? extends T> p1, Parser<? extends T> p2, Parser<? extends T> p3, Parser<? extends T> p4, Parser<? extends T> p5, Parser<? extends T> p6, Parser<? extends T> p7, Parser<? extends T> p8)

A Parser that tries 8 alternative parser objects.

public static <T> Parser<T>
or(Parser<? extends T> p1, Parser<? extends T> p2, Parser<? extends T> p3, Parser<? extends T> p4, Parser<? extends T> p5, Parser<? extends T> p6, Parser<? extends T> p7, Parser<? extends T> p8, Parser<? extends T> p9)

A Parser that tries 9 alternative parser objects.

public static <T> Parser<T>
or(final Parser<? extends T>... alternatives)

A Parser that tries each alternative parser in alternatives.

public static <T> Parser<T>
or(Iterable<? extends Parser<? extends T>> alternatives)

A Parser that tries each alternative parser in alternatives.

public static <A, B> Parser<Pair<A, B>>
pair(Parser<? extends A> p1, Parser<? extends B> p2)
Deprecated Prefer to converting to your own object with a lambda.

A Parser that sequentially runs p1 and p2 and collects the results in a Pair object.

public static Parser<?>
runnable(final Runnable runnable)
Deprecated

A Parser that always succeeds and invokes runnable.

public static <T> Parser<T>
sequence(Parser<?> p1, Parser<T> p2)

A Parser that runs 2 parser objects sequentially.

public static <T> Parser<T>
sequence(Parser<?> p1, Parser<?> p2, Parser<T> p3)

A Parser that runs 3 parser objects sequentially.

public static <T> Parser<T>
sequence(Parser<?> p1, Parser<?> p2, Parser<?> p3, Parser<T> p4)

A Parser that runs 4 parser objects sequentially.

public static <T> Parser<T>
sequence(Parser<?> p1, Parser<?> p2, Parser<?> p3, Parser<?> p4, Parser<T> p5)

A Parser that runs 5 parser objects sequentially.

public static <A, B, T> Parser<T>
sequence(final Parser<A> p1, final Parser<B> p2, final BiFunction<? super A, ? super B, ? extends T> map)

A Parser that runs p1 and p2 sequentially and transforms the return values using map.

public static <A, B, C, T> Parser<T>
sequence(final Parser<A> p1, final Parser<B> p2, final Parser<C> p3, final Map3<? super A, ? super B, ? super C, ? extends T> map)

A Parser that runs 3 parser objects sequentially and transforms the return values using map.

public static <A, B, C, D, T> Parser<T>
sequence(final Parser<A> p1, final Parser<B> p2, final Parser<C> p3, final Parser<D> p4, final Map4<? super A, ? super B, ? super C, ? super D, ? extends T> map)

A Parser that runs 4 parser objects sequentially and transforms the return values using map.

public static <A, B, C, D, E, T> Parser<T>
sequence(final Parser<A> p1, final Parser<B> p2, final Parser<C> p3, final Parser<D> p4, final Parser<E> p5, final Map5<? super A, ? super B, ? super C, ? super D, ? super E, ? extends T> map)

A Parser that runs 5 parser objects sequentially and transforms the return values using map.

public static <A, B, C, D, E, F, T> Parser<T>
sequence(final Parser<A> p1, final Parser<B> p2, final Parser<C> p3, final Parser<D> p4, final Parser<E> p5, final Parser<F> p6, final Map6<? super A, ? super B, ? super C, ? super D, ? super E, ? super F, ? extends T> map)

A Parser that runs 6 parser objects sequentially and transforms the return values using map.

public static <A, B, C, D, E, F, G, T> Parser<T>
sequence(final Parser<A> p1, final Parser<B> p2, final Parser<C> p3, final Parser<D> p4, final Parser<E> p5, final Parser<F> p6, final Parser<G> p7, final Map7<? super A, ? super B, ? super C, ? super D, ? super E, ? super F, ? super G, ? extends T> map)

A Parser that runs 7 parser objects sequentially and transforms the return values using map.

public static <A, B, C, D, E, F, G, H, T> Parser<T>
sequence(final Parser<A> p1, final Parser<B> p2, final Parser<C> p3, final Parser<D> p4, final Parser<E> p5, final Parser<F> p6, final Parser<G> p7, final Parser<H> p8, final Map8<? super A, ? super B, ? super C, ? super D, ? super E, ? super F, ? super G, ? super H, ? extends T> map)

A Parser that runs 7 parser objects sequentially and transforms the return values using map.

public static Parser<Object>
sequence(final Parser<?>... parsers)

A Parser that runs parsers sequentially and discards the return values.

public static Parser<Object>
sequence(Iterable<? extends Parser<?>> parsers)

A Parser that runs parsers sequentially and discards the return values.

public static <T> Parser<T>
shorter(Parser<? extends T> p1, Parser<? extends T> p2)

A Parser that runs both p1 and p2 and selects the shorter match.

public static <T> Parser<T>
shortest(Parser<? extends T>... parsers)

A Parser that runs every element of parsers and selects the shortest match.

public static <T> Parser<T>
shortest(Iterable<? extends Parser<? extends T>> parsers)

A Parser that runs every element of parsers and selects the shortest match.

pack-priv static <T> Parser<T>[]
toArray(Iterable<? extends Parser<? extends T>> parsers)

We always convert Iterable to an array to avoid the cost of creating a new java.util.Iterator object each time the parser runs.

private static <T> Parser<T>[]
toArray(Collection<? extends Parser<? extends T>> parsers)

pack-priv static <T> Parser<T>[]
toArrayWithIteration(Iterable<? extends Parser<? extends T>> parsers)

public static <T> Parser<T>

Returns:

the new Parser object.
token
(final TokenMap<? extends T>
the FromToken object.
fromToken
)

Checks the current token with the fromToken object.

pack-priv static Parser<Token[]>
tokens(final Parser<? extends Collection<Token>> parser)

Converts a parser of a collection of Token to a parser of an array of Token.

public static <T> Parser<T>

Returns:

the new Parser object.
tokenType
(final Class<? extends T>
the expected token value type.
type
,
final String
the name of what's logically expected.
name
)

Checks whether the current token value is of type, in which case, the token value is returned and parse succeeds.

public static <A, B> Parser<Pair<A, B>>
tuple(Parser<? extends A> p1, Parser<? extends B> p2)
Deprecated Prefer to converting to your own object with a lambda.

A Parser that sequentially runs p1 and p2 and collects the results in a Pair object.

public static <A, B, C> Parser<Tuple3<A, B, C>>
tuple(Parser<? extends A> p1, Parser<? extends B> p2, Parser<? extends C> p3)
Deprecated Prefer to converting to your own object with a lambda.

A Parser that sequentially runs 3 parser objects and collects the results in a Tuple3 object.

public static <A, B, C, D> Parser<Tuple4<A, B, C, D>>
tuple(Parser<? extends A> p1, Parser<? extends B> p2, Parser<? extends C> p3, Parser<? extends D> p4)
Deprecated Prefer to converting to your own object with a lambda.

A Parser that sequentially runs 4 parser objects and collects the results in a Tuple4 object.

public static <A, B, C, D, E> Parser<Tuple5<A, B, C, D, E>>
tuple(Parser<? extends A> p1, Parser<? extends B> p2, Parser<? extends C> p3, Parser<? extends D> p4, Parser<? extends E> p5)
Deprecated Prefer to converting to your own object with a lambda.

A Parser that sequentially runs 5 parser objects and collects the results in a Tuple5 object.

public static <T> Parser<T>
unexpected(final String name)

A Parser that fails and reports that name is logically unexpected.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ALWAYSback to summary
private static final Parser<T> ALWAYS
Annotations
@SuppressWarnings:rawtypes
ANY_TOKENback to summary
public static final Parser<Object> ANY_TOKEN

A Parser that consumes a token. The token value is returned from the parser.

EOFback to summary
public static final Parser<?> EOF

Parser that succeeds only if EOF is met. Fails otherwise.

FALSEback to summary
pack-priv static final Parser<Boolean> FALSE
INDEXback to summary
public static final Parser<Integer> INDEX

Deprecated

Use SOURCE_LOCATION instead.

A Parser that retrieves the current index in the source.

Annotations
@Deprecated
NEVERback to summary
private static final Parser<T> NEVER
Annotations
@SuppressWarnings:rawtypes
SOURCE_LOCATIONback to summary
public static final Parser<SourceLocation> SOURCE_LOCATION

A Parser that returns the current location in the source.

Because SourceLocation#getLine and SourceLocation#getColumn take amortized log(n) time, it's more efficient to avoid calling them until the entire source has been parsed successfully. In other words, avoid SOURCE_LOCATION.map(SourceLocation::getLine) or anything similar.

SourceLocation#getIndex can be called any time.

Since
3.1
TRUEback to summary
pack-priv static final Parser<Boolean> TRUE

Constructor Detail

Parsersback to summary
private Parsers()

Method Detail

altback to summary
private static Parser<Object> alt(Parser<?>... alternatives)

Allows the overloads of "or()" to call the varargs version of "or" with no ambiguity.

alwaysback to summary
public static <T> Parser<T> always()

Parser that always succeeds.

Annotations
@SuppressWarnings:unchecked
arrayback to summary
public static Parser<Object[]> array(final Parser<?>... parsers)

A Parser that sequentially runs parsers one by one and collects the return values in an array.

betweenback to summary
public static <T> Parser<T> between(Parser<?> before, Parser<T> parser, Parser<?> after)

Equivalent to Parser#between(Parser, Parser). Use this to list the parsers in the natural order.

constantback to summary
public static <T> Parser<T> constant(final T v)

A Parser that always returns v regardless of input.

eofback to summary
pack-priv static Parser<?> eof(final String message)

A Parser that succeeds only if EOF is met. Fails with message otherwise.

expectback to summary
public static <T> Parser<T> expect(final String name)

A Parser that fails and reports that name is logically expected.

failback to summary
public static <T> Parser<T> fail(final String message)

A Parser that always fails with message.

listback to summary
public static <T> Parser<List<T>> list(Iterable<? extends Parser<? extends T>> parsers)

A Parser that sequentially runs parsers one by one and collects the return values in a List.

longerback to summary
public static <T> Parser<T> longer(Parser<? extends T> p1, Parser<? extends T> p2)

A Parser that runs both p1 and p2 and selects the longer match. If both matches the same length, the first one is favored.

Annotations
@SuppressWarnings:unchecked
longestback to summary
public static <T> Parser<T> longest(Parser<? extends T>... parsers)

A Parser that runs every element of parsers and selects the longest match. If two matches have the same length, the first one is favored.

longestback to summary
public static <T> Parser<T> longest(Iterable<? extends Parser<? extends T>> parsers)

A Parser that runs every element of parsers and selects the longest match. If two matches have the same length, the first one is favored.

nestedback to summary
pack-priv static <T> Parser<T> nested(final Parser<Token[]> lexer, final Parser<? extends T> parser)

A Parser that takes as input the array of Token returned from lexer, and feeds the tokens as input into parser.

It fails if either lexer or parser fails.

Parameters
lexer:Parser<Token[]>

the lexer object that returns an array of Tok objects.

parser:Parser<? extends T>

the token level parser object.

Returns:Parser<T>

the new Parser object.

neverback to summary
public static <T> Parser<T> never()

Parser that always fails.

Annotations
@SuppressWarnings:unchecked
orback to summary
public static <T> Parser<T> or(Parser<? extends T> p1, Parser<? extends T> p2)

A Parser that tries 2 alternative parser objects. Fallback happens regardless of partial match.

orback to summary
public static <T> Parser<T> or(Parser<? extends T> p1, Parser<? extends T> p2, Parser<? extends T> p3)

A Parser that tries 3 alternative parser objects. Fallback happens regardless of partial match.

orback to summary
public static <T> Parser<T> or(Parser<? extends T> p1, Parser<? extends T> p2, Parser<? extends T> p3, Parser<? extends T> p4)

A Parser that tries 4 alternative parser objects. Fallback happens regardless of partial match.

orback to summary
public static <T> Parser<T> or(Parser<? extends T> p1, Parser<? extends T> p2, Parser<? extends T> p3, Parser<? extends T> p4, Parser<? extends T> p5)

A Parser that tries 5 alternative parser objects. Fallback happens regardless of partial match.

orback to summary
public static <T> Parser<T> or(Parser<? extends T> p1, Parser<? extends T> p2, Parser<? extends T> p3, Parser<? extends T> p4, Parser<? extends T> p5, Parser<? extends T> p6)

A Parser that tries 6 alternative parser objects. Fallback happens regardless of partial match.

orback to summary
public static <T> Parser<T> or(Parser<? extends T> p1, Parser<? extends T> p2, Parser<? extends T> p3, Parser<? extends T> p4, Parser<? extends T> p5, Parser<? extends T> p6, Parser<? extends T> p7)

A Parser that tries 7 alternative parser objects. Fallback happens regardless of partial match.

orback to summary
public static <T> Parser<T> or(Parser<? extends T> p1, Parser<? extends T> p2, Parser<? extends T> p3, Parser<? extends T> p4, Parser<? extends T> p5, Parser<? extends T> p6, Parser<? extends T> p7, Parser<? extends T> p8)

A Parser that tries 8 alternative parser objects. Fallback happens regardless of partial match.

orback to summary
public static <T> Parser<T> or(Parser<? extends T> p1, Parser<? extends T> p2, Parser<? extends T> p3, Parser<? extends T> p4, Parser<? extends T> p5, Parser<? extends T> p6, Parser<? extends T> p7, Parser<? extends T> p8, Parser<? extends T> p9)

A Parser that tries 9 alternative parser objects. Fallback happens regardless of partial match.

orback to summary
public static <T> Parser<T> or(final Parser<? extends T>... alternatives)

A Parser that tries each alternative parser in alternatives.

Different than alt(Parser[]), it requires all alternative parsers to have type T.

orback to summary
public static <T> Parser<T> or(Iterable<? extends Parser<? extends T>> alternatives)

A Parser that tries each alternative parser in alternatives.

pairback to summary
public static <A, B> Parser<Pair<A, B>> pair(Parser<? extends A> p1, Parser<? extends B> p2)

Deprecated

Prefer to converting to your own object with a lambda.

A Parser that sequentially runs p1 and p2 and collects the results in a Pair object. Is equivalent to tuple(Parser, Parser).

Annotations
@Deprecated
runnableback to summary
public static Parser<?> runnable(final Runnable runnable)

Deprecated

A Parser that always succeeds and invokes runnable.

Annotations
@Deprecated
sequenceback to summary
public static <T> Parser<T> sequence(Parser<?> p1, Parser<T> p2)

A Parser that runs 2 parser objects sequentially. p1 is executed, if it succeeds, p2 is executed.

sequenceback to summary
public static <T> Parser<T> sequence(Parser<?> p1, Parser<?> p2, Parser<T> p3)

A Parser that runs 3 parser objects sequentially.

sequenceback to summary
public static <T> Parser<T> sequence(Parser<?> p1, Parser<?> p2, Parser<?> p3, Parser<T> p4)

A Parser that runs 4 parser objects sequentially.

sequenceback to summary
public static <T> Parser<T> sequence(Parser<?> p1, Parser<?> p2, Parser<?> p3, Parser<?> p4, Parser<T> p5)

A Parser that runs 5 parser objects sequentially.

sequenceback to summary
public static <A, B, T> Parser<T> sequence(final Parser<A> p1, final Parser<B> p2, final BiFunction<? super A, ? super B, ? extends T> map)

A Parser that runs p1 and p2 sequentially and transforms the return values using map.

sequenceback to summary
public static <A, B, C, T> Parser<T> sequence(final Parser<A> p1, final Parser<B> p2, final Parser<C> p3, final Map3<? super A, ? super B, ? super C, ? extends T> map)

A Parser that runs 3 parser objects sequentially and transforms the return values using map.

sequenceback to summary
public static <A, B, C, D, T> Parser<T> sequence(final Parser<A> p1, final Parser<B> p2, final Parser<C> p3, final Parser<D> p4, final Map4<? super A, ? super B, ? super C, ? super D, ? extends T> map)

A Parser that runs 4 parser objects sequentially and transforms the return values using map.

sequenceback to summary
public static <A, B, C, D, E, T> Parser<T> sequence(final Parser<A> p1, final Parser<B> p2, final Parser<C> p3, final Parser<D> p4, final Parser<E> p5, final Map5<? super A, ? super B, ? super C, ? super D, ? super E, ? extends T> map)

A Parser that runs 5 parser objects sequentially and transforms the return values using map.

sequenceback to summary
public static <A, B, C, D, E, F, T> Parser<T> sequence(final Parser<A> p1, final Parser<B> p2, final Parser<C> p3, final Parser<D> p4, final Parser<E> p5, final Parser<F> p6, final Map6<? super A, ? super B, ? super C, ? super D, ? super E, ? super F, ? extends T> map)

A Parser that runs 6 parser objects sequentially and transforms the return values using map.

Since
3.0
sequenceback to summary
public static <A, B, C, D, E, F, G, T> Parser<T> sequence(final Parser<A> p1, final Parser<B> p2, final Parser<C> p3, final Parser<D> p4, final Parser<E> p5, final Parser<F> p6, final Parser<G> p7, final Map7<? super A, ? super B, ? super C, ? super D, ? super E, ? super F, ? super G, ? extends T> map)

A Parser that runs 7 parser objects sequentially and transforms the return values using map.

Since
3.0
sequenceback to summary
public static <A, B, C, D, E, F, G, H, T> Parser<T> sequence(final Parser<A> p1, final Parser<B> p2, final Parser<C> p3, final Parser<D> p4, final Parser<E> p5, final Parser<F> p6, final Parser<G> p7, final Parser<H> p8, final Map8<? super A, ? super B, ? super C, ? super D, ? super E, ? super F, ? super G, ? super H, ? extends T> map)

A Parser that runs 7 parser objects sequentially and transforms the return values using map.

Since
3.0
sequenceback to summary
public static Parser<Object> sequence(final Parser<?>... parsers)

A Parser that runs parsers sequentially and discards the return values.

sequenceback to summary
public static Parser<Object> sequence(Iterable<? extends Parser<?>> parsers)

A Parser that runs parsers sequentially and discards the return values.

shorterback to summary
public static <T> Parser<T> shorter(Parser<? extends T> p1, Parser<? extends T> p2)

A Parser that runs both p1 and p2 and selects the shorter match. If both matches the same length, the first one is favored.

Annotations
@SuppressWarnings:unchecked
shortestback to summary
public static <T> Parser<T> shortest(Parser<? extends T>... parsers)

A Parser that runs every element of parsers and selects the shortest match. If two matches have the same length, the first one is favored.

shortestback to summary
public static <T> Parser<T> shortest(Iterable<? extends Parser<? extends T>> parsers)

A Parser that runs every element of parsers and selects the shortest match. If two matches have the same length, the first one is favored.

toArrayback to summary
pack-priv static <T> Parser<T>[] toArray(Iterable<? extends Parser<? extends T>> parsers)

We always convert Iterable to an array to avoid the cost of creating a new java.util.Iterator object each time the parser runs.

Annotations
@SuppressWarnings:unchecked, rawtypes
@Private
toArrayback to summary
private static <T> Parser<T>[] toArray(Collection<? extends Parser<? extends T>> parsers)
Annotations
@SuppressWarnings:unchecked
toArrayWithIterationback to summary
pack-priv static <T> Parser<T>[] toArrayWithIteration(Iterable<? extends Parser<? extends T>> parsers)
Annotations
@Private
tokenback to summary
public static <T> Parser<T> token(final TokenMap<? extends T> fromToken)

Checks the current token with the fromToken object. If the TokenMap#map(Token) method returns null, an unexpected token error occurs; if the method returns a non-null value, the value is returned and the parser succeeds.

Parameters
fromToken:TokenMap<? extends T>

the FromToken object.

Returns:Parser<T>

the new Parser object.

tokensback to summary
pack-priv static Parser<Token[]> tokens(final Parser<? extends Collection<Token>> parser)

Converts a parser of a collection of Token to a parser of an array of Token.

tokenTypeback to summary
public static <T> Parser<T> tokenType(final Class<? extends T> type, final String name)

Checks whether the current token value is of type, in which case, the token value is returned and parse succeeds.

Parameters
type:Class<? extends T>

the expected token value type.

name:String

the name of what's logically expected.

Returns:Parser<T>

the new Parser object.

tupleback to summary
public static <A, B> Parser<Pair<A, B>> tuple(Parser<? extends A> p1, Parser<? extends B> p2)

Deprecated

Prefer to converting to your own object with a lambda.

A Parser that sequentially runs p1 and p2 and collects the results in a Pair object. Is equivalent to pair(Parser, Parser).

Annotations
@Deprecated
tupleback to summary
public static <A, B, C> Parser<Tuple3<A, B, C>> tuple(Parser<? extends A> p1, Parser<? extends B> p2, Parser<? extends C> p3)

Deprecated

Prefer to converting to your own object with a lambda.

A Parser that sequentially runs 3 parser objects and collects the results in a Tuple3 object.

Annotations
@Deprecated
tupleback to summary
public static <A, B, C, D> Parser<Tuple4<A, B, C, D>> tuple(Parser<? extends A> p1, Parser<? extends B> p2, Parser<? extends C> p3, Parser<? extends D> p4)

Deprecated

Prefer to converting to your own object with a lambda.

A Parser that sequentially runs 4 parser objects and collects the results in a Tuple4 object.

Annotations
@Deprecated
tupleback to summary
public static <A, B, C, D, E> Parser<Tuple5<A, B, C, D, E>> tuple(Parser<? extends A> p1, Parser<? extends B> p2, Parser<? extends C> p3, Parser<? extends D> p4, Parser<? extends E> p5)

Deprecated

Prefer to converting to your own object with a lambda.

A Parser that sequentially runs 5 parser objects and collects the results in a Tuple5 object.

Annotations
@Deprecated
unexpectedback to summary
public static <T> Parser<T> unexpected(final String name)

A Parser that fails and reports that name is logically unexpected.