18 for (
int i = 0; i < 2; i++)
30 throw BadIntException(state1,
"BinaryAlphabet::isResolvedIn(int, int): Specified base " +
intToChar(state1) +
" is unknown.",
this);
33 throw BadIntException(state2,
"BinaryAlphabet::isResolvedIn(int, int): Specified base " +
intToChar(state2) +
" is unknown.",
this);
38 return (state1 == 2) || (state1 == state2);
46 throw BadIntException(state,
"BinaryAlphabet::getAlias(int): Specified base unknown.",
this);
73 throw BadCharException(state,
"BinaryAlphabet::getAlias(char): Specified base unknown.",
this);
75 std::vector<std::string> v(1);
std::string intToChar(int state) const
Give the string description of a state given its int description.
virtual void registerState(AlphabetState *st)
Add a state to the Alphabet.
bool isIntInAlphabet(int state) const
Tell if a state (specified by its int description) is allowed by the the alphabet.
bool isCharInAlphabet(const std::string &state) const
Tell if a state (specified by its string description) is allowed by the the alphabet.
This is the base class to describe states in an Alphabet.
An alphabet exception thrown when trying to specify a bad char to the alphabet.
An alphabet exception thrown when trying to specify a bad int to the alphabet.
bool isUnresolved(int state) const
bool isResolvedIn(int state1, int state2) const
Tells if a given (potentially unresolved) state can be resolved in another resolved state.
std::vector< int > getAlias(int state) const
Get all resolved states that match a generic state.
std::string toString(T t)
This alphabet is used to deal NumericAlphabet.