Class PreCalculatedResultFactory

java.lang.Object
com.oracle.truffle.regex.result.PreCalculatedResultFactory
All Implemented Interfaces:
JsonConvertible

public final class PreCalculatedResultFactory extends Object implements JsonConvertible
Predefined lists of capture group start and end indices. Used for regular expressions like /(\w)(\d)/
  • Constructor Details

    • PreCalculatedResultFactory

      public PreCalculatedResultFactory(int nGroups, boolean trackLastGroup)
  • Method Details

    • copy

    • getStart

      public int getStart(int groupNr)
    • setStart

      public void setStart(int groupNr, int value)
    • getEnd

      public int getEnd(int groupNr)
    • setEnd

      public void setEnd(int groupNr, int value)
    • getLength

      public int getLength()
      Outermost bounds of the result, necessary for expressions where lookaround matches may exceed the bounds of capture group 0.
    • setLength

      public void setLength(int length)
    • setLastGroup

      public void setLastGroup(int lastGroup)
    • updateIndices

      public void updateIndices(TBitSet updateIndices, int index)
    • clearIndices

      public void clearIndices(TBitSet clearIndices)
    • createFromStart

      public RegexResult createFromStart(int start)
    • createFromEnd

      public RegexResult createFromEnd(int end)
    • createArrayFromEnd

      public int[] createArrayFromEnd(int end)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toJson

      public JsonValue toJson()
      Specified by:
      toJson in interface JsonConvertible