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
-
Uses of Parser in com.google.common.labs.parse
Subclasses of Parser in com.google.common.labs.parseModifier and TypeClassDescriptionstatic final class
Parser.Lazy<T>
A lazy parser, 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 givenparsers
match.Parser.atLeastOnce()
Returns a parser that applies this parser at least once, greedily.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.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 immediately enclosed betweenopen
andclose
.Returns a parser that matches the current parser immediately enclosed betweenopen
andclose
, which are non-empty string delimiters.The current optional (or zero-or-more) parser must be enclosed between non-emptyprefix
andsuffix
.The current optional (or zero-or-more) parser must be enclosed between non-emptyprefix
andsuffix
.Builds a parser with the configured operators applied to the given operand.Parser.consecutive
(CharPredicate matcher, String name) Matches one or more consecutive characters as specified bymatcher
.Parser.Lazy.delegateTo
(Parser<T> parser) Sets and returns the delegate parser.Returns an equivalent parser that fails if the parser result doesn't satisfy the givenpredicate
.final <R> Parser
<R> If this parser matches, applies functionf
to 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
.static <T> Parser
<T> Returns an equivalent parser that suppresses character skipping that's otherwise applied ifparseSkipping()
orparseToStreamSkipping()
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 equivalentParser
that 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.optionallyFollowedBy
(Parser<? extends UnaryOperator<T>> suffix) Returns an equivalent parser except it will optionally apply the unary operator resulting fromsuffix
.Parser.optionallyFollowedBy
(String suffix) Returns an equivalent parser except it allowssuffix
if present.Parser.optionallyFollowedBy
(String suffix, Function<? super T, ? extends T> op) If this parser matches, optionally applies theop
function if the pattern is followed bysuffix
.Matches ifthis
orthat
matches.Parser.postfix
(Parser<? extends UnaryOperator<T>> operator) Returns a parser that after this parser succeeds, applies theoperator
parser zero or more times and apply the result unary operator function iteratively.Parser.prefix
(Parser<? extends UnaryOperator<T>> operator) Returns a parser that applies theoperator
parser zero or more times beforethis
and applies the result unary operator functions iteratively.static <A,
B, C> Parser <C> Parser.sequence
(Parser<A> left, Parser<B>.OrEmpty right, BiFunction<? super A, ? super B, ? extends C> combiner) Sequentially matchesleft
thenright
(which is allowed to be optional), and then combines the results using thecombiner
function.static <A,
B, C> Parser <C> Parser.sequence
(Parser<A> left, Parser<B> right, BiFunction<? super A, ? super B, ? extends C> combiner) Sequentially matchesleft
thenright
, and then combines the results using thecombiner
function.Parser.single
(CharPredicate matcher, String name) Matches a character as specified bymatcher
.Matches a literalstring
.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.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 inputparsers
match.Parser.or()
Returns a collector that results in a parser that matches if any of the inputparsers
match.Methods in com.google.common.labs.parse with parameters of type ParserModifier and TypeMethodDescriptionstatic <T> Parser
<T> Matches if any of the givenparsers
match.Returns a parser that matches the current parser immediately enclosed betweenopen
andclose
.The current optional (or zero-or-more) parser must be enclosed between non-emptyprefix
andsuffix
.Builds a parser with the configured operators applied to the given operand.Parser.Lazy.delegateTo
(Parser<T> parser) Sets and returns the delegate parser.Parser.followedBy
(Parser<?> suffix) If this parser matches, continue to matchsuffix
.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()
orparseToStreamSkipping()
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
.Parser.optionallyFollowedBy
(Parser<? extends UnaryOperator<T>> suffix) Returns an equivalent parser except it will optionally apply the unary operator resulting fromsuffix
.Matches ifthis
orthat
matches.final T
Parser.parseSkipping
(Parser<?> skip, String input) Parsesinput
while skipping patterns matched byskip
around atomic matches.Parser.parseToStreamSkipping
(Parser<?> skip, String input) Parsesinput
to a lazy stream while skipping patterns matched byskip
around 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 theoperator
parser 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 theoperator
parser zero or more times beforethis
and applies the result unary operator functions iteratively.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 matchesleft
thenright
(which is allowed to be optional), and then combines the results using thecombiner
function.static <A,
B, C> Parser <C> Parser.sequence
(Parser<A> left, Parser<B> right, BiFunction<? super A, ? super B, ? extends C> combiner) Sequentially matchesleft
thenright
, and then combines the results using thecombiner
function.final <R> Parser
<R> If this parser matches, applies the given parser on the remaining input.Method parameters in com.google.common.labs.parse with type arguments of type Parser