Example #1
0
 public void destroyTransition(State from, State to)
     throws IllegalSymbolException, UnsupportedOperationException {
   Alphabet a = stateAlphabet();
   a.validate(from);
   a.validate(to);
   throw new UnsupportedOperationException("destroyTransition not supported by FlatModel");
 }
  private Character _tokenizeSymbol(Symbol s) throws IllegalSymbolException {
    Character c = (Character) symbolsToCharacters.get(s);
    if (c == null) {
      Alphabet alpha = getAlphabet();
      alphabet.validate(s);
      if (alpha instanceof FiniteAlphabet) {
        c =
            (Character)
                symbolsToCharacters.get(
                    AlphabetManager.getAllAmbiguitySymbol((FiniteAlphabet) alpha));
      }
      if (c == null) {
        throw new IllegalSymbolException("No mapping for symbol " + s.getName());
      }
    }

    return c;
  }