1 18 19 package ticket39; 20 21 import org.junit.Test; 22 import org.sablecc.sablecc.alphabet.AdjacencyRealm; 23 import org.sablecc.sablecc.alphabet.Realms; 24 import org.sablecc.sablecc.automaton.Dfa; 25 import org.sablecc.sablecc.automaton.MinimalDfa; 26 import org.sablecc.sablecc.automaton.Nfa; 27 28 public class PartitioningBug { 29 30 @Test 31 public void bug() { 32 33 AdjacencyRealm<Character > charRealm = Realms.getCharacter(); 34 35 Nfa<Character > any = new Nfa<Character >(charRealm.createInterval('A', 36 'Z')); 37 Nfa<Character > e = new Nfa<Character >(charRealm.createInterval('E')); 38 Nfa<Character > t = new Nfa<Character >(charRealm.createInterval('T')); 39 Nfa<Character > i = new Nfa<Character >(charRealm.createInterval('I')); 40 Nfa<Character > n = new Nfa<Character >(charRealm.createInterval('N')); 41 42 Dfa<Character > allButEtienne = any.zeroOrMore().subtract( 43 e.concatenateWith(t).concatenateWith(i).concatenateWith(e) 44 .concatenateWith(n).concatenateWith(n).concatenateWith( 45 e)); 46 47 new MinimalDfa<Character >(allButEtienne); 49 } 50 } 51 | Popular Tags |