Uses of Class
com.google.common.labs.parse.Parser
Packages that use Parser
Package
Description
A strict, i18n-compliant email address parser (requires dot-parse artifact)
Parser combinator that's free from infinite loop or accidental left recursion (requires dot-parse artifact)
-
Uses of Parser in com.google.common.labs.email
Fields in com.google.common.labs.email declared as ParserModifier and TypeFieldDescriptionstatic final Parser<EmailAddress> EmailAddress.PARSERThe parser for email address, according to RFC 5322, and supporting BMP characters. -
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.final <A,R> Parser <R> Parser.atLeastOnceDelimitedBy(Parser<?> delimiter, Collector<? super T, A, ? extends R> collector) Returns a parser that matchesthispattern at least once, delimited by the given delimiter.Parser.atLeastOnceDelimitedBy(String delimiter) Returns a parser that matchesthispattern at least once, delimited by the given delimiter.Parser.atLeastOnceDelimitedBy(String delimiter, BinaryOperator<T> reducer) Returns a parser that matchesthispattern 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 matchesthispattern at least once, delimited by the given delimiter.Returns a parser that matchesthispattern enclosed betweenprefixandsuffix, both allowed to be empty.Returns a parser that matchesthispattern enclosed betweenprefixandsuffix.Returns a parser that matchesthispattern 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.Parser.bmpCodeUnit()Parses a 4-digit hex BMP code unit.Builds a parser with the configured operators applied to the given operand.static Parser<?> Parser.caseInsensitive(String string) Matches a literalstringcase insensitively.static Parser<?> Parser.caseInsensitiveWord(String word) caseInsensitiveWord("or")matches "Or" and "OR", but not "orange".Parser.chars(int n) Consumes exactlynconsecutive characters.Parser.codePoint()Deprecated.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.Returns a parser that finds the first literalstringthat may start from the current position or after any number of 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 matchesthispattern 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.one(CharPredicate matcher, String name) Matches a character as specified bymatcher.Parser.optionallyFollowedBy(Parser<S> suffix, BiFunction<? super T, ? super S, ? extends T> op) If this parser matches, optionally matchessuffixwith theopBiFunction to transform the current parser's result.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) Deprecated.UsewithPostfixes(Parser)instead.Parser.postfix(Parser<S> operator, BiFunction<? super T, ? super S, ? extends T> postfixFunction) Deprecated.UsewithPostfixes(Parser, BiFunction)instead.Parser.prefix(Parser<? extends UnaryOperator<T>> operator) Deprecated.Parser.quotedBy(char before, char after) Matches the characters quoted bybeforeandafter, and returns the string in between.Matches the characters quoted bybeforeandafter, and returns the string in between.Parser.quotedByWithEscapes(char before, char after, Parser<? extends CharSequence> escaped) String literal quoted bybeforeandafterwith backslash escapes.Parser.quotedByWithEscapes(String before, char after, Parser<? extends CharSequence> escaped) String literal quoted bybeforeandafterwith backslash escapes.Parser.quotedStringWithEscapes(char quoteChar, Parser<? extends CharSequence> escaped) 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, D, T>
Parser<T> Parser.sequence(Parser<A> a, Parser<B> b, Parser<C> c, Parser<D> d, Function4<? super A, ? super B, ? super C, ? super D, ? extends T> combiner) Sequentially matchesa,b,candd, and then combines the results using thecombinerfunction.static <A,B, C, T> Parser <T> Parser.sequence(Parser<A> a, Parser<B> b, Parser<C> c, TriFunction<? super A, ? super B, ? super C, ? extends T> combiner) Sequentially matchesa,bandc, 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) Deprecated.Parser.source()Returns a parser that matchesthispattern 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.withPostfixes(Parser<? extends UnaryOperator<T>> operator) Returns a parser that after this parser succeeds, applies theoperatorparser zero or more times and applies the result unary operator function iteratively.Parser.withPostfixes(Parser<S> operator, BiFunction<? super T, ? super S, ? extends T> postfixFunction) Returns a parser that after this parser succeeds, applies theoperatorparser zero or more times and applies the result unary operator function iteratively.Parser.withPrefixes(Parser<? extends UnaryOperator<T>> operator) Returns a parser that applies theoperatorparser zero or more times beforethisand applies the result unary operator functions iteratively.Parser.word()One or more regex\w+characters.word("or")matches "or" but not "orange".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.final <A,R> Parser <R> Parser.atLeastOnceDelimitedBy(Parser<?> delimiter, Collector<? super T, A, ? extends R> collector) Returns a parser that matchesthispattern at least once, delimited by the given delimiter.Returns a parser that matchesthispattern 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 (e.g.Parser.notFollowedBy(Parser<?> suffix, String name) A form of negative lookahead such that the match is rejected if followed bysuffix.Parser.optionallyFollowedBy(Parser<S> suffix, BiFunction<? super T, ? super S, ? extends T> op) If this parser matches, optionally matchessuffixwith theopBiFunction to transform the current parser's result.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.<S> OperatorTable<T> OperatorTable.postfix(Parser<S> operator, BiFunction<? super T, ? super S, ? extends T> postfixFunction, int precedence) Adds a postfix operator with the given precedence to the table.Parser.postfix(Parser<? extends UnaryOperator<T>> operator) Deprecated.UsewithPostfixes(Parser)instead.Parser.postfix(Parser<S> operator, BiFunction<? super T, ? super S, ? extends T> postfixFunction) Deprecated.UsewithPostfixes(Parser, BiFunction)instead.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) Deprecated.Parser.quotedByWithEscapes(char before, char after, Parser<? extends CharSequence> escaped) String literal quoted bybeforeandafterwith backslash escapes.Parser.quotedByWithEscapes(String before, char after, Parser<? extends CharSequence> escaped) String literal quoted bybeforeandafterwith backslash escapes.Parser.quotedStringWithEscapes(char quoteChar, Parser<? extends CharSequence> escaped) 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, D, T>
Parser<T> Parser.sequence(Parser<A> a, Parser<B> b, Parser<C> c, Parser<D> d, Function4<? super A, ? super B, ? super C, ? super D, ? extends T> combiner) Sequentially matchesa,b,candd, and then combines the results using thecombinerfunction.static <A,B, C, T> Parser <T> Parser.sequence(Parser<A> a, Parser<B> b, Parser<C> c, TriFunction<? super A, ? super B, ? super C, ? extends T> combiner) Sequentially matchesa,bandc, 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.withPostfixes(Parser<? extends UnaryOperator<T>> operator) Returns a parser that after this parser succeeds, applies theoperatorparser zero or more times and applies the result unary operator function iteratively.Parser.withPostfixes(Parser<S> operator, BiFunction<? super T, ? super S, ? extends T> postfixFunction) Returns a parser that after this parser succeeds, applies theoperatorparser zero or more times and applies the result unary operator function iteratively.Parser.withPrefixes(Parser<? extends UnaryOperator<T>> operator) Returns a parser that applies theoperatorparser zero or more times beforethisand applies the result unary operator functions iteratively.Parser.zeroOrMoreDelimited(Parser<A> first, Parser<B>.OrEmpty 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.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.Parser.zeroOrMoreDelimitedBy(Parser<?> delimiter, Collector<? super T, A, ? extends R> collector) Starts a fluent chain for matching the current parser zero or more times, delimited bydelimiter.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.
bmpCodeUnit()instead.