Uses of Interface
com.google.common.labs.parse.Production
Packages that use Production
Package
Description
Parser combinator that's free from infinite loop or accidental left recursion (requires dot-parse artifact)
-
Uses of Production in com.google.common.labs.parse
Classes in com.google.common.labs.parse that implement ProductionModifier and TypeClassDescriptionclassParser<T>A simple recursive descent parser combinator intended to parse simple grammars such as regex, csv format string patterns etc.final classFacilitates a fluent chain for matching the current parser optionally.static final classParser.Rule<T>A forward-declared production rule, to be used for recursive grammars.Methods in com.google.common.labs.parse that return ProductionModifier and TypeMethodDescriptionReturns a production rule that matchesthispattern enclosed betweenprefixandsuffix,* both allowed to be empty.<S> Production<T> Production.followedBy(Parser<S>.OrEmpty suffix) The current production may optionally be followed bysuffix.<S> Production<T> Production.optionallyFollowedBy(Parser<S> suffix, BiFunction<? super T, ? super S, ? extends T> op) If this production rule matches, optionally matchessuffixwith theopBiFunction to transform the current production's result.Production.optionallyFollowedBy(String suffix) Returns an equivalent production except it allowssuffixif present.Production.optionallyFollowedBy(String suffix, Function<? super T, ? extends T> op) If this production rule matches, optionally applies theopfunction if this production is followed bysuffix.<S> Production<S> After matching the current production rule, proceed to matchsuffix.Methods in com.google.common.labs.parse with parameters of type ProductionModifier and TypeMethodDescriptionstatic <A,B, C, D, R>
Parser<R> Parser.sequence(Parser<A> a, Production<B> b, Production<C> c, Production<D> d, Function4<? super A, ? super B, ? super C, ? super D, ? extends R> combiner) Sequentially matchesa,b,candd, and then combines the results using thecombinerfunction.static <A,B, C, R> Parser <R> Parser.sequence(Parser<A> a, Production<B> b, Production<C> c, TriFunction<? super A, ? super B, ? super C, ? extends R> combiner) Sequentially matchesa,bandc, and then combines the results using thecombinerfunction.static <A,B, R> Parser <R> Parser.sequence(Parser<A> left, Production<B> right, BiFunction<? super A, ? super B, ? extends R> combiner) Sequentially matchesleftthenright, and then combines the results using thecombinerfunction.Parser.zeroOrMoreDelimited(Parser<A> first, Production<B> second, String delimiter, BiCollector<? super A, ? super B, R> collector) Appliesfirstand the optionalsecondpattern in order, for zero or more times, collecting the results using the providedBiCollector.Method parameters in com.google.common.labs.parse with type arguments of type ProductionModifier and TypeMethodDescriptionfinal <R> Parser<R> Parser.flatMap(Function<? super T, ? extends Production<? extends R>> f) If this parser matches, applies functionfto get the next production rule to match in sequence.