リビジョン | 664 (tree) |
---|---|
日時 | 2017-07-16 08:16:11 |
作者 | y-moriguchi |
fixed bugs about regular expression
@@ -608,16 +608,24 @@ | ||
608 | 608 | DFAState<T, A, B> state) { |
609 | 609 | List<DFAState<T, A, B>> l = new ArrayList<DFAState<T, A, B>>(); |
610 | 610 | DFAState<T, A, B> s; |
611 | + int ns, ne; | |
611 | 612 | |
612 | 613 | l.add(state); |
613 | 614 | for(int i = 0; i < l.size(); i++) { |
614 | - for(Interval o : l.get(i).getAlphabetRanges()) { | |
615 | - if(o.isInfimumClosed()) { | |
616 | - s = l.get(i).go((T)o.getInfimumBound()); | |
617 | - } else if(o.isSupremumClosed()) { | |
618 | - s = l.get(i).go((T)o.getSupremumBound()); | |
615 | + for(Interval intv : l.get(i).getAlphabetRanges()) { | |
616 | + if(intv.isInfimumClosed()) { | |
617 | + s = l.get(i).go((T)intv.getInfimumBound()); | |
618 | + } else if(intv.isSupremumClosed()) { | |
619 | + s = l.get(i).go((T)intv.getSupremumBound()); | |
620 | + } else if(intv.getInfimumBound() instanceof Integer) { | |
621 | + ns = ((Integer)intv.getInfimumBound()).intValue(); | |
622 | + ne = ((Integer)intv.getInfimumBound()).intValue(); | |
623 | + if(ns + 1 < ne) { | |
624 | + s = l.get(i).go((T)new Integer(ns + 1)); | |
625 | + } else { | |
626 | + continue; | |
627 | + } | |
619 | 628 | } else { |
620 | -System.out.println(o); | |
621 | 629 | throw new RuntimeException(); |
622 | 630 | } |
623 | 631 | if(!l.contains(s)) l.add(s); |