@@ -0,0 +1,2397 @@
+/* This file is part of SableCC ( http://sablecc.org ).%0A * %0A * See the NOTICE file distributed with this work for copyright information.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage ticket39;%0A%0Aimport org.junit.Test;%0Aimport org.sablecc.sablecc.alphabet.AdjacencyRealm;%0Aimport org.sablecc.sablecc.automaton.Dfa;%0Aimport org.sablecc.sablecc.automaton.MinimalDfa;%0Aimport org.sablecc.sablecc.automaton.Nfa;%0A%0Apublic class PartitioningBug %7B%0A%0A    @Test%0A    public void bug() %7B%0A%0A        AdjacencyRealm%3CCharacter%3E charRealm = new AdjacencyRealm%3CCharacter%3E() %7B%0A%0A            @Override%0A            public boolean isAdjacent(%0A                    Character bound1,%0A                    Character bound2) %7B%0A%0A                return bound1 + 1 == bound2;%0A            %7D%0A%0A            @Override%0A            public Character next(%0A                    Character bound) %7B%0A%0A                return (char) (bound + 1);%0A            %7D%0A%0A            @Override%0A            public Character previous(%0A                    Character bound) %7B%0A%0A                return (char) (bound - 1);%0A            %7D%0A%0A        %7D;%0A%0A        Nfa%3CCharacter%3E any = new Nfa%3CCharacter%3E(charRealm.createInterval('A',%0A                'Z'));%0A        Nfa%3CCharacter%3E e = new Nfa%3CCharacter%3E(charRealm.createInterval('E'));%0A        Nfa%3CCharacter%3E t = new Nfa%3CCharacter%3E(charRealm.createInterval('T'));%0A        Nfa%3CCharacter%3E i = new Nfa%3CCharacter%3E(charRealm.createInterval('I'));%0A        Nfa%3CCharacter%3E n = new Nfa%3CCharacter%3E(charRealm.createInterval('N'));%0A%0A        Dfa%3CCharacter%3E allButEtienne = any.zeroOrMore().subtract(%0A                e.concatenateWith(t).concatenateWith(i).concatenateWith(e)%0A                        .concatenateWith(n).concatenateWith(n).concatenateWith(%0A                                e));%0A%0A        System.out.println(allButEtienne);%0A%0A        System.out.println(new MinimalDfa%3CCharacter%3E(allButEtienne));%0A    %7D%0A%7D%0A

Add regression test. See ticket:39.