Class Api
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SatisfyalphaNum()Alphabetic characters plus digitsstatic <U> Matcher<U> Takes the first one of the succeeding matchers.static SatisfyanyChar()Matches any single char.static SatisfyAny of the enumerated chars.static SatisfyCaptures single given charstatic StrCaptures exact string.Succeds if any of the matchers succeeds.Succeds if any of the matchers succeeds.Succeds if any of the matchers succeeds.Succeds if any of the matchers succeeds.Succeds if any of the matchers succeeds.choice(Matcher<T> c1, Matcher<U> c2, Matcher<W> c3, Matcher<Z> c4, Matcher<X> c5, Matcher<G> c6, Matcher<H> c7) Succeds if any of the matchers succeeds.static SinglelineCommentTakes a single line comment starting with an activator string.static Satisfydigit()Single digit starting from '0'static Eoseos()By default rules take only parts in greedy way leaving off the rest and succeeding.static <T> Indent<T> Applies scope of to inner rule and increments the indentation.static ContextConvenience method for wrapping text in Context.static Satisfyletter()Any alphabetic character.static <T> Lexeme<T> Wraps first rule and takes up second rule to exhaustion.static Satisfylower()Alphabetic character lower casestatic <U> Many<U> Zero or more occurences of matcher.static MultilineCommentmultilineComment(String start, String end) Takes multiline comment starting with start and ending with end activators.static Newlinenl()Newline that is indentation sensitive.static SatisfyFails if any of the characters specified is matched.static SatisfySingle digit starting from '1'.Fails if matcher succeeds.static <T> Opt<T> Optional occurence of the matcher.static SatisfySingle character in between the range start..endstatic <T> Recursive<T> Allows to refer to itself before setting.static SatisfyApplies predicate on single character and succeds if predicate succeeds.Zero or more occurences of first rule separated by second rule.Asserts all matchers succeed in order.Asserts all matchers succeed in order.Asserts all matchers succeed in order.Asserts all matchers succeed in order.seq(Matcher<T> one, Matcher<U> two, Matcher<W> three, Matcher<Z> four, Matcher<Y> five, Matcher<X> six) Asserts all matchers succeed in order.seq(Matcher<T> one, Matcher<U> two, Matcher<W> three, Matcher<Z> four, Matcher<Y> five, Matcher<X> six, Matcher<G> seven) Asserts all matchers succeed in order.static <U> Many<U> One or more occurences of matcher.static SpacesTakes one or more specified whitespaces.static StrstringIgnoreCase(String pattern) Matches a string ignoring the case sensitivity.static <U> Times<U> Matches exactly X occurences of matcher.static <U> Times<U> For success matcher has to be matched between from and to times.static Satisfyupper()Alphabetic character upper case.static SatisfyMatches on java’sCharacter::isWhitespacefor single char.
-
Constructor Details
-
Api
public Api()
-
-
Method Details
-
anyChar
Matches any single char.
-
anyOf
Any of the enumerated chars.
-
c
Captures single given char
-
whitespace
Matches on java’s
Character::isWhitespacefor single char. -
nonZeroDigit
Single digit starting from '1'.
-
digit
Single digit starting from '0'
-
letter
Any alphabetic character.
-
alphaNum
Alphabetic characters plus digits
-
lower
Alphabetic character lower case
-
upper
Alphabetic character upper case.
-
satisfy
Applies predicate on single character and succeds if predicate succeeds.
-
range
Single character in between the range start..end
-
noneOf
Fails if any of the characters specified is matched.
-
choice
Succeds if any of the matchers succeeds.
-
choice
Succeds if any of the matchers succeeds.
-
choice
public static <T,U, Matcher<Choice4<T,W, Z> U, choiceW, Z>> (Matcher<T> c1, Matcher<U> c2, Matcher<W> c3, Matcher<Z> c4) Succeds if any of the matchers succeeds.
-
choice
public static <T,U, Matcher<Choice5<T,W, Z, X> U, choiceW, Z, X>> (Matcher<T> c1, Matcher<U> c2, Matcher<W> c3, Matcher<Z> c4, Matcher<X> c5) Succeds if any of the matchers succeeds.
-
choice
public static <T,U, Matcher<Choice6<T,W, Z, X, G> U, choiceW, Z, X, G>> (Matcher<T> c1, Matcher<U> c2, Matcher<W> c3, Matcher<Z> c4, Matcher<X> c5, Matcher<G> c6) Succeds if any of the matchers succeeds.
-
choice
public static <T,U, Matcher<Choice7<T,W, Z, X, G, H> U, choiceW, Z, X, G, H>> (Matcher<T> c1, Matcher<U> c2, Matcher<W> c3, Matcher<Z> c4, Matcher<X> c5, Matcher<G> c6, Matcher<H> c7) Succeds if any of the matchers succeeds.
-
seq
Asserts all matchers succeed in order.
-
seq
public static <T,U, Seq.SeqX<Tuple3<T,W> U, seqW>> (Matcher<T> one, Matcher<U> two, Matcher<W> three) Asserts all matchers succeed in order.
-
seq
public static <T,U, Seq.SeqX<Tuple4<T,W, Z> U, seqW, Z>> (Matcher<T> one, Matcher<U> two, Matcher<W> three, Matcher<Z> four) Asserts all matchers succeed in order.
-
seq
public static <T,U, Seq.SeqX<Tuple5<T,W, Z, Y> U, seqW, Z, Y>> (Matcher<T> one, Matcher<U> two, Matcher<W> three, Matcher<Z> four, Matcher<Y> five) Asserts all matchers succeed in order.
-
seq
public static <T,U, Seq.SeqX<Tuple6<T,W, Z, Y, X> U, seqW, Z, Y, X>> (Matcher<T> one, Matcher<U> two, Matcher<W> three, Matcher<Z> four, Matcher<Y> five, Matcher<X> six) Asserts all matchers succeed in order.
-
seq
public static <T,U, Seq.SeqX<Tuple7<T,W, Z, Y, X, G> U, seqW, Z, Y, X, G>> (Matcher<T> one, Matcher<U> two, Matcher<W> three, Matcher<Z> four, Matcher<Y> five, Matcher<X> six, Matcher<G> seven) Asserts all matchers succeed in order.
-
any
Takes the first one of the succeeding matchers. All matchers have to wrap the same type.
-
many
Zero or more occurences of matcher. Always succeeds.
-
some
One or more occurences of matcher. Fails on zero occurences.
-
times
Matches exactly X occurences of matcher.
-
times
For success matcher has to be matched between from and to times.
-
opt
Optional occurence of the matcher. Always succeds.
-
c
Captures exact string.
-
stringIgnoreCase
Matches a string ignoring the case sensitivity.
-
spaces
Takes one or more specified whitespaces. If none are specified then the Java defaults are applied.
-
comment
Takes a single line comment starting with an activator string.
-
multilineComment
Takes multiline comment starting with start and ending with end activators.
-
lexeme
Wraps first rule and takes up second rule to exhaustion. Second rule is typically a whitespace. Only first rule is returned.
-
sepBy
Zero or more occurences of first rule separated by second rule.
-
not
Fails if matcher succeeds.
-
recursive
Allows to refer to itself before setting. Typically you handle recurrence by using
recursive()refering to it by other rules and finally setting it withset()method. -
indent
Applies scope of to inner rule and increments the indentation. The indentation is executed on newlines
nl() -
nl
Newline that is indentation sensitive.
-
input
Convenience method for wrapping text in Context.
-
eos
By default rules take only parts in greedy way leaving off the rest and succeeding. By applying
eos()we can assert that text is parsed from start to finish.
-