Static Public Member Functions | |
boolean | testSet (final String pattern, int offset, final char ch) |
boolean | parse (final String pattern, final int ofp, final String str, final int ofs) |
boolean | match (final String pattern, final String str) |
void | main (String[] args) |
Static Private Member Functions | |
int | getToken (final char ch) |
Static Private Attributes | |
final boolean | DEBUG = false |
final int | INITIAL = 0 |
final int | FINAL = 2 |
final int | ERROR = 99 |
final int | TOKEN_CHAR = 0 |
final int | TOKEN_END = 1 |
final int | TOKEN_NOT = 2 |
final int | TOKEN_MINUS = 3 |
final int[][] | TRANSITIONS |
... are not processed. Wildchar rules: : match any number (0..inf) number of occurences of any character ? : match exactly and only one occurence of any character ab : match exactly 'ab' [..]: same as , but character must match the set.
|
|
|
Run test applet.
|
|
DOCUMENT ME!
|
|
Recursive method for parsing the string. To avoid copying the strings, the method accepts offset indices into both parameters.
|
|
DFA for parsing set strings. DFA was obtained from JFlex using the rule : macro: CHAR = [^-\]\!] (everything except ], ! and - rule : [!]?(-{CHAR})?(({CHAR}-{CHAR})|({CHAR}))({CHAR}-)?\] Result of optimized NDFA is Character classes: class 0: [0-' ']['"'-',']['.'-'\']['^'-65535] class 1: [']'] class 2: ['!'] class 3: ['-'] Transition graph (for class goto state) State 0: 0 -> 1, 1 -> 2, 2 -> 3, 3 -> 4 State 1: 0 -> 1, 1 -> 2, 3 -> 5 State [FINAL] State 3: 0 -> 1, 1 -> 2, 3 -> 4 State 4: 0 -> 6 State 5: 0 -> 6, 1 -> 2 State 6: 0 -> 1, 1 -> 2
|
|
|
|
Value of error state |
|
Value of final state |
|
Value of initial state |
|
Any character (except control, unless escaped) |
|
Token for end of set: ] |
|
Token for range specification: - |
|
Token for negation: |
|
Initial value: Transition table holds the nextState used in set parsing. Rows define states, columns define tokens. transitions[1][3] = 5 means: if in state 1 next token is 3, goto state 5 |