Class RegexResult
java.lang.Object
com.oracle.truffle.regex.AbstractRegexObject
com.oracle.truffle.regex.AbstractConstantKeysObject
com.oracle.truffle.regex.result.RegexResult
- All Implemented Interfaces:
com.oracle.truffle.api.interop.TruffleObject
RegexResult is a TruffleObject that represents the result of matching a regular
expression against a string. It can be obtained as the result of a RegexObject's
exec method and has the following properties:
boolean isMatch:trueif a match was found,falseotherwise.TruffleObjectgetStart(int groupNumber): returns the position where the beginning of the capture group with the given number was found. If the result is no match, the returned value is undefined. Capture group number0denotes the boundaries of the entire expression. If no match was found for a particular capture group, the returned value is-1.TruffleObjectend: returns the position where the end of the capture group with the given number was found. If the result is no match, the returned value is undefined. Capture group number0denotes the boundaries of the entire expression. If no match was found for a particular capture group, the returned value is-1.int lastGroup: The index of the last capture group that was matched. -1 if no capture group was matched. This property is only tracked for Python regular expressions. For other flavors of regular expressions, this always has the value -1.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedRegexResult(com.oracle.truffle.api.strings.TruffleString input, int fromIndex, int regionFrom, int regionTo, int start, int end, int[] result, com.oracle.truffle.api.CallTarget lazyCallTarget) -
Method Summary
Modifier and TypeMethodDescriptionstatic RegexResultcreate(int[] result) static RegexResultcreate(int start, int end) static RegexResultcreateFromExecutorResult(Object executorResult) static RegexResultcreateLazy(com.oracle.truffle.api.strings.TruffleString input, int fromIndex, int regionFrom, int regionTo, int start, int end, com.oracle.truffle.api.CallTarget lazyCallTarget) voidstatic RegexResultintgetEnd()intgetEnd(int groupNumber) intcom.oracle.truffle.api.strings.TruffleStringgetInput()getKeys()intgetMembers(boolean includeInternal) static RegexResultintintintgetStart()intgetStart(int groupNumber) booleanisMemberReadableImpl(String symbol) readMemberImpl(String symbol) voidsetResult(int[] result) toDisplayString(boolean allowSideEffects) toString()Methods inherited from class com.oracle.truffle.regex.AbstractConstantKeysObject
hasMembersMethods inherited from class com.oracle.truffle.regex.AbstractRegexObject
createNamedCaptureGroupMapInt, createNamedCaptureGroupMapListInt, getLanguage, hasLanguage
-
Constructor Details
-
RegexResult
protected RegexResult(com.oracle.truffle.api.strings.TruffleString input, int fromIndex, int regionFrom, int regionTo, int start, int end, int[] result, com.oracle.truffle.api.CallTarget lazyCallTarget)
-
-
Method Details
-
getNoMatchInstance
-
getBooleanMatchInstance
-
create
-
create
-
createFromExecutorResult
-
createLazy
public static RegexResult createLazy(com.oracle.truffle.api.strings.TruffleString input, int fromIndex, int regionFrom, int regionTo, int start, int end, com.oracle.truffle.api.CallTarget lazyCallTarget) -
getInput
public com.oracle.truffle.api.strings.TruffleString getInput() -
getFromIndex
public int getFromIndex() -
getRegionFrom
public int getRegionFrom() -
getRegionTo
public int getRegionTo() -
getStart
public int getStart() -
getEnd
public int getEnd() -
setResult
public void setResult(int[] result) -
getStart
public int getStart(int groupNumber) -
getEnd
public int getEnd(int groupNumber) -
getLastGroup
public int getLastGroup() -
getMembers
- Overrides:
getMembersin classAbstractConstantKeysObject
-
getKeys
- Specified by:
getKeysin classAbstractConstantKeysObject
-
isMemberReadableImpl
- Specified by:
isMemberReadableImplin classAbstractConstantKeysObject
-
readMemberImpl
- Specified by:
readMemberImplin classAbstractConstantKeysObject
-
debugForceEvaluation
public void debugForceEvaluation() -
toString
-
toDisplayString
- Overrides:
toDisplayStringin classAbstractRegexObject
-