package de.plugh.compositeparse.parsers; import de.plugh.compositeparse.Block; import de.plugh.compositeparse.Pair; import de.plugh.compositeparse.ParseException; import de.plugh.compositeparse.Parser; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.function.Function; /** * Decide which parser to use from a list of "body" parsers and their "head"s. *
* If a "head" parses successfully, the corresponding "body" parser must be successful, otherwise a parse exception is
* raised. If no "head" is successful, the {@link Decision} parser fails too.
*
* @param , String> getNamingScheme() {
return Block::alternative;
}
@Override
public T read(Block block) throws ParseException {
for (Pair