public abstract class TRegulars extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
TRegulars.MatchResult
The result of a successful match of a tagged
regular expression against some input string
|
| Modifier and Type | Method and Description |
|---|---|
static Iterable<TRegulars.MatchResult> |
allMatches(List<CSet> charSets,
TRegular regular,
String input) |
static Set<TRegular.TagInfo> |
emptyMatched(TRegular regular) |
static boolean |
equal(TRegular r1,
TRegular r2)
This is not an equivalence test between tagged
regular expressions, in the sense that it can return
false on two different regular expressions
which would otherwise recognize the same language. |
static @Nullable Map<TRegular.TagInfo,Integer> |
matches(List<CSet> charSets,
TRegular regular,
String input) |
static Iterable<String> |
witnesses(List<CSet> charSets,
TRegular regular) |
public static boolean equal(TRegular r1, TRegular r2)
false on two different regular expressions
which would otherwise recognize the same language.
Beware that this structural test does not make
sense if r1 and r2 have been encoded
in different encoders, because they
would not use the same character maps.
r1 - r2 - true if and only if the two given
tagged regular expressions are structurally equalpublic static Iterable<TRegulars.MatchResult> allMatches(List<CSet> charSets, TRegular regular, String input)
charSets - the character set dictionaryregular - input - regular and a prefix of inputpublic static @Nullable Map<TRegular.TagInfo,Integer> matches(List<CSet> charSets, TRegular regular, String input)
charSets - the character set dictionaryregular - input - null if regular does not match the full
input string, or the map of matched tags if a match
was foundpublic static Iterable<String> witnesses(List<CSet> charSets, TRegular regular)
charSets - the character set dictionaryregular - public static Set<TRegular.TagInfo> emptyMatched(TRegular regular)
regular - must be nullableregular