- java.lang.Object
-
- org.joni.Compiler
-
- org.joni.ArrayCompiler
-
- All Implemented Interfaces:
org.jcodings.exception.ErrorMessages,ErrorMessages
final class ArrayCompiler extends Compiler
-
-
Field Summary
Fields Modifier and Type Field Description private int[]codeprivate intcodeLengthprivate static intQUANTIFIER_EXPAND_LIMIT_SIZEprivate static intREPEAT_RANGE_ALLOCprivate inttemplateNumprivate byte[][]templates-
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, ERR_TYPE_BUG
-
Fields inherited from interface org.joni.exception.ErrorMessages
CHAR_CLASS_VALUE_AT_END_OF_RANGE, CHAR_CLASS_VALUE_AT_START_OF_RANGE, CONTROL_CODE_SYNTAX, EMPTY_CHAR_CLASS, EMPTY_GROUP_NAME, EMPTY_RANGE_IN_CHAR_CLASS, END_PATTERN_AT_CONTROL, END_PATTERN_AT_ESCAPE, END_PATTERN_AT_LEFT_BRACE, END_PATTERN_AT_LEFT_BRACKET, END_PATTERN_AT_META, END_PATTERN_IN_GROUP, END_PATTERN_WITH_UNMATCHED_PARENTHESIS, GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY, INVALID_ARGUMENT, INVALID_BACKREF, INVALID_CHAR_IN_GROUP_NAME, INVALID_COMBINATION_OF_OPTIONS, INVALID_CONDITION_PATTERN, INVALID_GROUP_NAME, INVALID_LOOK_BEHIND_PATTERN, INVALID_POSIX_BRACKET_TYPE, INVALID_REPEAT_RANGE_PATTERN, INVALID_WIDE_CHAR_VALUE, META_CODE_SYNTAX, MISMATCH_CODE_LENGTH_IN_CLASS_RANGE, MULTIPLEX_DEFINED_NAME, MULTIPLEX_DEFINITION_NAME_CALL, NESTED_REPEAT_NOT_ALLOWED, NESTED_REPEAT_OPERATOR, NEVER_ENDING_RECURSION, NOT_SUPPORTED_ENCODING_COMBINATION, NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED, OVER_THREAD_PASS_LIMIT_COUNT, PARSER_BUG, PREMATURE_END_OF_CHAR_CLASS, PROPERTY_NAME_NEVER_TERMINATED, TARGET_OF_REPEAT_OPERATOR_INVALID, TARGET_OF_REPEAT_OPERATOR_NOT_SPECIFIED, TOO_BIG_BACKREF_NUMBER, TOO_BIG_NUMBER, TOO_BIG_NUMBER_FOR_REPEAT_RANGE, TOO_BIG_SB_CHAR_VALUE, TOO_MANY_CAPTURE_GROUPS, TOO_MANY_MULTI_BYTE_RANGES, TOO_SHORT_DIGITS, TOO_SHORT_MULTI_BYTE_STRING, UNDEFINED_BYTECODE, UNDEFINED_GROUP_OPTION, UNDEFINED_GROUP_REFERENCE, UNDEFINED_NAME_REFERENCE, UNEXPECTED_BYTECODE, UNMATCHED_CLOSE_PARENTHESIS, UNMATCHED_RANGE_SPECIFIER_IN_CHAR_CLASS, UPPER_SMALLER_THAN_LOWER_IN_REPEAT_RANGE
-
-
Constructor Summary
Constructors Constructor Description ArrayCompiler(Analyser analyser)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidaddAbsAddr(int addr)private voidaddBytes(byte[] bytes, int p, int length)protected voidaddCompileString(byte[] bytes, int p, int mbLength, int byteLength, boolean ignoreCase)private intaddCompileStringlength(byte[] bytes, int p, int mbLength, int byteLength, boolean ignoreCase)private voidaddInt(int i)private voidaddInts(int[] ints, int length)private voidaddLength(int length)private voidaddMemNum(int num)private voidaddMultiByteCClass(CodeRangeBuffer mbuf)private voidaddOpcode(int opcode)private voidaddOpcodeOption(int opcode, int option)private voidaddOpcodeRelAddr(int opcode, int addr)private voidaddOption(int option)private voidaddRelAddr(int addr)private voidaddStateCheckNum(int num)private voidaddTemplate(byte[] bytes)private static booleancknOn(int ckn)protected voidcompileAltNode(ListNode node)protected voidcompileAnchorNode(AnchorNode node)protected voidcompileAnyCharNode()protected voidcompileBackrefNode(BackRefNode node)protected voidcompileCallNode(CallNode node)protected voidcompileCClassNode(CClassNode cc)private intcompileCECLengthQuantifierNode(QuantifierNode qn)protected voidcompileCECQuantifierNode(QuantifierNode qn)protected voidcompileCTypeNode(CTypeNode node)protected voidcompileEncloseNode(EncloseNode node)private intcompileLengthAnchorNode(AnchorNode node)private intcompileLengthCClassNode(CClassNode cc)private intcompileLengthEncloseNode(EncloseNode node)private intcompileLengthOptionNode(EncloseNode node)private intcompileLengthStringNode(Node node)private intcompileLengthStringRawNode(StringNode sn)private intcompileLengthTree(Node node)private intcompileNonCECLengthQuantifierNode(QuantifierNode qn)protected voidcompileNonCECQuantifierNode(QuantifierNode qn)protected voidcompileOptionNode(EncloseNode node)private voidcompileRangeRepeatNode(QuantifierNode qn, int targetLen, int emptyInfo)private voidcompileTreeEmptyCheck(Node node, int emptyInfo)private voidensure(int size)private voidentryRepeatRange(int id, int lower, int upper)protected voidfinish()private booleanisNeedStrLenOpExact(int op)private booleanopTemplated(int op)protected voidprepare()private intselectStrOpcode(int mbLength, int byteLength, boolean ignoreCase)(package private) voidsetInt(int i, int offset)-
Methods inherited from class org.joni.Compiler
compile, compileTree, compileTreeNTimes, newInternalException, newSyntaxException
-
-
-
-
Field Detail
-
code
private int[] code
-
codeLength
private int codeLength
-
templates
private byte[][] templates
-
templateNum
private int templateNum
-
REPEAT_RANGE_ALLOC
private static final int REPEAT_RANGE_ALLOC
- See Also:
- Constant Field Values
-
QUANTIFIER_EXPAND_LIMIT_SIZE
private static final int QUANTIFIER_EXPAND_LIMIT_SIZE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ArrayCompiler
ArrayCompiler(Analyser analyser)
-
-
Method Detail
-
compileAltNode
protected void compileAltNode(ListNode node)
- Specified by:
compileAltNodein classCompiler
-
isNeedStrLenOpExact
private boolean isNeedStrLenOpExact(int op)
-
opTemplated
private boolean opTemplated(int op)
-
selectStrOpcode
private int selectStrOpcode(int mbLength, int byteLength, boolean ignoreCase)
-
compileTreeEmptyCheck
private void compileTreeEmptyCheck(Node node, int emptyInfo)
-
addCompileStringlength
private int addCompileStringlength(byte[] bytes, int p, int mbLength, int byteLength, boolean ignoreCase)
-
addCompileString
protected final void addCompileString(byte[] bytes, int p, int mbLength, int byteLength, boolean ignoreCase)- Specified by:
addCompileStringin classCompiler
-
compileLengthStringNode
private int compileLengthStringNode(Node node)
-
compileLengthStringRawNode
private int compileLengthStringRawNode(StringNode sn)
-
addMultiByteCClass
private void addMultiByteCClass(CodeRangeBuffer mbuf)
-
compileLengthCClassNode
private int compileLengthCClassNode(CClassNode cc)
-
compileCClassNode
protected void compileCClassNode(CClassNode cc)
- Specified by:
compileCClassNodein classCompiler
-
compileCTypeNode
protected void compileCTypeNode(CTypeNode node)
- Specified by:
compileCTypeNodein classCompiler
-
compileAnyCharNode
protected void compileAnyCharNode()
- Specified by:
compileAnyCharNodein classCompiler
-
compileCallNode
protected void compileCallNode(CallNode node)
- Specified by:
compileCallNodein classCompiler
-
compileBackrefNode
protected void compileBackrefNode(BackRefNode node)
- Specified by:
compileBackrefNodein classCompiler
-
entryRepeatRange
private void entryRepeatRange(int id, int lower, int upper)
-
compileRangeRepeatNode
private void compileRangeRepeatNode(QuantifierNode qn, int targetLen, int emptyInfo)
-
cknOn
private static boolean cknOn(int ckn)
-
compileCECLengthQuantifierNode
private int compileCECLengthQuantifierNode(QuantifierNode qn)
-
compileCECQuantifierNode
protected void compileCECQuantifierNode(QuantifierNode qn)
- Specified by:
compileCECQuantifierNodein classCompiler
-
compileNonCECLengthQuantifierNode
private int compileNonCECLengthQuantifierNode(QuantifierNode qn)
-
compileNonCECQuantifierNode
protected void compileNonCECQuantifierNode(QuantifierNode qn)
- Specified by:
compileNonCECQuantifierNodein classCompiler
-
compileLengthOptionNode
private int compileLengthOptionNode(EncloseNode node)
-
compileOptionNode
protected void compileOptionNode(EncloseNode node)
- Specified by:
compileOptionNodein classCompiler
-
compileLengthEncloseNode
private int compileLengthEncloseNode(EncloseNode node)
-
compileEncloseNode
protected void compileEncloseNode(EncloseNode node)
- Specified by:
compileEncloseNodein classCompiler
-
compileLengthAnchorNode
private int compileLengthAnchorNode(AnchorNode node)
-
compileAnchorNode
protected void compileAnchorNode(AnchorNode node)
- Specified by:
compileAnchorNodein classCompiler
-
compileLengthTree
private int compileLengthTree(Node node)
-
ensure
private void ensure(int size)
-
addInt
private void addInt(int i)
-
setInt
void setInt(int i, int offset)
-
addBytes
private void addBytes(byte[] bytes, int p, int length)
-
addInts
private void addInts(int[] ints, int length)
-
addOpcode
private void addOpcode(int opcode)
-
addStateCheckNum
private void addStateCheckNum(int num)
-
addRelAddr
private void addRelAddr(int addr)
-
addAbsAddr
private void addAbsAddr(int addr)
-
addLength
private void addLength(int length)
-
addMemNum
private void addMemNum(int num)
-
addOption
private void addOption(int option)
-
addOpcodeRelAddr
private void addOpcodeRelAddr(int opcode, int addr)
-
addOpcodeOption
private void addOpcodeOption(int opcode, int option)
-
addTemplate
private void addTemplate(byte[] bytes)
-
-