Public Methods | |
final InstructionList | getInstructionList () |
final InstructionHandle[] | getMatch () |
final int | getMatchLength () |
final void | reread () |
final InstructionHandle | search (String pattern) |
final InstructionHandle | search (String pattern, CodeConstraint constraint) |
final InstructionHandle | search (String pattern, InstructionHandle from) |
final InstructionHandle | search (String pattern, InstructionHandle from, CodeConstraint constraint) |
final void | setInstructionList (InstructionList il) |
final InstructionList | getInstructionList () |
final InstructionHandle[] | getMatch () |
final int | getMatchLength () |
final void | reread () |
final InstructionHandle | search (String pattern) |
final InstructionHandle | search (String pattern, CodeConstraint constraint) |
final InstructionHandle | search (String pattern, InstructionHandle from) |
final InstructionHandle | search (String pattern, InstructionHandle from, CodeConstraint constraint) |
final void | setInstructionList (InstructionList il) |
Static Public Methods | |
FindPattern (InstructionList il) | |
FindPattern (InstructionList il) | |
Static Private Methods | |
final void | appendPatterns (StringBuffer buf, short from, short to) |
final String | getPattern (String pattern) |
final char | makeChar (short opcode) |
final String | makePattern (String pattern) |
final String | pattern2string (String pattern) |
final String | pattern2string (String pattern, boolean make_string) |
final void | appendPatterns (StringBuffer buf, short from, short to) |
final String | getPattern (String pattern) |
final char | makeChar (short opcode) |
final String | makePattern (String pattern) |
final String | pattern2string (String pattern) |
final String | pattern2string (String pattern, boolean make_string) |
Private Attributes | |
InstructionList | il |
String | il_string |
InstructionHandle[] | handles |
int | match_length |
int | matched_from |
InstructionHandle[] | handles |
Static Private Attributes | |
final int | OFFSET = 32767 |
final int | NO_OPCODES = 256 |
final String[] | patterns |
String[] | pattern_map |
final String[] | patterns |
String[] | pattern_map |
This class internally uses the package gnu.regexp to search for regular expressions.
Definition at line 23 of file lib/jpf/de/fub/bytecode/generic/FindPattern.java.
|
Definition at line 210 of file lib/jpf/de/fub/bytecode/generic/FindPattern.java. |
|
Definition at line 210 of file src/de/fub/bytecode/generic/FindPattern.java. |
|
Append instructions characters starting from `start' to `to'. Definition at line 217 of file src/de/fub/bytecode/generic/FindPattern.java. |
|
Append instructions characters starting from `start' to `to'. Definition at line 217 of file lib/jpf/de/fub/bytecode/generic/FindPattern.java. |
|
Definition at line 228 of file src/de/fub/bytecode/generic/FindPattern.java. |
|
Definition at line 228 of file lib/jpf/de/fub/bytecode/generic/FindPattern.java. |
|
Definition at line 232 of file src/de/fub/bytecode/generic/FindPattern.java. |
|
Definition at line 232 of file lib/jpf/de/fub/bytecode/generic/FindPattern.java. |
|
Definition at line 244 of file src/de/fub/bytecode/generic/FindPattern.java. |
|
Definition at line 244 of file lib/jpf/de/fub/bytecode/generic/FindPattern.java. |
|
Map symbolic strings like `branchinstruction' or `'a regular expression string such as (a|b|z) (where a,b,c whil be non-printable characters in LATIN-1)
Definition at line 252 of file src/de/fub/bytecode/generic/FindPattern.java. |
|
Map symbolic strings like `branchinstruction' or `'a regular expression string such as (a|b|z) (where a,b,c whil be non-printable characters in LATIN-1)
Definition at line 252 of file lib/jpf/de/fub/bytecode/generic/FindPattern.java. |
|
Convert opcode number to char. Definition at line 269 of file src/de/fub/bytecode/generic/FindPattern.java. |
|
Convert opcode number to char. Definition at line 269 of file lib/jpf/de/fub/bytecode/generic/FindPattern.java. Referenced by appendPatterns(), and getPattern().
|
|
Replace all occurences of `something' with the appropiate pattern, the `' chars are used as an escape sequence. Other characters than the escaped one will be ignored, in particular the meta characters used for regular expression such as *, +, [, etc.
Definition at line 281 of file src/de/fub/bytecode/generic/FindPattern.java. |
|
Replace all occurences of `something' with the appropiate pattern, the `' chars are used as an escape sequence. Other characters than the escaped one will be ignored, in particular the meta characters used for regular expression such as *, +, [, etc.
Definition at line 281 of file lib/jpf/de/fub/bytecode/generic/FindPattern.java. |
|
Internal debugging routines. Definition at line 331 of file src/de/fub/bytecode/generic/FindPattern.java. |
|
Internal debugging routines. Definition at line 331 of file lib/jpf/de/fub/bytecode/generic/FindPattern.java. |
|
Rereads the instruction list, e.g., after you've altered the list upon a match. Definition at line 355 of file src/de/fub/bytecode/generic/FindPattern.java. |
|
Rereads the instruction list, e.g., after you've altered the list upon a match. Definition at line 355 of file lib/jpf/de/fub/bytecode/generic/FindPattern.java. Referenced by FindPattern().
|
|
Search for the given pattern in the InstructionList. You may use the following special expressions in your pattern string which match instructions that belong to the denoted class. The `' are an escape and must not be omitted. You can use the Instruction names directly: `ILOAD_1', `GOTO', 'NOP', etc.. For convenience there exist some abbreviations for instructions that belong to the same group (underscores _ are used as some kind of wildcards): `Instruction', `BranchInstruction', `InvokeInstruction', `ReturnInstruction', `IfInstruction' correspond to their classes. `IF_ICMP__', `IF__', where __ stands for EQ, LE, etc. `xLOAD__', `xSTORE__', where x stands for I, D, F, L or A. __ is 0..3 or empty `PUSH' stands for any LDC, xCONST__, SIPUSH or BIPUSH instruction You must put the `' around these words or they can't be matched correctly. For the rest the usual (PERL) pattern matching rules apply. Example pattern: search("(`BranchInstruction')`NOP'((`IF_ICMP__'|`GOTO')+`ISTORE__'`Instruction')*");
Definition at line 432 of file src/de/fub/bytecode/generic/FindPattern.java. |
|
Start search beginning from `from'.
Definition at line 395 of file src/de/fub/bytecode/generic/FindPattern.java. |
|
Start search beginning from the start of the given instruction list. Check found matches with the constraint object.
Definition at line 385 of file src/de/fub/bytecode/generic/FindPattern.java. |
|
Start search beginning from the start of the given instruction list.
Definition at line 374 of file src/de/fub/bytecode/generic/FindPattern.java. |
|
Search for the given pattern in the InstructionList. You may use the following special expressions in your pattern string which match instructions that belong to the denoted class. The `' are an escape and must not be omitted. You can use the Instruction names directly: `ILOAD_1', `GOTO', 'NOP', etc.. For convenience there exist some abbreviations for instructions that belong to the same group (underscores _ are used as some kind of wildcards): `Instruction', `BranchInstruction', `InvokeInstruction', `ReturnInstruction', `IfInstruction' correspond to their classes. `IF_ICMP__', `IF__', where __ stands for EQ, LE, etc. `xLOAD__', `xSTORE__', where x stands for I, D, F, L or A. __ is 0..3 or empty `PUSH' stands for any LDC, xCONST__, SIPUSH or BIPUSH instruction You must put the `' around these words or they can't be matched correctly. For the rest the usual (PERL) pattern matching rules apply. Example pattern: search("(`BranchInstruction')`NOP'((`IF_ICMP__'|`GOTO')+`ISTORE__'`Instruction')*");
Definition at line 432 of file lib/jpf/de/fub/bytecode/generic/FindPattern.java. |
|
Start search beginning from `from'.
Definition at line 395 of file lib/jpf/de/fub/bytecode/generic/FindPattern.java. |
|
Start search beginning from the start of the given instruction list. Check found matches with the constraint object.
Definition at line 385 of file lib/jpf/de/fub/bytecode/generic/FindPattern.java. |
|
Start search beginning from the start of the given instruction list.
Definition at line 374 of file lib/jpf/de/fub/bytecode/generic/FindPattern.java. |
|
Defines a new instruction list. Automatically calls reread() to update the object.
Definition at line 473 of file src/de/fub/bytecode/generic/FindPattern.java. |
|
Defines a new instruction list. Automatically calls reread() to update the object.
Definition at line 473 of file lib/jpf/de/fub/bytecode/generic/FindPattern.java. |
|
Initial value: { "instruction", "branchinstruction", "if_icmp__", "if__", "push", "iload__", "aload__", "fload__", "dload__", "lload__", "istore__", "astore__", "fstore__", "dstore__", "lstore__", "invokeinstruction", "returninstruction", "ifinstruction" } Definition at line 27 of file src/de/fub/bytecode/generic/FindPattern.java. |
|
Initial value: { "instruction", "branchinstruction", "if_icmp__", "if__", "push", "iload__", "aload__", "fload__", "dload__", "lload__", "istore__", "astore__", "fstore__", "dstore__", "lstore__", "invokeinstruction", "returninstruction", "ifinstruction" } Definition at line 27 of file lib/jpf/de/fub/bytecode/generic/FindPattern.java. |