Class RegExpImpl
- java.lang.Object
-
- org.htmlunit.corejs.javascript.regexp.RegExpImpl
-
- All Implemented Interfaces:
RegExpProxy
public class RegExpImpl extends java.lang.Object implements RegExpProxy
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
input
protected SubString
lastMatch
protected SubString
lastParen
protected SubString
leftContext
protected boolean
multiline
protected SubString[]
parens
protected SubString
rightContext
-
Fields inherited from interface org.htmlunit.corejs.javascript.RegExpProxy
RA_MATCH, RA_REPLACE, RA_REPLACE_ALL, RA_SEARCH
-
-
Constructor Summary
Constructors Constructor Description RegExpImpl()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
action(Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args, int actionType)
java.lang.Object
compileRegExp(Context cx, java.lang.String source, java.lang.String flags)
private static NativeRegExp
createRegExp(Context cx, Scriptable scope, java.lang.Object[] args, int optarg, boolean forceFlat)
private static void
do_replace(GlobData rdata, Context cx, RegExpImpl regExpImpl)
Analog of do_replace in jsstr.cprivate static int
find_split(Context cx, Scriptable scope, java.lang.String target, java.lang.String separator, int version, RegExpProxy reProxy, Scriptable re, int[] ip, int[] matchlen, boolean[] matched, java.lang.String[][] parensp)
int
find_split(Context cx, Scriptable scope, java.lang.String target, java.lang.String separator, Scriptable reObj, int[] ip, int[] matchlen, boolean[] matched, java.lang.String[][] parensp)
(package private) SubString
getParenSubString(int i)
Analog of REGEXP_PAREN_SUBSTRING in C jsregexp.h.private static SubString
interpretDollar(Context cx, RegExpImpl res, java.lang.String da, int dp, int[] skip)
boolean
isRegExp(Scriptable obj)
java.lang.Object
js_split(Context cx, Scriptable scope, java.lang.String target, java.lang.Object[] args)
private static void
match_glob(GlobData mdata, Context cx, Scriptable scope, int count, RegExpImpl reImpl)
private static java.lang.Object
matchOrReplace(Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args, RegExpImpl reImpl, GlobData data, NativeRegExp re)
Analog of C match_or_replace.private static void
replace_glob(GlobData rdata, Context cx, Scriptable scope, RegExpImpl reImpl, int leftIndex, int leftlen)
Scriptable
wrapRegExp(Context cx, Scriptable scope, java.lang.Object compiled)
-
-
-
Method Detail
-
isRegExp
public boolean isRegExp(Scriptable obj)
- Specified by:
isRegExp
in interfaceRegExpProxy
-
compileRegExp
public java.lang.Object compileRegExp(Context cx, java.lang.String source, java.lang.String flags)
- Specified by:
compileRegExp
in interfaceRegExpProxy
-
wrapRegExp
public Scriptable wrapRegExp(Context cx, Scriptable scope, java.lang.Object compiled)
- Specified by:
wrapRegExp
in interfaceRegExpProxy
-
action
public java.lang.Object action(Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args, int actionType)
- Specified by:
action
in interfaceRegExpProxy
-
createRegExp
private static NativeRegExp createRegExp(Context cx, Scriptable scope, java.lang.Object[] args, int optarg, boolean forceFlat)
-
matchOrReplace
private static java.lang.Object matchOrReplace(Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args, RegExpImpl reImpl, GlobData data, NativeRegExp re)
Analog of C match_or_replace.
-
find_split
public int find_split(Context cx, Scriptable scope, java.lang.String target, java.lang.String separator, Scriptable reObj, int[] ip, int[] matchlen, boolean[] matched, java.lang.String[][] parensp)
- Specified by:
find_split
in interfaceRegExpProxy
-
getParenSubString
SubString getParenSubString(int i)
Analog of REGEXP_PAREN_SUBSTRING in C jsregexp.h. Assumes zero-based; i.e., for $3, i==2
-
match_glob
private static void match_glob(GlobData mdata, Context cx, Scriptable scope, int count, RegExpImpl reImpl)
-
replace_glob
private static void replace_glob(GlobData rdata, Context cx, Scriptable scope, RegExpImpl reImpl, int leftIndex, int leftlen)
-
interpretDollar
private static SubString interpretDollar(Context cx, RegExpImpl res, java.lang.String da, int dp, int[] skip)
-
do_replace
private static void do_replace(GlobData rdata, Context cx, RegExpImpl regExpImpl)
Analog of do_replace in jsstr.c
-
js_split
public java.lang.Object js_split(Context cx, Scriptable scope, java.lang.String target, java.lang.Object[] args)
- Specified by:
js_split
in interfaceRegExpProxy
-
find_split
private static int find_split(Context cx, Scriptable scope, java.lang.String target, java.lang.String separator, int version, RegExpProxy reProxy, Scriptable re, int[] ip, int[] matchlen, boolean[] matched, java.lang.String[][] parensp)
-
-