- java.lang.Object
-
- org.jcodings.IntHolder
-
- org.joni.Matcher
-
- org.joni.StackMachine
-
- All Implemented Interfaces:
StackType
- Direct Known Subclasses:
ByteCodeMachine
abstract class StackMachine extends Matcher implements StackType
-
-
Field Summary
Fields Modifier and Type Field Description protected static intINVALID_INDEXprotected intmemEndStkprotected intmemStartStkprotected int[]repeatStkprotected StackEntry[]stack(package private) static java.lang.ThreadLocal<java.lang.ref.WeakReference<StackEntry[]>>stacksprivate static intSTATE_CHECK_BUFF_MALLOC_THRESHOLD_SIZEprotected byte[]stateCheckBuffprotected intstateCheckBuffSizeprotected intstk-
Fields inherited from class org.joni.Matcher
bytes, enc, end, FAILED, high, INTERRUPTED, low, msaBegin, msaBestLen, msaBestS, msaEnd, msaGpos, msaOptions, msaRegion, msaStart, regex, str
-
Fields inherited from interface org.joni.constants.internal.StackType
ABSENT, ABSENT_POS, ALT, CALL_FRAME, INVALID_STACK_INDEX, LOOK_BEHIND_NOT, MASK_MEM_END_OR_MARK, MASK_POP_USED, MASK_TO_VOID_TARGET, MEM_END, MEM_END_MARK, MEM_START, NULL_CHECK_END, NULL_CHECK_START, POS, POS_NOT, REPEAT, REPEAT_INC, RETURN, STATE_CHECK_MARK, STOP_BT, VOID
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedStackMachine(Regex regex, Region region, byte[] bytes, int p, int end)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static StackEntry[]allocateStack()private voiddoubleStack()private StackEntryensure1()private static StackEntry[]fetchStack()protected intgetMemStart(int mnum)protected intgetRepeat(int id)protected intnullCheck(int id, int s)protected intnullCheckMemSt(int id, int s)protected intnullCheckMemStRec(int id, int s)protected intnullCheckRec(int id, int s)protected StackEntrypop()private StackEntrypopDefault()private StackEntrypopFree()private StackEntrypopMemStart()protected voidpopOne()private voidpopRewrite(StackEntry e)protected voidpopTilAbsent()protected voidpopTilLookBehindNot()protected voidpopTilPosNot()protected intposEnd()private voidpush(int type, int pat, int s, int prev, int pkeep)protected voidpushAbsent()protected voidpushAbsentPos(int start, int end)protected voidpushAlt(int pat, int s, int prev, int pkeep)protected voidpushAltWithStateCheck(int pat, int s, int sprev, int snum, int pkeep)protected voidpushCallFrame(int pat)private voidpushEnsured(int type, int pat)protected voidpushLookBehindNot(int pat, int s, int sprev, int pkeep)protected voidpushMemEnd(int mnum, int s)protected voidpushMemEndMark(int mnum)protected voidpushMemStart(int mnum, int s)protected voidpushNullCheckEnd(int cnum)protected voidpushNullCheckStart(int cnum, int s)protected voidpushPos(int s, int prev, int pkeep)protected voidpushPosNot(int pat, int s, int prev, int pkeep)protected voidpushRepeat(int id, int pat)protected voidpushRepeatInc(int sindex)protected voidpushReturn()protected voidpushStateCheck(int s, int snum)protected voidpushStopBT()private voidpushType(int type)protected intsreturn()protected voidstackInit()protected voidstateCheckBuffClear()protected voidstateCheckBuffInit(int strLength, int offset, int stateNum)private voidstateCheckMark()private intstateCheckPos(int s, int snum)protected booleanstateCheckVal(int s, int snum)protected voidstopBtEnd()-
Methods inherited from class org.joni.Matcher
debugSearch, getBegin, getEagerRegion, getEnd, getRegion, icbuf, interrupt, isMbcAsciiWord, match, matchAt, matchInterruptible, msaInit, search, search, searchInterruptible, searchInterruptible
-
-
-
-
Field Detail
-
INVALID_INDEX
protected static final int INVALID_INDEX
- See Also:
- Constant Field Values
-
stack
protected StackEntry[] stack
-
stk
protected int stk
-
repeatStk
protected final int[] repeatStk
-
memStartStk
protected final int memStartStk
-
memEndStk
protected final int memEndStk
-
stateCheckBuff
protected byte[] stateCheckBuff
-
stateCheckBuffSize
protected int stateCheckBuffSize
-
stacks
static final java.lang.ThreadLocal<java.lang.ref.WeakReference<StackEntry[]>> stacks
-
STATE_CHECK_BUFF_MALLOC_THRESHOLD_SIZE
private static final int STATE_CHECK_BUFF_MALLOC_THRESHOLD_SIZE
- See Also:
- Constant Field Values
-
-
Method Detail
-
stackInit
protected final void stackInit()
-
allocateStack
private static StackEntry[] allocateStack()
-
doubleStack
private void doubleStack()
-
fetchStack
private static StackEntry[] fetchStack()
-
ensure1
private final StackEntry ensure1()
-
pushType
private final void pushType(int type)
-
stateCheckPos
private int stateCheckPos(int s, int snum)
-
stateCheckVal
protected final boolean stateCheckVal(int s, int snum)
-
stateCheckMark
private void stateCheckMark()
-
stateCheckBuffInit
protected final void stateCheckBuffInit(int strLength, int offset, int stateNum)- Specified by:
stateCheckBuffInitin classMatcher
-
stateCheckBuffClear
protected final void stateCheckBuffClear()
- Specified by:
stateCheckBuffClearin classMatcher
-
push
private void push(int type, int pat, int s, int prev, int pkeep)
-
pushEnsured
private final void pushEnsured(int type, int pat)
-
pushAltWithStateCheck
protected final void pushAltWithStateCheck(int pat, int s, int sprev, int snum, int pkeep)
-
pushStateCheck
protected final void pushStateCheck(int s, int snum)
-
pushAlt
protected final void pushAlt(int pat, int s, int prev, int pkeep)
-
pushPos
protected final void pushPos(int s, int prev, int pkeep)
-
pushPosNot
protected final void pushPosNot(int pat, int s, int prev, int pkeep)
-
pushStopBT
protected final void pushStopBT()
-
pushLookBehindNot
protected final void pushLookBehindNot(int pat, int s, int sprev, int pkeep)
-
pushRepeat
protected final void pushRepeat(int id, int pat)
-
pushRepeatInc
protected final void pushRepeatInc(int sindex)
-
pushMemStart
protected final void pushMemStart(int mnum, int s)
-
pushMemEnd
protected final void pushMemEnd(int mnum, int s)
-
pushMemEndMark
protected final void pushMemEndMark(int mnum)
-
getMemStart
protected final int getMemStart(int mnum)
-
pushNullCheckStart
protected final void pushNullCheckStart(int cnum, int s)
-
pushNullCheckEnd
protected final void pushNullCheckEnd(int cnum)
-
pushCallFrame
protected final void pushCallFrame(int pat)
-
pushReturn
protected final void pushReturn()
-
pushAbsent
protected final void pushAbsent()
-
pushAbsentPos
protected final void pushAbsentPos(int start, int end)
-
popOne
protected final void popOne()
-
pop
protected final StackEntry pop()
-
popFree
private StackEntry popFree()
-
popMemStart
private StackEntry popMemStart()
-
popRewrite
private void popRewrite(StackEntry e)
-
popDefault
private StackEntry popDefault()
-
popTilPosNot
protected final void popTilPosNot()
-
popTilLookBehindNot
protected final void popTilLookBehindNot()
-
popTilAbsent
protected final void popTilAbsent()
-
posEnd
protected final int posEnd()
-
stopBtEnd
protected final void stopBtEnd()
-
nullCheck
protected final int nullCheck(int id, int s)
-
nullCheckRec
protected final int nullCheckRec(int id, int s)
-
nullCheckMemSt
protected final int nullCheckMemSt(int id, int s)
-
nullCheckMemStRec
protected final int nullCheckMemStRec(int id, int s)
-
getRepeat
protected final int getRepeat(int id)
-
sreturn
protected final int sreturn()
-
-