Class RegExpTree.Alternation

java.lang.Object
com.google.javascript.jscomp.regex.RegExpTree
com.google.javascript.jscomp.regex.RegExpTree.Alternation
Enclosing class:
RegExpTree

public static final class RegExpTree.Alternation extends RegExpTree
Represents the possibilities ["foo", "bar" ] for a RegExp /foo|bar/
  • Method Details

    • simplify

      public RegExpTree simplify(String flags)
      Description copied from class: RegExpTree
      Returns a simpler regular expression that is semantically the same assuming the given flags.
      Specified by:
      simplify in class RegExpTree
      Parameters:
      flags - Regular expression flags, e.g. "igm".
    • isCaseSensitive

      public boolean isCaseSensitive()
      Description copied from class: RegExpTree
      True if the presence or absence of an "i" flag would change the meaning of this regular expression.
      Specified by:
      isCaseSensitive in class RegExpTree
    • containsAnchor

      public boolean containsAnchor()
      Description copied from class: RegExpTree
      True if the regular expression contains an anchor : ^ or $.
      Specified by:
      containsAnchor in class RegExpTree
    • numCapturingGroups

      public int numCapturingGroups()
      Description copied from class: RegExpTree
      The number of capturing groups.
      Specified by:
      numCapturingGroups in class RegExpTree
    • children

      public com.google.common.collect.ImmutableList<? extends RegExpTree> children()
      Description copied from class: RegExpTree
      The children of this node.
      Specified by:
      children in class RegExpTree
    • appendSourceCode

      protected void appendSourceCode(StringBuilder sb)
      Description copied from class: RegExpTree
      Appends this regular expression source to the given buffer.
      Specified by:
      appendSourceCode in class RegExpTree
    • appendDebugInfo

      protected void appendDebugInfo(StringBuilder sb)
      Specified by:
      appendDebugInfo in class RegExpTree
    • equals

      public boolean equals(Object o)
      Specified by:
      equals in class RegExpTree
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in class RegExpTree