Class RegexTreeHelper


  • public class RegexTreeHelper
    extends Object
    • Method Detail

      • intersects

        public static boolean intersects​(SubAutomaton auto1,
                                         SubAutomaton auto2,
                                         boolean defaultAnswer)
        If both sub-automata have allowPrefix set to true, this method will check whether auto1 intersects the prefix of auto2 or auto2 intersects the prefix of auto1. This is different than checking whether the prefix of auto1 intersects the prefix of auto2 (which would always be true because both prefix always contain the empty string). defaultAnswer will be returned in case of unsupported features or the state limit is exceeded. It should be whichever answer does not lead to an issue being reported to avoid false positives.
      • supersetOf

        public static boolean supersetOf​(SubAutomaton auto1,
                                         SubAutomaton auto2,
                                         boolean defaultAnswer)
        Here auto2.allowPrefix means that if supersetOf(auto1, auto2), then for every string matched by auto2, auto1 can match a prefix of it auto1.allowPrefix means that if supersetOf(auto1, auto2), then for every string matched by auto2, auto1 can match a continuation of it If both are set, it means either one can be the case.
      • isAnchoredAtEnd

        public static boolean isAnchoredAtEnd​(AutomatonState start)
      • isEndBoundary

        public static boolean isEndBoundary​(AutomatonState state)
      • onlyMatchesEmptySuffix

        public static boolean onlyMatchesEmptySuffix​(AutomatonState start)