- 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[]
code
private int
codeLength
private static int
QUANTIFIER_EXPAND_LIMIT_SIZE
private static int
REPEAT_RANGE_ALLOC
private int
templateNum
private 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 void
addAbsAddr(int addr)
private void
addBytes(byte[] bytes, int p, int length)
protected void
addCompileString(byte[] bytes, int p, int mbLength, int byteLength, boolean ignoreCase)
private int
addCompileStringlength(byte[] bytes, int p, int mbLength, int byteLength, boolean ignoreCase)
private void
addInt(int i)
private void
addInts(int[] ints, int length)
private void
addLength(int length)
private void
addMemNum(int num)
private void
addMultiByteCClass(CodeRangeBuffer mbuf)
private void
addOpcode(int opcode)
private void
addOpcodeOption(int opcode, int option)
private void
addOpcodeRelAddr(int opcode, int addr)
private void
addOption(int option)
private void
addRelAddr(int addr)
private void
addStateCheckNum(int num)
private void
addTemplate(byte[] bytes)
private static boolean
cknOn(int ckn)
protected void
compileAltNode(ListNode node)
protected void
compileAnchorNode(AnchorNode node)
protected void
compileAnyCharNode()
protected void
compileBackrefNode(BackRefNode node)
protected void
compileCallNode(CallNode node)
protected void
compileCClassNode(CClassNode cc)
private int
compileCECLengthQuantifierNode(QuantifierNode qn)
protected void
compileCECQuantifierNode(QuantifierNode qn)
protected void
compileCTypeNode(CTypeNode node)
protected void
compileEncloseNode(EncloseNode node)
private int
compileLengthAnchorNode(AnchorNode node)
private int
compileLengthCClassNode(CClassNode cc)
private int
compileLengthEncloseNode(EncloseNode node)
private int
compileLengthOptionNode(EncloseNode node)
private int
compileLengthStringNode(Node node)
private int
compileLengthStringRawNode(StringNode sn)
private int
compileLengthTree(Node node)
private int
compileNonCECLengthQuantifierNode(QuantifierNode qn)
protected void
compileNonCECQuantifierNode(QuantifierNode qn)
protected void
compileOptionNode(EncloseNode node)
private void
compileRangeRepeatNode(QuantifierNode qn, int targetLen, int emptyInfo)
private void
compileTreeEmptyCheck(Node node, int emptyInfo)
private void
ensure(int size)
private void
entryRepeatRange(int id, int lower, int upper)
protected void
finish()
private boolean
isNeedStrLenOpExact(int op)
private boolean
opTemplated(int op)
protected void
prepare()
private int
selectStrOpcode(int mbLength, int byteLength, boolean ignoreCase)
(package private) void
setInt(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:
compileAltNode
in 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:
addCompileString
in 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:
compileCClassNode
in classCompiler
-
compileCTypeNode
protected void compileCTypeNode(CTypeNode node)
- Specified by:
compileCTypeNode
in classCompiler
-
compileAnyCharNode
protected void compileAnyCharNode()
- Specified by:
compileAnyCharNode
in classCompiler
-
compileCallNode
protected void compileCallNode(CallNode node)
- Specified by:
compileCallNode
in classCompiler
-
compileBackrefNode
protected void compileBackrefNode(BackRefNode node)
- Specified by:
compileBackrefNode
in 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:
compileCECQuantifierNode
in classCompiler
-
compileNonCECLengthQuantifierNode
private int compileNonCECLengthQuantifierNode(QuantifierNode qn)
-
compileNonCECQuantifierNode
protected void compileNonCECQuantifierNode(QuantifierNode qn)
- Specified by:
compileNonCECQuantifierNode
in classCompiler
-
compileLengthOptionNode
private int compileLengthOptionNode(EncloseNode node)
-
compileOptionNode
protected void compileOptionNode(EncloseNode node)
- Specified by:
compileOptionNode
in classCompiler
-
compileLengthEncloseNode
private int compileLengthEncloseNode(EncloseNode node)
-
compileEncloseNode
protected void compileEncloseNode(EncloseNode node)
- Specified by:
compileEncloseNode
in classCompiler
-
compileLengthAnchorNode
private int compileLengthAnchorNode(AnchorNode node)
-
compileAnchorNode
protected void compileAnchorNode(AnchorNode node)
- Specified by:
compileAnchorNode
in 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)
-
-