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/
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.javascript.jscomp.regex.RegExpTree
RegExpTree.Alternation, RegExpTree.Anchor, RegExpTree.BackReference, RegExpTree.CapturingGroup, RegExpTree.Charset, RegExpTree.Concatenation, RegExpTree.Empty, RegExpTree.LookaheadAssertion, RegExpTree.LookbehindAssertion, RegExpTree.NamedBackReference, RegExpTree.NamedCaptureGroup, RegExpTree.RegExpTreeAtom, RegExpTree.Repetition, RegExpTree.Text, RegExpTree.UnicodePropertyEscape, RegExpTree.WordBoundary
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidappendDebugInfo(java.lang.StringBuilder sb)protected voidappendSourceCode(java.lang.StringBuilder sb)Appends this regular expression source to the given buffer.com.google.common.collect.ImmutableList<? extends RegExpTree>children()The children of this node.booleancontainsAnchor()True if the regular expression contains an anchor :^or$.booleanequals(java.lang.Object o)inthashCode()booleanisCaseSensitive()True if the presence or absence of an"i"flag would change the meaning of this regular expression.intnumCapturingGroups()The number of capturing groups.RegExpTreesimplify(java.lang.String flags)Returns a simpler regular expression that is semantically the same assuming the given flags.-
Methods inherited from class com.google.javascript.jscomp.regex.RegExpTree
hasCapturingGroup, matchesWholeInput, parseRegExp, toString
-
-
-
-
Method Detail
-
simplify
public RegExpTree simplify(java.lang.String flags)
Description copied from class:RegExpTreeReturns a simpler regular expression that is semantically the same assuming the given flags.- Specified by:
simplifyin classRegExpTree- Parameters:
flags- Regular expression flags, e.g."igm".
-
isCaseSensitive
public boolean isCaseSensitive()
Description copied from class:RegExpTreeTrue if the presence or absence of an"i"flag would change the meaning of this regular expression.- Specified by:
isCaseSensitivein classRegExpTree
-
containsAnchor
public boolean containsAnchor()
Description copied from class:RegExpTreeTrue if the regular expression contains an anchor :^or$.- Specified by:
containsAnchorin classRegExpTree
-
numCapturingGroups
public int numCapturingGroups()
Description copied from class:RegExpTreeThe number of capturing groups.- Specified by:
numCapturingGroupsin classRegExpTree
-
children
public com.google.common.collect.ImmutableList<? extends RegExpTree> children()
Description copied from class:RegExpTreeThe children of this node.- Specified by:
childrenin classRegExpTree
-
appendSourceCode
protected void appendSourceCode(java.lang.StringBuilder sb)
Description copied from class:RegExpTreeAppends this regular expression source to the given buffer.- Specified by:
appendSourceCodein classRegExpTree
-
appendDebugInfo
protected void appendDebugInfo(java.lang.StringBuilder sb)
- Specified by:
appendDebugInfoin classRegExpTree
-
equals
public boolean equals(java.lang.Object o)
- Specified by:
equalsin classRegExpTree
-
hashCode
public int hashCode()
- Specified by:
hashCodein classRegExpTree
-
-