public Validator(String expression) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException { DFA<Integer> dfa = Regex.createDFA(expression); start = dfa.getRoot(); }
public void distribute() { distribute(dfa.getRoot(), dfa.initialSize()); } private void distribute(DFAState<T> state, int rootCount)
/** * @param args the command line arguments */ public static void main(String[] args) { try { DFA<Integer> dfa = Regex.createDFA("ashjkahsj(ha|kjkajdkasdj)+h|yrquiyqiwdioas|(kdajksdfh){2,3}ajkshdjkah|ajhdajsdjkahsdjkah"); DiGraphIterator<DFAState<Integer>> i = new DiGraphIterator<>(dfa.getRoot()); while (i.hasNext()) { System.err.println(i.next()); } } catch (Exception ex) { ex.printStackTrace(); } }
/** * Compiles expressions */ public void compile() { Scope<DFAState<T>> dfaScope = new Scope<>("org.vesalainen.regex.RegexMatcher"); if (nfa == null) { nfa = new NFA(dfaScope); } dfa = nfa.constructDFA(dfaScope); state = root = dfa.getRoot(); parser = null; nfaScope = null; nfa = null; } /**
if (dfa.getRoot().isAccepting())