|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.javascript.jscomp.regex.RegExpTree
public abstract class RegExpTree
An AST for JavaScript regular expressions.
Constructor Summary | |
---|---|
RegExpTree()
|
Method Summary | |
---|---|
protected abstract void |
appendDebugInfo(StringBuilder sb)
|
protected abstract void |
appendSourceCode(StringBuilder sb)
Appends this regular expression source to the given buffer. |
abstract List<? extends RegExpTree> |
children()
The children of this node. |
abstract boolean |
containsAnchor()
True if the regular expression contains an anchor : ^ or $ . |
abstract boolean |
equals(Object o)
|
boolean |
hasCapturingGroup()
True if the regular expression contains capturing groups. |
abstract int |
hashCode()
|
abstract boolean |
isCaseSensitive()
True if the presence or absence of an "i" flag would change the
meaning of this regular expression. |
static boolean |
matchesWholeInput(RegExpTree t,
String flags)
True if, but not necessarily always when the, given regular expression must match the whole input or none of it. |
abstract int |
numCapturingGroups()
The number of capturing groups. |
static RegExpTree |
parseRegExp(String pattern,
String flags)
Parses a regular expression to an AST. |
abstract RegExpTree |
simplify(String flags)
Returns a simpler regular expression that is semantically the same assuming the given flags. |
String |
toDebugString()
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RegExpTree()
Method Detail |
---|
public abstract RegExpTree simplify(String flags)
flags
- Regular expression flags, e.g. "igm"
.public abstract boolean isCaseSensitive()
"i"
flag would change the
meaning of this regular expression.
public abstract boolean containsAnchor()
^
or $
.
public final boolean hasCapturingGroup()
public abstract int numCapturingGroups()
public abstract List<? extends RegExpTree> children()
protected abstract void appendSourceCode(StringBuilder sb)
protected abstract void appendDebugInfo(StringBuilder sb)
public final String toString()
toString
in class Object
public final String toDebugString()
public abstract boolean equals(Object o)
equals
in class Object
public abstract int hashCode()
hashCode
in class Object
public static RegExpTree parseRegExp(String pattern, String flags)
pattern
- The foo
From /foo/i
.flags
- The i
From /foo/i
.public static boolean matchesWholeInput(RegExpTree t, String flags)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |