Class QuantifiableTerm

All Implemented Interfaces:
AbstractState<Term,ASTTransition>, JsonConvertible
Direct Known Subclasses:
BackReference, CharacterClass, Group, SubexpressionCall

public abstract class QuantifiableTerm extends Term
Roughly corresponds to the goal symbol Atom in the ECMAScript RegExp syntax. An Atom (QuantifiableTerm) can be either a CharacterClass, a BackReference or a Group). Quantifiers (Token.Quantifier) are attached directly to the quantified term.
  • Method Details

    • copy

      public abstract QuantifiableTerm copy(RegexAST ast)
      Description copied from class: RegexASTNode
      Copy this node only, without any child nodes. The ID and minPath of the copied nodes is left unset.
      Specified by:
      copy in class Term
      Parameters:
      ast - RegexAST the node should belong to.
      Returns:
      A shallow copy of this node.
    • hasQuantifier

      public boolean hasQuantifier()
    • hasNotUnrolledQuantifier

      public boolean hasNotUnrolledQuantifier()
      Returns true iff this term has a quantifier that was not unrolled by the parser.
    • isUnrollingCandidate

      public abstract boolean isUnrollingCandidate()
      Returns true iff the parser should try to unroll this term's quantifier.
    • getQuantifier

      public Token.Quantifier getQuantifier()
    • setQuantifier

      public void setQuantifier(Token.Quantifier quantifier)
    • equalsSemantic

      public boolean equalsSemantic(RegexASTNode obj)
      Specified by:
      equalsSemantic in class RegexASTNode
    • equalsSemantic

      public abstract boolean equalsSemantic(RegexASTNode obj, boolean ignoreQuantifier)
    • quantifierToString

      protected String quantifierToString()
    • getSubTreeParent

      public RegexASTSubtreeRootNode getSubTreeParent()
      Description copied from class: RegexASTNode
      Returns the subtree root node that this node is a part of. If this node is nested inside several look-around assertion nodes, returns the innermost one that contains this node. Every AST node should have a subtree parent, but nodes implicitly generated by RegexAST.getNFAAnchoredInitialState(int) and RegexAST.getNFAUnAnchoredInitialState(int) technically don't belong to the AST, so they will return null.
      Overrides:
      getSubTreeParent in class Term