Uses of Class
com.google.common.labs.parse.Parser
Packages that use Parser
Package
Description
Parser combinator that's free from infinite loop or accidental left recursion (requires dot-parse artifact)
- 
Uses of Parser in com.google.common.labs.parse
Subclasses of Parser in com.google.common.labs.parseModifier and TypeClassDescriptionstatic final classParser.Rule<T>A forward-declared grammar rule, to be used for recursive grammars.Methods in com.google.common.labs.parse that return ParserModifier and TypeMethodDescriptionstatic <T> Parser<T> Matches if any of the givenparsersmatch.Parser.atLeastOnce()Returns a parser that applies this parser at least once, greedily.Parser.atLeastOnce(BinaryOperator<T> reducer) Returns a parser that applies this parser at least once, greedily, and reduces the results using thereducerfunction.final <A,R> Parser <R> Parser.atLeastOnce(Collector<? super T, A, ? extends R> collector) Returns a parser that applies this parser at least once, greedily, and collects the return values usingcollector.Parser.atLeastOnceDelimitedBy(String delimiter) Returns a parser that matches the current parser at least once, delimited by the given delimiter.Parser.atLeastOnceDelimitedBy(String delimiter, BinaryOperator<T> reducer) Returns a parser that matches the current parser at least once, delimited by the given delimiter, using the givenreducerfunction to reduce the results.final <A,R> Parser <R> Parser.atLeastOnceDelimitedBy(String delimiter, Collector<? super T, A, ? extends R> collector) Returns a parser that matches the current parser at least once, delimited by the given delimiter.Returns a parser that matches the current parser enclosed betweenprefixandsuffix.Returns a parser that matches the current parser enclosed betweenprefixandsuffix, which are non-empty string delimiters.The current optional (or zero-or-more) parser must be enclosed between non-emptyprefixandsuffix.The current optional (or zero-or-more) parser must be enclosed between non-emptyprefixandsuffix.Builds a parser with the configured operators applied to the given operand.Parser.chars(int n) Consumes exactlynconsecutive characters.Parser.consecutive(CharacterSet characterSet) Matches one or more consecutive characters contained incharacterSet.Parser.consecutive(CharPredicate matcher, String name) Matches one or more consecutive characters as specified bymatcher.static <T> Parser<T> Defines a simple recursive grammar without needing to explicitly forward-declare aParser.Rule.Define this rule asparserand returns it.Parser.digits()One or more regex\d+characters.final <R> Parser<R> If this parser matches, applies functionfto get the next parser to match in sequence.Parser.followedBy(Parser<?> suffix) If this parser matches, continue to matchsuffix.Parser.followedBy(Parser<X>.OrEmpty suffix) If this parser matches, continue to match the optionalsuffix.Parser.followedBy(String suffix) If this parser matches, continue to matchsuffix.Parser.OrEmpty.followedBy(String suffix) The current optional (or zero-or-more) parser must be followed by non-emptysuffix.Parser.followedByOrEof(Parser<?> suffix) Specifies that the matched pattern must be either followed bysuffixor EOF.Parser.immediatelyBetween(String prefix, String suffix) Returns a parser that matches the current parser immediately enclosed betweenprefixandsuffix(no skippable characters as specified byparseSkipping()in between).Parser.OrEmpty.immediatelyBetween(String prefix, String suffix) The current optional (or zero-or-more) parser must be immediately enclosed between non-emptyprefixandsuffix(no skippable characters as specified byparseSkipping()in between).static <T> Parser<T> Returns an equivalent parser that suppresses character skipping that's otherwise applied ifparseSkipping()orskipping()are called.final <R> Parser<R> If this parser matches, returns the result of applying the given function to the match.Parser.OrEmpty.notEmpty()Returns the otherwise equivalentParserthat will fail instead of returning the default value if empty.Parser.notFollowedBy(Parser<?> suffix, String name) A form of negative lookahead such that the match is rejected if followed bysuffix.Parser.notFollowedBy(String suffix) A form of negative lookahead such that the match is rejected if followed bysuffix.Parser.notImmediatelyFollowedBy(CharPredicate predicate, String name) A form of negative lookahead such that the match is rejected if immediately followed by (no skippable characters as specified byparseSkipping()in between) a character that matchespredicate.Parser.optionallyFollowedBy(String suffix) Returns an equivalent parser except it allowssuffixif present.Parser.optionallyFollowedBy(String suffix, Function<? super T, ? extends T> op) If this parser matches, optionally applies theopfunction if the pattern is followed bysuffix.Matches ifthisorthatmatches.Parser.postfix(Parser<? extends UnaryOperator<T>> operator) Returns a parser that after this parser succeeds, applies theoperatorparser zero or more times and apply the result unary operator function iteratively.Parser.prefix(Parser<? extends UnaryOperator<T>> operator) Returns a parser that applies theoperatorparser zero or more times beforethisand applies the result unary operator functions iteratively.Parser.quotedStringWithEscapes(char quoteChar, Parser<? extends CharSequence> escaped) String literal quoted byquoteCharwith backslash escapes.static <A,B, C> Parser <C> Parser.sequence(Parser<A> left, Parser<B>.OrEmpty right, BiFunction<? super A, ? super B, ? extends C> combiner) Sequentially matchesleftthenright(which is allowed to be optional), and then combines the results using thecombinerfunction.static <A,B, C> Parser <C> Parser.sequence(Parser<A> left, Parser<B> right, BiFunction<? super A, ? super B, ? extends C> combiner) Sequentially matchesleftthenright, and then combines the results using thecombinerfunction.Parser.single(CharPredicate matcher, String name) Matches a character as specified bymatcher.Parser.source()Returns a parser that matches the current parser and returns the matched string.Matches a literalstring.If this parser matches, applies the givenconditionand disqualifies the match if the condition is false.final <R> Parser<R> If this parser matches, applies the given parser on the remaining input.final <R> Parser<R> If this parser matches, applies the given optional (or zero-or-more) parser on the remaining input.final <R> Parser<R> Parser.thenReturn(R result) If this parser matches, returns the given result.Parser.word()One or more regex\w+characters.Methods in com.google.common.labs.parse that return types with arguments of type ParserModifier and TypeMethodDescriptionParser.or()Returns a collector that results in a parser that matches if any of the inputparsersmatch.Parser.or()Returns a collector that results in a parser that matches if any of the inputparsersmatch.Methods in com.google.common.labs.parse with parameters of type ParserModifier and TypeMethodDescriptionstatic <T> Parser<T> Matches if any of the givenparsersmatch.Returns a parser that matches the current parser enclosed betweenprefixandsuffix.The current optional (or zero-or-more) parser must be enclosed between non-emptyprefixandsuffix.Builds a parser with the configured operators applied to the given operand.Define this rule asparserand returns it.Parser.followedBy(Parser<?> suffix) If this parser matches, continue to matchsuffix.Parser.followedByOrEof(Parser<?> suffix) Specifies that the matched pattern must be either followed bysuffixor EOF.OperatorTable.leftAssociative(Parser<? extends BinaryOperator<T>> operator, int precedence) Adds a left-associative infix operator with the given precedence to the table.static <T> Parser<T> Returns an equivalent parser that suppresses character skipping that's otherwise applied ifparseSkipping()orskipping()are called.OperatorTable.nonAssociative(Parser<? extends BinaryOperator<T>> operator, int precedence) Adds a non-associative infix operator with the given precedence to the table.Parser.notFollowedBy(Parser<?> suffix, String name) A form of negative lookahead such that the match is rejected if followed bysuffix.Matches ifthisorthatmatches.Parser.OrEmpty.parseSkipping(Parser<?> skip, String input) Parses the entire input string, ignoring patterns matched byskip, and returns the result; if there's nothing to parse except skippable content, returns the default empty value.final TParser.parseSkipping(Parser<?> skip, String input) Parsesinputwhile skipping patterns matched byskiparound atomic matches.OperatorTable.postfix(Parser<? extends UnaryOperator<T>> operator, int precedence) Adds a postfix operator with the given precedence to the table.Parser.postfix(Parser<? extends UnaryOperator<T>> operator) Returns a parser that after this parser succeeds, applies theoperatorparser zero or more times and apply the result unary operator function iteratively.OperatorTable.prefix(Parser<? extends UnaryOperator<T>> operator, int precedence) Adds a prefix operator with the given precedence to the table.Parser.prefix(Parser<? extends UnaryOperator<T>> operator) Returns a parser that applies theoperatorparser zero or more times beforethisand applies the result unary operator functions iteratively.Parser.quotedStringWithEscapes(char quoteChar, Parser<? extends CharSequence> escaped) String literal quoted byquoteCharwith backslash escapes.OperatorTable.rightAssociative(Parser<? extends BinaryOperator<T>> operator, int precedence) Adds a right-associative infix operator with the given precedence to the table.static <A,B, C> Parser <C> Parser.sequence(Parser<A> left, Parser<B>.OrEmpty right, BiFunction<? super A, ? super B, ? extends C> combiner) Sequentially matchesleftthenright(which is allowed to be optional), and then combines the results using thecombinerfunction.static <A,B, C> Parser <C> Parser.sequence(Parser<A> left, Parser<B> right, BiFunction<? super A, ? super B, ? extends C> combiner) Sequentially matchesleftthenright, and then combines the results using thecombinerfunction.Starts a fluent chain for parsing inputs while skipping patterns matched byskip.final <R> Parser<R> If this parser matches, applies the given parser on the remaining input.Parser.zeroOrMoreDelimited(Parser<A> first, Parser<B>.OrEmpty second, String delimiter, BiCollector<? super A, ? super B, R> collector) Appliesfirstand the optionalsecondpatterns in order, for zero or more times, collecting the results using the providedBiCollector.Parser.zeroOrMoreDelimited(Parser<A> first, Parser<B> second, String delimiter, BiCollector<? super A, ? super B, R> collector) Appliesfirstandsecondpatterns 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 ParserModifier and TypeMethodDescriptionstatic <T> Parser<T> Defines a simple recursive grammar without needing to explicitly forward-declare aParser.Rule.static <T> Parser<T> Defines a simple recursive grammar without needing to explicitly forward-declare aParser.Rule.final <R> Parser<R> If this parser matches, applies functionfto get the next parser to match in sequence.