@Test public void testString() { String pmaStr = pma.toString(); String zeroAtZero = pmaStr.substring(pmaStr.indexOf("\n<0 @ 0"), pmaStr.indexOf("\n<1 @ 1")); assertTrue(zeroAtZero.contains("d -> [0] <0 @ 0>")); assertTrue(zeroAtZero.contains("c -> [0] <0 @ 0>")); assertTrue(zeroAtZero.contains("b -> [0] <0 @ 0>")); assertTrue(zeroAtZero.contains("a -> [0] <1 @ 1>")); String oneAtOne = pmaStr.substring(pmaStr.indexOf("\n<1 @ 1"), pmaStr.indexOf("\n<2 @ 2")); assertTrue(oneAtOne.contains("d -> [1] <0 @ 0>")); assertTrue(oneAtOne.contains("c -> [1] <0 @ 0>")); assertTrue(oneAtOne.contains("a -> [1] <0 @ 0>")); assertTrue(oneAtOne.contains("b -> [0] <2 @ 2 matches a b -> c d >")); String twoAtTwo = pmaStr.substring(pmaStr.indexOf("\n<2 @ 2")); assertTrue(twoAtTwo.contains("d -> [2] <0 @ 0>")); assertTrue(twoAtTwo.contains("c -> [2] <0 @ 0>")); assertTrue(twoAtTwo.contains("b -> [2] <0 @ 0>")); assertTrue(twoAtTwo.contains("a -> [2] <0 @ 0>")); }
@Override public String toString() { StringBuilder sb = new StringBuilder("\n"); sb.append(needsBegin); sb.append("\n"); sb.append(needsEnd); sb.append("\n"); for(State state : keySet()) { sb.append(state); sb.append("\n["); HashMap<Symbol, ActionState> transition = get(state); for(Symbol symbol : transition.keySet()) { sb.append(" "); sb.append(symbol); sb.append(" -> "); sb.append(transition.get(symbol)); sb.append("\n"); } sb.append("]\n"); } return sb.toString(); }
PatternMatchAutomaton extends LinkedHashMap<State, HashMap<Symbol, ActionState>> { @Override public String toString() { StringBuilder sb = new StringBuilder("\n"); sb.append(needsBegin); sb.append("\n"); sb.append(needsEnd); sb.append("\n"); for(State state : keySet()) { sb.append(state); sb.append("\n["); HashMap<Symbol, ActionState> transition = get(state); for(Symbol symbol : transition.keySet()) { sb.append(" "); sb.append(symbol); sb.append(" -> "); sb.append(transition.get(symbol)); sb.append("\n"); } sb.append("]\n"); } return sb.toString(); } }
PatternMatchAutomaton extends LinkedHashMap<State, HashMap<Symbol, ActionState>> { @Override public String toString() { StringBuilder sb = new StringBuilder("\n"); sb.append(needsBegin); sb.append("\n"); sb.append(needsEnd); sb.append("\n"); for(State state : keySet()) { sb.append(state); sb.append("\n["); HashMap<Symbol, ActionState> transition = get(state); for(Symbol symbol : transition.keySet()) { sb.append(" "); sb.append(symbol); sb.append(" -> "); sb.append(transition.get(symbol)); sb.append("\n"); } sb.append("]\n"); } return sb.toString(); } PatternMatchAutomaton(SRS srs);  PatternMatchAutomaton(SRS srs, Symbol[] extraTerminals);  PatternMatchAutomaton(SRS srs, Set<Symbol> extraTerminals); }
PatternMatchAutomaton extends LinkedHashMap<State, HashMap<Symbol, ActionState>> { @Override public String toString() { StringBuilder sb = new StringBuilder("\n"); sb.append(needsBegin); sb.append("\n"); sb.append(needsEnd); sb.append("\n"); for(State state : keySet()) { sb.append(state); sb.append("\n["); HashMap<Symbol, ActionState> transition = get(state); for(Symbol symbol : transition.keySet()) { sb.append(" "); sb.append(symbol); sb.append(" -> "); sb.append(transition.get(symbol)); sb.append("\n"); } sb.append("]\n"); } return sb.toString(); } PatternMatchAutomaton(SRS srs);  PatternMatchAutomaton(SRS srs, Symbol[] extraTerminals);  PatternMatchAutomaton(SRS srs, Set<Symbol> extraTerminals); void rewrite(SinglyLinkedList<Symbol> l); void rewrite(SpliceList<Symbol> l); @Override String toString(); String toDotString(); Map<Symbol, Integer> mkSymToNum(); String toImplString(); StringBuilder transitionToDotString(State state, Map<Symbol, ActionState> transition); }
PatternMatchAutomaton extends LinkedHashMap<State, HashMap<Symbol, ActionState>> { @Override public String toString() { StringBuilder sb = new StringBuilder("\n"); sb.append(needsBegin); sb.append("\n"); sb.append(needsEnd); sb.append("\n"); for(State state : keySet()) { sb.append(state); sb.append("\n["); HashMap<Symbol, ActionState> transition = get(state); for(Symbol symbol : transition.keySet()) { sb.append(" "); sb.append(symbol); sb.append(" -> "); sb.append(transition.get(symbol)); sb.append("\n"); } sb.append("]\n"); } return sb.toString(); } PatternMatchAutomaton(SRS srs);  PatternMatchAutomaton(SRS srs, Symbol[] extraTerminals);  PatternMatchAutomaton(SRS srs, Set<Symbol> extraTerminals); void rewrite(SinglyLinkedList<Symbol> l); void rewrite(SpliceList<Symbol> l); @Override String toString(); String toDotString(); Map<Symbol, Integer> mkSymToNum(); String toImplString(); StringBuilder transitionToDotString(State state, Map<Symbol, ActionState> transition);  }