A
- attributepublic class Rena<A>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
PatternAction<A> |
I |
Constructor and Description |
---|
Rena()
Constructs a class to create parser definition with default settings.
|
Rena(java.util.List<java.lang.String> keys)
Constructs a class to create parser definition with keywords.
A longest keyword will be matched. |
Rena(java.lang.String toIgnore)
Constructs a class to create parser definition with a regular expression to ignore.
|
Rena(java.lang.String[] keys)
Constructs a class to create parser definition with keywords.
A longest keyword will be matched. |
Rena(java.lang.String toIgnore,
java.util.List<java.lang.String> keys)
Constructs a class to create parser definition with a regular expression to ignore and keywords.
A longest keyword will be matched. |
Rena(java.lang.String toIgnore,
java.lang.String[] keys)
Constructs a class to create parser definition with a regular expression to ignore and keywords.
A longest keyword will be matched. |
Modifier and Type | Method and Description |
---|---|
OperationMatcher<A> |
atLeast(int count,
PatternMatcher<A> pattern)
repeats the given pattern at least the given count.
This method is NOT backtracking. |
OperationMatcher<A> |
atLeast(int count,
PatternMatcher<A> pattern,
PatternAction<A> action)
repeats the given pattern at least the given count.
This method is NOT backtracking. |
OperationMatcher<A> |
atLeast(int count,
PatternMatcher<A> pattern,
PatternAction<A> action,
A init)
repeats the given pattern at least the given count.
This method is NOT backtracking. |
OperationMatcher<A> |
atMost(int count,
PatternMatcher<A> pattern)
repeats the given pattern at most the given count.
This method is NOT backtracking. |
OperationMatcher<A> |
atMost(int count,
PatternMatcher<A> pattern,
PatternAction<A> action)
repeats the given pattern at most the given count.
This method is NOT backtracking. |
OperationMatcher<A> |
atMost(int count,
PatternMatcher<A> pattern,
PatternAction<A> action,
A init)
repeats the given pattern at most the given count.
This method is NOT backtracking. |
LookaheadMatcher<A> |
attr(A attr)
sets the attribute to the given value.
|
LookaheadMatcher<A> |
br()
creates a matcher which matches newline.
|
OperationMatcher<A> |
delimit(PatternMatcher<A> pattern,
PatternMatcher<A> delimiter)
matches a string which is delimited by the given string.
This method is NOT backtracking. |
OperationMatcher<A> |
delimit(PatternMatcher<A> pattern,
PatternMatcher<A> delimiter,
PatternAction<A> action)
matches a string which is delimited by the given string.
This method is NOT backtracking. |
OperationMatcher<A> |
delimit(PatternMatcher<A> pattern,
PatternMatcher<A> delimiter,
PatternAction<A> action,
A init)
matches a string which is delimited by the given pattern.
This method is NOT backtracking. |
LookaheadMatcher<A> |
equalsId(java.lang.String id)
creates a matcher which matches the given string.
If a pattern to ignore is specified, the id which succeeds the pattern to ignore will only match. If keywords is specified, the id which succeeds the keywords will only match. |
LookaheadMatcher<A> |
key(java.lang.String key)
creates a matcher which matches a given keyword.
A longest keyword will be matched. |
static <A> PatternMatcher<A> |
letrec(java.util.function.BiFunction<PatternMatcher<A>,PatternMatcher<A>,PatternMatcher<A>> func1,
java.util.function.BiFunction<PatternMatcher<A>,PatternMatcher<A>,PatternMatcher<A>> func2)
A method which can refer a return values of the function itself.
This method will be used for defining a pattern with recursion. |
static <A> PatternMatcher<A> |
letrec(java.util.function.Function<PatternMatcher<A>,PatternMatcher<A>> func)
A method which can refer a return value of the function itself.
This method will be used for defining a pattern with recursion. |
static <A> PatternMatcher<A> |
letrec(Letrec3Function<A> func1,
Letrec3Function<A> func2,
Letrec3Function<A> func3)
A method which can refer a return values of the function itself.
This method will be used for defining a pattern with recursion. |
static <A> PatternMatcher<A> |
letrec(Letrec4Function<A> func1,
Letrec4Function<A> func2,
Letrec4Function<A> func3,
Letrec4Function<A> func4)
A method which can refer a return values of the function itself.
This method will be used for defining a pattern with recursion. |
static <A> PatternMatcher<A> |
letrec(Letrec5Function<A> func1,
Letrec5Function<A> func2,
Letrec5Function<A> func3,
Letrec5Function<A> func4,
Letrec5Function<A> func5)
A method which can refer a return values of the function itself.
This method will be used for defining a pattern with recursion. |
OperationMatcher<A> |
maybe(PatternMatcher<A> pattern)
matches zero or one of the given pattern.
This method is NOT backtracking. |
OperationMatcher<A> |
maybe(PatternMatcher<A> pattern,
PatternAction<A> action)
matches zero or one of the given pattern.
This method is NOT backtracking. |
LookaheadMatcher<A> |
notKey()
creates a matcher which matches if any keyword does not match.
|
OperationMatcher<A> |
oneOrMore(PatternMatcher<A> pattern)
a shortcut of 'atLeast(1, pattern)'.
This method is NOT backtracking. |
OperationMatcher<A> |
oneOrMore(PatternMatcher<A> pattern,
PatternAction<A> action)
a shortcut of 'atLeast(1, pattern, action)'.
This method is NOT backtracking. |
OperationMatcher<A> |
oneOrMore(PatternMatcher<A> pattern,
PatternAction<A> action,
A init)
a shortcut of 'atLeast(1, pattern, action, init)'.
This method is NOT backtracking. |
OrMatcher<A> |
or(java.util.List<PatternMatcher<A>> args)
creates a matcher which matches when one of matchers in the given list matches.
|
OrMatcher<A> |
or(PatternMatcher<A> arg1,
PatternMatcher<A> arg2)
creates a matcher which matches when one of the given matchers matches.
|
OrMatcher<A> |
or(PatternMatcher<A> arg1,
PatternMatcher<A> arg2,
PatternMatcher<A> arg3)
creates a matcher which matches when one of the given matchers matches.
|
OrMatcher<A> |
or(PatternMatcher<A> arg1,
PatternMatcher<A> arg2,
PatternMatcher<A> arg3,
PatternMatcher<A> arg4)
creates a matcher which matches when one of the given matchers matches.
|
LookaheadMatcher<A> |
real(boolean signum,
PatternAction<A> action)
creates a matcher which matches float number.
The sign is considered if the given signum is true. |
LookaheadMatcher<A> |
regex(java.lang.String regex)
creates a matcher which matches with a regular expression.
|
LookaheadMatcher<A> |
regex(java.lang.String regex,
PatternAction<A> action)
creates a matcher which matches with a regular expression
and an action which executes when the pattern is matched.
|
LookaheadMatcher<A> |
string(java.lang.String string)
creates a matcher which matches with a given string.
|
LookaheadMatcher<A> |
string(java.lang.String string,
PatternAction<A> action)
creates a matcher which matches with a given string
and an action which executes when the pattern is matched.
|
LookaheadMatcher<A> |
then(PatternMatcher<A> matcher)
wraps a given matcher.
|
LookaheadMatcher<A> |
then(PatternMatcher<A> matcher,
PatternAction<A> action)
wraps a given matcher and an action which executes when the pattern is matched.
|
OperationMatcher<A> |
times(int countmin,
int countmax,
PatternMatcher<A> pattern)
repeats the given patterns to the given count.
This method is NOT backtracking. |
OperationMatcher<A> |
times(int countmin,
int countmax,
PatternMatcher<A> pattern,
PatternAction<A> action)
repeats the given patterns to the given count.
This method is NOT backtracking. |
OperationMatcher<A> |
times(int countmin,
int countmax,
PatternMatcher<A> pattern,
PatternAction<A> action,
A init)
repeats the given patterns to the given count.
This method is NOT backtracking. |
OperationMatcher<A> |
zeroOrMore(PatternMatcher<A> pattern)
a shortcut of 'atLeast(0, pattern)'.
This method is NOT backtracking. |
OperationMatcher<A> |
zeroOrMore(PatternMatcher<A> pattern,
PatternAction<A> action)
a shortcut of 'atLeast(0, pattern, action)'.
This method is NOT backtracking. |
OperationMatcher<A> |
zeroOrMore(PatternMatcher<A> pattern,
PatternAction<A> action,
A init)
a shortcut of 'atLeast(0, pattern, action, init)'.
This method is NOT backtracking. |
public final PatternAction<A> I
public Rena()
public Rena(java.lang.String toIgnore)
toIgnore
- a regular expression to ignorepublic Rena(java.lang.String[] keys)
keys
- an array of keywordspublic Rena(java.util.List<java.lang.String> keys)
keys
- an array of keywordspublic Rena(java.lang.String toIgnore, java.lang.String[] keys)
toIgnore
- a regular expression to ignorekeys
- an array of keywordspublic Rena(java.lang.String toIgnore, java.util.List<java.lang.String> keys)
toIgnore
- a regular expression to ignorekeys
- an array of keywordspublic LookaheadMatcher<A> then(PatternMatcher<A> matcher, PatternAction<A> action)
matcher
- a matcher by PatternMatcher interfaceaction
- an action to executepublic LookaheadMatcher<A> then(PatternMatcher<A> matcher)
matcher
- a matcher by PatternMatcher interfacepublic LookaheadMatcher<A> string(java.lang.String string, PatternAction<A> action)
string
- a string to be matchedaction
- an action to executepublic LookaheadMatcher<A> string(java.lang.String string)
string
- a string to be matchedpublic LookaheadMatcher<A> regex(java.lang.String regex, PatternAction<A> action)
regex
- a regular expression to be matchedaction
- an action to executepublic LookaheadMatcher<A> regex(java.lang.String regex)
regex
- a regular expression to be matchedpublic LookaheadMatcher<A> key(java.lang.String key)
key
- a string to be matchedpublic LookaheadMatcher<A> notKey()
public LookaheadMatcher<A> br()
public LookaheadMatcher<A> equalsId(java.lang.String id)
id
- a stringpublic LookaheadMatcher<A> real(boolean signum, PatternAction<A> action)
signum
- signaction
- an actionpublic OrMatcher<A> or(PatternMatcher<A> arg1, PatternMatcher<A> arg2)
arg1
- a matcherarg2
- a matcherpublic OrMatcher<A> or(PatternMatcher<A> arg1, PatternMatcher<A> arg2, PatternMatcher<A> arg3)
arg1
- a matcherarg2
- a matcherarg3
- a matcherpublic OrMatcher<A> or(PatternMatcher<A> arg1, PatternMatcher<A> arg2, PatternMatcher<A> arg3, PatternMatcher<A> arg4)
arg1
- a matcherarg2
- a matcherarg3
- a matcherarg4
- a matcherpublic OrMatcher<A> or(java.util.List<PatternMatcher<A>> args)
args
- a list of matcherspublic OperationMatcher<A> times(int countmin, int countmax, PatternMatcher<A> pattern, PatternAction<A> action, A init)
countmin
- minimum of repetitioncountmax
- maximum of repetitionpattern
- a matcheraction
- an action to be invokedinit
- an initial attributepublic OperationMatcher<A> times(int countmin, int countmax, PatternMatcher<A> pattern, PatternAction<A> action)
countmin
- minimum of repetitioncountmax
- maximum of repetitionpattern
- a matcheraction
- an action to be invokedpublic OperationMatcher<A> times(int countmin, int countmax, PatternMatcher<A> pattern)
countmin
- minimum of repetitioncountmax
- maximum of repetitionpattern
- a matcherpublic OperationMatcher<A> atLeast(int count, PatternMatcher<A> pattern, PatternAction<A> action, A init)
count
- minimum of repetitionpattern
- a matcheraction
- an action to be invokedinit
- an initial attributepublic OperationMatcher<A> atLeast(int count, PatternMatcher<A> pattern, PatternAction<A> action)
count
- minimum of repetitionpattern
- a matcheraction
- an action to be invokedpublic OperationMatcher<A> atLeast(int count, PatternMatcher<A> pattern)
count
- minimum of repetitionpattern
- a matcherpublic OperationMatcher<A> atMost(int count, PatternMatcher<A> pattern, PatternAction<A> action, A init)
count
- maximum of repetitionpattern
- a matcheraction
- an action to be invokedinit
- an initial attributepublic OperationMatcher<A> atMost(int count, PatternMatcher<A> pattern, PatternAction<A> action)
count
- maximum of repetitionpattern
- a matcheraction
- an action to be invokedpublic OperationMatcher<A> atMost(int count, PatternMatcher<A> pattern)
count
- maximum of repetitionpattern
- a matcherpublic OperationMatcher<A> maybe(PatternMatcher<A> pattern, PatternAction<A> action)
pattern
- a matcheraction
- an action to be invokedpublic OperationMatcher<A> maybe(PatternMatcher<A> pattern)
pattern
- a matcherpublic OperationMatcher<A> zeroOrMore(PatternMatcher<A> pattern, PatternAction<A> action, A init)
pattern
- a matcheraction
- an action to be invokedinit
- an initial attributepublic OperationMatcher<A> zeroOrMore(PatternMatcher<A> pattern, PatternAction<A> action)
pattern
- a matcheraction
- an action to be invokedpublic OperationMatcher<A> zeroOrMore(PatternMatcher<A> pattern)
pattern
- a matcherpublic OperationMatcher<A> oneOrMore(PatternMatcher<A> pattern, PatternAction<A> action, A init)
pattern
- a matcheraction
- an action to be invokedinit
- an initial attributepublic OperationMatcher<A> oneOrMore(PatternMatcher<A> pattern, PatternAction<A> action)
pattern
- a matcheraction
- an action to be invokedpublic OperationMatcher<A> oneOrMore(PatternMatcher<A> pattern)
pattern
- a matcherpublic OperationMatcher<A> delimit(PatternMatcher<A> pattern, PatternMatcher<A> delimiter, PatternAction<A> action, A init)
pattern
- a matcherdelimiter
- a pattern of delimiteraction
- an action to be invokedinit
- an initial attributepublic OperationMatcher<A> delimit(PatternMatcher<A> pattern, PatternMatcher<A> delimiter, PatternAction<A> action)
pattern
- a matcherdelimiter
- a pattern of delimiteraction
- an action to be invokedpublic OperationMatcher<A> delimit(PatternMatcher<A> pattern, PatternMatcher<A> delimiter)
pattern
- a matcherdelimiter
- a pattern of delimiterpublic LookaheadMatcher<A> attr(A attr)
attr
- an attribute to setpublic static <A> PatternMatcher<A> letrec(java.util.function.Function<PatternMatcher<A>,PatternMatcher<A>> func)
A
- type of attributefunc
- a function whose argument is a return value itself.public static <A> PatternMatcher<A> letrec(java.util.function.BiFunction<PatternMatcher<A>,PatternMatcher<A>,PatternMatcher<A>> func1, java.util.function.BiFunction<PatternMatcher<A>,PatternMatcher<A>,PatternMatcher<A>> func2)
A
- type of attributefunc1
- a function whose first argument is a return values itself.func2
- a function whose second argument is a return values itself.public static <A> PatternMatcher<A> letrec(Letrec3Function<A> func1, Letrec3Function<A> func2, Letrec3Function<A> func3)
A
- type of attributefunc1
- a function whose first argument is a return values itself.func2
- a function whose second argument is a return values itself.func3
- a function whose third argument is a return values itself.public static <A> PatternMatcher<A> letrec(Letrec4Function<A> func1, Letrec4Function<A> func2, Letrec4Function<A> func3, Letrec4Function<A> func4)
A
- type of attributefunc1
- a function whose first argument is a return values itself.func2
- a function whose second argument is a return values itself.func3
- a function whose third argument is a return values itself.func4
- a function whose fourth argument is a return values itself.public static <A> PatternMatcher<A> letrec(Letrec5Function<A> func1, Letrec5Function<A> func2, Letrec5Function<A> func3, Letrec5Function<A> func4, Letrec5Function<A> func5)
A
- type of attributefunc1
- a function whose first argument is a return values itself.func2
- a function whose second argument is a return values itself.func3
- a function whose third argument is a return values itself.func4
- a function whose fourth argument is a return values itself.func5
- a function whose fifth argument is a return values itself.