String stateDump(DFAState<T> state) { for (DFAState<T> s : this) { if (s.equals(state)) { return s.toString(); } } throw new IllegalArgumentException(state+" not in "+this); }
public String name() { if (parent == null) { return ""; } else { return parent.name()+root.toString(); } } /**
protected void gotoNext(DFAState<T> s) throws IOException, NoSuchMethodException { if (s.isDistributed()) { String subName = jav.makeJavaIdentifier(getMethodDescription()+s); ExecutableElement distributedMethod = getDistributedMethod(subName); tload("this"); tload("reader"); invoke(distributedMethod); treturn(); } else { goto_n(s.toString()); } } protected void accepting(DFAState<T> s) throws IOException, NoSuchMethodException
protected void compile(DFAState<T> s, boolean isLast) throws IOException, NoSuchMethodException fixAddress(s.toString()); accepting(s); if (s.hasBoundaryMatches()) invokevirtual(InputReader.class, "isAtBoundary", int.class); ifeq("error"); goto_n(to.toString()); String back = s.toString()+"-repeat"; fixAddress(back); tload("reader"); Range range = tr.getCondition(); DFAState to = s.transit(range); String next = s.toString()+"-"+range+">"+to.toString(); compile(range, next, !tri.hasNext()); String target = s.toString()+"-"+range+">"+to.toString(); for (int ii=range.getFrom();ii <range.getTo();ii++) String target = s.toString()+"-"+range+">"+to.toString(); fixAddress(target);