Class RegexFlavor

java.lang.Object
com.oracle.truffle.regex.tregex.parser.flavors.RegexFlavor
Direct Known Subclasses:
ECMAScriptFlavor, JavaFlavor, OracleDBFlavor, PythonFlavor, RubyFlavor

public abstract class RegexFlavor extends Object
An implementation of a dialect (flavor) of regular expressions other than ECMAScript. It provides support for validating and parsing (building the AST) of regular expressions.
  • Field Details

    • BACKREFERENCES_TO_UNMATCHED_GROUPS_FAIL

      protected static final int BACKREFERENCES_TO_UNMATCHED_GROUPS_FAIL
      See Also:
    • EMPTY_CHECKS_MONITOR_CAPTURE_GROUPS

      protected static final int EMPTY_CHECKS_MONITOR_CAPTURE_GROUPS
      See Also:
    • NESTED_CAPTURE_GROUPS_KEPT_ON_LOOP_REENTRY

      protected static final int NESTED_CAPTURE_GROUPS_KEPT_ON_LOOP_REENTRY
      See Also:
    • FAILING_EMPTY_CHECKS_DONT_BACKTRACK

      protected static final int FAILING_EMPTY_CHECKS_DONT_BACKTRACK
      See Also:
    • USES_LAST_GROUP_RESULT_FIELD

      protected static final int USES_LAST_GROUP_RESULT_FIELD
      See Also:
    • LOOKBEHINDS_RUN_LEFT_TO_RIGHT

      protected static final int LOOKBEHINDS_RUN_LEFT_TO_RIGHT
      See Also:
    • NEEDS_GROUP_START_POSITIONS

      protected static final int NEEDS_GROUP_START_POSITIONS
      See Also:
    • HAS_CONDITIONAL_BACKREFERENCES

      protected static final int HAS_CONDITIONAL_BACKREFERENCES
      See Also:
    • SUPPORTS_RECURSIVE_BACKREFERENCES

      protected static final int SUPPORTS_RECURSIVE_BACKREFERENCES
      See Also:
    • EMPTY_CHECKS_ON_MANDATORY_LOOP_ITERATIONS

      protected static final int EMPTY_CHECKS_ON_MANDATORY_LOOP_ITERATIONS
      See Also:
    • BACKREFERENCE_IGNORE_CASE_MULTI_CHAR_EXPANSION

      protected static final int BACKREFERENCE_IGNORE_CASE_MULTI_CHAR_EXPANSION
      See Also:
  • Constructor Details

    • RegexFlavor

      protected RegexFlavor(int traits)
  • Method Details

    • createParser

      public abstract RegexParser createParser(RegexLanguage language, RegexSource source, CompilationBuffer compilationBuffer)
    • createValidator

      public abstract RegexValidator createValidator(RegexLanguage language, RegexSource source, CompilationBuffer compilationBuffer)
    • getEqualsIgnoreCasePredicate

      public abstract RegexFlavor.EqualsIgnoreCasePredicate getEqualsIgnoreCasePredicate(RegexAST ast)
    • getCaseFoldAlgorithm

      public abstract CaseFoldData.CaseFoldAlgorithm getCaseFoldAlgorithm(RegexAST ast)
    • backreferencesToUnmatchedGroupsFail

      public boolean backreferencesToUnmatchedGroupsFail()
    • supportsRecursiveBackreferences

      public boolean supportsRecursiveBackreferences()
    • emptyChecksMonitorCaptureGroups

      public boolean emptyChecksMonitorCaptureGroups()
    • nestedCaptureGroupsKeptOnLoopReentry

      public boolean nestedCaptureGroupsKeptOnLoopReentry()
    • failingEmptyChecksDontBacktrack

      public boolean failingEmptyChecksDontBacktrack()
    • canHaveEmptyLoopIterations

      public boolean canHaveEmptyLoopIterations()
    • usesLastGroupResultField

      public boolean usesLastGroupResultField()
    • lookBehindsRunLeftToRight

      public boolean lookBehindsRunLeftToRight()
    • needsGroupStartPositions

      public boolean needsGroupStartPositions()
    • hasConditionalBackReferences

      public boolean hasConditionalBackReferences()
    • matchesTransitionsStepByStep

      public boolean matchesTransitionsStepByStep()
    • emptyChecksOnMandatoryLoopIterations

      public boolean emptyChecksOnMandatoryLoopIterations()
      Regex flavors with this feature perform on empty-check on all iterations of a loop, including on mandatory iterations. As such, a loop can terminate before having been executed the required number of times.
    • backreferenceIgnoreCaseMultiCharExpansion

      public boolean backreferenceIgnoreCaseMultiCharExpansion()
      Regex flavors with this feature perform full multi-character expansion on back-references in ignore-case mode, allowing backreferences to match more or less characters than the referenced group. For example, regex (ff)\\1 matches "FFff" in ignore-case mode.