Class CharacterClass
java.lang.Object
com.oracle.truffle.regex.tregex.parser.ast.RegexASTNode
com.oracle.truffle.regex.tregex.parser.ast.Term
com.oracle.truffle.regex.tregex.parser.ast.QuantifiableTerm
com.oracle.truffle.regex.tregex.parser.ast.CharacterClass
- All Implemented Interfaces:
AbstractState<Term,,ASTTransition> JsonConvertible
A
Term that matches characters belonging to a specified set of characters.
Corresponds to the right-hand sides PatternCharacter, . and CharacterClass of the goal symbol Atom and the right-hand sides CharacterClassEscape and CharacterEscape of the goal symbol AtomEscape in the ECMAScript RegExp syntax.
Note that CharacterClass nodes and the CodePointSets that they rely on can only
match characters from the Basic Multilingual Plane (and whose code point fits into 16-bit
integers). Any term which matches characters outside of the Basic Multilingual Plane is expanded
by JSRegexParser into a more complex expression which matches the individual code units
that would make up the UTF-16 encoding of those characters.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddLookBehindEntry(RegexAST ast, LookBehindAssertion lookBehindEntry) Copy this node only, without any child nodes.copyRecursive(RegexAST ast, CompilationBuffer compilationBuffer) Recursively copy this subtree.booleanequalsSemantic(RegexASTNode obj, boolean ignoreQuantifier) voidextractSingleChar(AbstractStringBuffer literal, AbstractStringBuffer mask) Returns theCodePointSetrepresenting the set of characters that can be matched by thisCharacterClass.Returns the (fixed-length) look-behind assertions whose first characters can match the same character as this node.Gets the syntactic parent of this AST node.booleanbooleanReturnstrueiff the parser should try to unroll this term's quantifier.voidsetCharSet(CodePointSet charSet) voidvoidsetWasSingleChar(boolean value) toJson()toString()booleanMethods inherited from class com.oracle.truffle.regex.tregex.parser.ast.QuantifiableTerm
equalsSemantic, getQuantifier, getSubTreeParent, hasNotUnrolledQuantifier, hasQuantifier, quantifierToString, setQuantifierMethods inherited from class com.oracle.truffle.regex.tregex.parser.ast.Term
getSeqIndex, setSeqIndexMethods inherited from class com.oracle.truffle.regex.tregex.parser.ast.RegexASTNode
asAtomicGroup, asBackReference, asCharacterClass, asConditionalBackReferenceGroup, asGroup, asLookAheadAssertion, asLookAroundAssertion, asLookBehindAssertion, asMatchFound, asPositionAssertion, asQuantifiableTerm, asSequence, asSubexpressionCall, asSubtreeRootNode, astNodeId, endsWithDollar, getFlags, getId, getMaxPath, getMinPath, getPrefixLengthMax, getPrefixLengthMin, hasBackReferences, hasCaptureGroups, hasCaret, hasDollar, hasEmptyGuard, hasLookAheads, hasLookBehinds, hasLoops, hasQuantifiers, hasVariablePrefixLength, idInitialized, incMaxPath, incMaxPath, incMinPath, incMinPath, isAtomicGroup, isBackReference, isCaret, isCharacterClass, isConditionalBackReferenceGroup, isDead, isDollar, isExpandedQuantifier, isFlagSet, isGroup, isGroupWithGuards, isInLookAheadAssertion, isInLookBehindAssertion, isLookAheadAssertion, isLookAroundAssertion, isLookBehindAssertion, isMandatoryUnrolledQuantifier, isMatchFound, isPositionAssertion, isPrefix, isQuantifiableTerm, isQuantifierPassThroughSequence, isRoot, isSequence, isSubexpressionCall, isSubtreeRoot, markAsDead, setDead, setEmptyGuard, setEndsWithDollar, setEndsWithDollar, setExpandedQuantifier, setFlag, setFlag, setFlags, setHasBackReferences, setHasCaptureGroups, setHasCaret, setHasCaret, setHasDollar, setHasDollar, setHasLookAheads, setHasLookBehinds, setHasLoops, setHasLoops, setHasQuantifiers, setId, setMandatoryUnrolledQuantifier, setMaxPath, setMinPath, setParent, setPrefix, setPrefixLengthMax, setPrefixLengthMin, setQuantifierPassThroughSequence, setStartsWithCaret, setStartsWithCaret, startsWithCaret, toJson, toStringWithIDMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.oracle.truffle.regex.tregex.automaton.AbstractState
getId
-
Method Details
-
copy
Description copied from class:RegexASTNodeCopy this node only, without any child nodes. The ID and minPath of the copied nodes is left unset.- Specified by:
copyin classQuantifiableTerm- Parameters:
ast- RegexAST the node should belong to.- Returns:
- A shallow copy of this node.
-
copyRecursive
Description copied from class:RegexASTNodeRecursively copy this subtree. This method should be used instead ofCopyVisitorif the copying process is required to be thread-safe. The ID and minPath of the copied nodes is left unset.- Specified by:
copyRecursivein classTerm- Parameters:
ast- RegexAST the new nodes should belong to.- Returns:
- A deep copy of this node.
-
getParent
Description copied from class:RegexASTNodeGets the syntactic parent of this AST node.- Overrides:
getParentin classRegexASTNode
-
getCharSet
Returns theCodePointSetrepresenting the set of characters that can be matched by thisCharacterClass. -
setCharSet
-
wasSingleChar
public boolean wasSingleChar() -
setWasSingleChar
public void setWasSingleChar() -
setWasSingleChar
public void setWasSingleChar(boolean value) -
isUnrollingCandidate
public boolean isUnrollingCandidate()Description copied from class:QuantifiableTermReturnstrueiff the parser should try to unroll this term's quantifier.- Specified by:
isUnrollingCandidatein classQuantifiableTerm
-
addLookBehindEntry
-
hasLookBehindEntries
public boolean hasLookBehindEntries() -
getLookBehindEntries
Returns the (fixed-length) look-behind assertions whose first characters can match the same character as this node. Note that the set contains theGroupbodies of theLookBehindAssertionnodes, not theLookBehindAssertionnodes themselves. -
extractSingleChar
-
equalsSemantic
- Specified by:
equalsSemanticin classQuantifiableTerm
-
toString
-
toJson
-