Package org.joni
Class Analyser
- java.lang.Object
-
- org.jcodings.IntHolder
-
- org.joni.ScannerSupport
-
- org.joni.Lexer
-
- org.joni.Parser
-
- org.joni.Analyser
-
- All Implemented Interfaces:
org.jcodings.exception.ErrorMessages,ErrorMessages
final class Analyser extends Parser
-
-
Field Summary
Fields Modifier and Type Field Description private static intCEC_CONT_BIG_REPEATprivate static intCEC_IN_FINITE_REPEATprivate static intCEC_IN_INFINITE_REPEATprivate static intCEC_INFINITE_NUMprivate static intCEC_THRES_NUM_BIG_REPEATprivate static intEXPAND_STRING_MAX_LENGTHprivate static intFOUND_CALLED_NODEprivate static intGET_CHAR_LEN_TOP_ALT_VARLENprivate static intGET_CHAR_LEN_VARLENprivate static intIN_ALTprivate static intIN_NOTprivate static intIN_REPEATprivate static intIN_VAR_REPEATprivate static intMAX_NODE_OPT_INFO_REF_COUNTprivate static intRECURSION_EXISTprivate static intRECURSION_INFINITEprivate static intTHRESHOLD_CASE_FOLD_ALT_FOR_EXPANSION-
Fields inherited from class org.joni.Parser
regex, returnCode, root
-
Fields inherited from interface org.jcodings.exception.ErrorMessages
ERR_COULD_NOT_REPLICATE, ERR_ENCODING_ALIAS_ALREADY_REGISTERED, ERR_ENCODING_ALREADY_REGISTERED, ERR_ENCODING_CLASS_DEF_NOT_FOUND, ERR_ENCODING_LOAD_ERROR, ERR_ENCODING_REPLICA_ALREADY_REGISTERED, ERR_ILLEGAL_CHARACTER, ERR_INVALID_CHAR_PROPERTY_NAME, ERR_INVALID_CODE_POINT_VALUE, ERR_NO_SUCH_ENCODNG, ERR_TOO_BIG_WIDE_CHAR_VALUE, ERR_TOO_LONG_WIDE_CHAR_VALUE, ERR_TRANSCODER_ALREADY_REGISTERED, ERR_TRANSCODER_CLASS_DEF_NOT_FOUND, ERR_TRANSCODER_LOAD_ERROR
-
Fields inherited from interface org.joni.exception.ErrorMessages
ERR_CHAR_CLASS_VALUE_AT_END_OF_RANGE, ERR_CHAR_CLASS_VALUE_AT_START_OF_RANGE, ERR_CONTROL_CODE_SYNTAX, ERR_DEFAULT_ENCODING_IS_NOT_SETTED, ERR_EMPTY_CHAR_CLASS, ERR_EMPTY_GROUP_NAME, ERR_EMPTY_RANGE_IN_CHAR_CLASS, ERR_END_PATTERN_AT_CONTROL, ERR_END_PATTERN_AT_ESCAPE, ERR_END_PATTERN_AT_LEFT_BRACE, ERR_END_PATTERN_AT_LEFT_BRACKET, ERR_END_PATTERN_AT_META, ERR_END_PATTERN_IN_GROUP, ERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS, ERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY, ERR_INVALID_ARGUMENT, ERR_INVALID_BACKREF, ERR_INVALID_CHAR_IN_GROUP_NAME, ERR_INVALID_COMBINATION_OF_OPTIONS, ERR_INVALID_GROUP_NAME, ERR_INVALID_LOOK_BEHIND_PATTERN, ERR_INVALID_POSIX_BRACKET_TYPE, ERR_INVALID_REPEAT_RANGE_PATTERN, ERR_INVALID_WIDE_CHAR_VALUE, ERR_MATCH_STACK_LIMIT_OVER, ERR_MEMORY, ERR_META_CODE_SYNTAX, ERR_MISMATCH_CODE_LENGTH_IN_CLASS_RANGE, ERR_MULTIPLEX_DEFINED_NAME, ERR_MULTIPLEX_DEFINITION_NAME_CALL, ERR_NESTED_REPEAT_NOT_ALLOWED, ERR_NESTED_REPEAT_OPERATOR, ERR_NEVER_ENDING_RECURSION, ERR_NOT_SUPPORTED_ENCODING_COMBINATION, ERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED, ERR_OVER_THREAD_PASS_LIMIT_COUNT, ERR_PARSER_BUG, ERR_PREMATURE_END_OF_CHAR_CLASS, ERR_SPECIFIED_ENCODING_CANT_CONVERT_TO_WIDE_CHAR, ERR_STACK_BUG, ERR_TARGET_OF_REPEAT_OPERATOR_INVALID, ERR_TARGET_OF_REPEAT_OPERATOR_NOT_SPECIFIED, ERR_TOO_BIG_BACKREF_NUMBER, ERR_TOO_BIG_NUMBER, ERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE, ERR_TOO_BIG_SB_CHAR_VALUE, ERR_TOO_MANY_MULTI_BYTE_RANGES, ERR_TOO_SHORT_MULTI_BYTE_STRING, ERR_TYPE_BUG, ERR_UNDEFINED_BYTECODE, ERR_UNDEFINED_GROUP_OPTION, ERR_UNDEFINED_GROUP_REFERENCE, ERR_UNDEFINED_NAME_REFERENCE, ERR_UNEXPECTED_BYTECODE, ERR_UNMATCHED_CLOSE_PARENTHESIS, ERR_UNMATCHED_RANGE_SPECIFIER_IN_CHAR_CLASS, ERR_UPPER_SMALLER_THAN_LOWER_IN_REPEAT_RANGE, MISMATCH, NO_SUPPORT_CONFIG
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAnalyser(ScanEnvironment env, byte[] bytes, int p, int end)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private booleancheckTypeTree(Node node, int typeMask, int encloseMask, int anchorMask)protected voidcompile()protected NodedisableNoNameGroupCapture(Node root)private NodedivideLookBehindAlternatives(Node node)private NodeexpandCaseFoldMakeRemString(byte[] bytes, int p, int end)private NodeexpandCaseFoldString(Node node)private booleanexpandCaseFoldStringAlt(int itemNum, org.jcodings.CaseFoldCodeItem[] items, byte[] bytes, int p, int slen, int end, org.jcodings.ObjPtr<Node> node)protected intgetCharLengthTree(Node node)private intgetCharLengthTree(Node node, int level)private NodegetHeadValueNode(Node node, boolean exact)private intgetMaxMatchLength(Node node)private intgetMinMatchLength(Node node)private booleanisNotIncluded(Node x, Node y)private voidnextSetup(Node node, Node nextNode)private NodenoNameDisableMap(Node node, int[] map, org.jcodings.Ptr counter)private voidnoNameDisableMapFor_anchor(Node node, int[] map, org.jcodings.Ptr counter)private voidnoNameDisableMapFor_cosAlt(Node node, int[] map, org.jcodings.Ptr counter)private NodenoNameDisableMapFor_enclose(Node node, int[] map, org.jcodings.Ptr counter)private voidnoNameDisableMapFor_quantifier(Node node, int[] map, org.jcodings.Ptr counter)protected voidnumberedRefCheck(Node node)private voidoptimizeNodeLeft(Node node, NodeOptInfo opt, OptEnvironment oenv)private intquantifiersMemoryInfo(Node node)private voidrenumberByMap(Node node, int[] map)private voidsetCallAttr(CallNode cn)protected voidsetOptimizedInfoFromTree(Node node)protected intsetupCombExpCheck(Node node, int state)private NodesetupLookBehind(Node node)protected voidsetupSubExpCall(Node node)protected NodesetupTree(Node node, int state)private intsubexpInfRecursiveCheck(Node node, boolean head)protected intsubexpInfRecursiveCheckTrav(Node node)private intsubexpRecursiveCheck(Node node)protected intsubexpRecursiveCheckTrav(Node node)private voidswap(Node a, Node b)private voidupdateStringNodeCaseFold(Node node)private voidupdateStringNodeCaseFoldMultiByte(StringNode sn)private voidupdateStringNodeCaseFoldSingleByte(StringNode sn, byte[] toLower)-
Methods inherited from class org.joni.Lexer
backrefRelToAbs, fetchCharPropertyToCType, fetchName, fetchToken, fetchTokenInCC, syntaxWarn, syntaxWarn
-
Methods inherited from class org.joni.ScannerSupport
fetch, fetchTo, getBegin, getEnd, inc, left, mark, newInternalException, newSyntaxException, newValueException, newValueException, newValueException, peek, peekIs, reset, restore, scanUnsignedHexadecimalNumber, scanUnsignedNumber, scanUnsignedOctalNumber, unfetch
-
-
-
-
Field Detail
-
GET_CHAR_LEN_VARLEN
private static final int GET_CHAR_LEN_VARLEN
- See Also:
- Constant Field Values
-
GET_CHAR_LEN_TOP_ALT_VARLEN
private static final int GET_CHAR_LEN_TOP_ALT_VARLEN
- See Also:
- Constant Field Values
-
RECURSION_EXIST
private static final int RECURSION_EXIST
- See Also:
- Constant Field Values
-
RECURSION_INFINITE
private static final int RECURSION_INFINITE
- See Also:
- Constant Field Values
-
FOUND_CALLED_NODE
private static final int FOUND_CALLED_NODE
- See Also:
- Constant Field Values
-
THRESHOLD_CASE_FOLD_ALT_FOR_EXPANSION
private static final int THRESHOLD_CASE_FOLD_ALT_FOR_EXPANSION
- See Also:
- Constant Field Values
-
CEC_THRES_NUM_BIG_REPEAT
private static final int CEC_THRES_NUM_BIG_REPEAT
- See Also:
- Constant Field Values
-
CEC_INFINITE_NUM
private static final int CEC_INFINITE_NUM
- See Also:
- Constant Field Values
-
CEC_IN_INFINITE_REPEAT
private static final int CEC_IN_INFINITE_REPEAT
- See Also:
- Constant Field Values
-
CEC_IN_FINITE_REPEAT
private static final int CEC_IN_FINITE_REPEAT
- See Also:
- Constant Field Values
-
CEC_CONT_BIG_REPEAT
private static final int CEC_CONT_BIG_REPEAT
- See Also:
- Constant Field Values
-
IN_ALT
private static final int IN_ALT
- See Also:
- Constant Field Values
-
IN_NOT
private static final int IN_NOT
- See Also:
- Constant Field Values
-
IN_REPEAT
private static final int IN_REPEAT
- See Also:
- Constant Field Values
-
IN_VAR_REPEAT
private static final int IN_VAR_REPEAT
- See Also:
- Constant Field Values
-
EXPAND_STRING_MAX_LENGTH
private static final int EXPAND_STRING_MAX_LENGTH
- See Also:
- Constant Field Values
-
MAX_NODE_OPT_INFO_REF_COUNT
private static final int MAX_NODE_OPT_INFO_REF_COUNT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Analyser
protected Analyser(ScanEnvironment env, byte[] bytes, int p, int end)
-
-
Method Detail
-
compile
protected final void compile()
-
noNameDisableMapFor_cosAlt
private void noNameDisableMapFor_cosAlt(Node node, int[] map, org.jcodings.Ptr counter)
-
noNameDisableMapFor_quantifier
private void noNameDisableMapFor_quantifier(Node node, int[] map, org.jcodings.Ptr counter)
-
noNameDisableMapFor_enclose
private Node noNameDisableMapFor_enclose(Node node, int[] map, org.jcodings.Ptr counter)
-
noNameDisableMapFor_anchor
private void noNameDisableMapFor_anchor(Node node, int[] map, org.jcodings.Ptr counter)
-
renumberByMap
private void renumberByMap(Node node, int[] map)
-
numberedRefCheck
protected final void numberedRefCheck(Node node)
-
quantifiersMemoryInfo
private int quantifiersMemoryInfo(Node node)
-
getMinMatchLength
private int getMinMatchLength(Node node)
-
getMaxMatchLength
private int getMaxMatchLength(Node node)
-
getCharLengthTree
protected final int getCharLengthTree(Node node)
-
getCharLengthTree
private int getCharLengthTree(Node node, int level)
-
checkTypeTree
private boolean checkTypeTree(Node node, int typeMask, int encloseMask, int anchorMask)
-
subexpInfRecursiveCheck
private int subexpInfRecursiveCheck(Node node, boolean head)
-
subexpInfRecursiveCheckTrav
protected final int subexpInfRecursiveCheckTrav(Node node)
-
subexpRecursiveCheck
private int subexpRecursiveCheck(Node node)
-
subexpRecursiveCheckTrav
protected final int subexpRecursiveCheckTrav(Node node)
-
setCallAttr
private void setCallAttr(CallNode cn)
-
setupSubExpCall
protected final void setupSubExpCall(Node node)
-
updateStringNodeCaseFoldSingleByte
private void updateStringNodeCaseFoldSingleByte(StringNode sn, byte[] toLower)
-
updateStringNodeCaseFoldMultiByte
private void updateStringNodeCaseFoldMultiByte(StringNode sn)
-
updateStringNodeCaseFold
private void updateStringNodeCaseFold(Node node)
-
expandCaseFoldMakeRemString
private Node expandCaseFoldMakeRemString(byte[] bytes, int p, int end)
-
expandCaseFoldStringAlt
private boolean expandCaseFoldStringAlt(int itemNum, org.jcodings.CaseFoldCodeItem[] items, byte[] bytes, int p, int slen, int end, org.jcodings.ObjPtr<Node> node)
-
setupCombExpCheck
protected final int setupCombExpCheck(Node node, int state)
-
optimizeNodeLeft
private void optimizeNodeLeft(Node node, NodeOptInfo opt, OptEnvironment oenv)
-
setOptimizedInfoFromTree
protected final void setOptimizedInfoFromTree(Node node)
-
-