Module: FAdo IO Functions (fio)¶
In/Out.
FAdo I/O methods. The parsing grammars for most of the objects reside here.
Classes¶
Class BuildFadoObject¶
Functions¶
readFromFile¶
- readFromFile(FileName)[source]¶
Reads list of finite automata definition from a file.
The format of these files must be the as simple as possible:
#begins a comment@DFAor@NFAbegin a new automata (and determines its type) and must be followed by the list of the final states separated by blanksfields are separated by a blank and transitions by a CR:
statesymbolnew statein case of a NFA declaration, the “symbol” @epsilon is interpreted as a CEpsilon-transition
the source state of the first transition is the initial state
in the case of a NFA, its declaration
@NFAcan, after the declaration of the final states, have a*followed by the list of initial statesboth, NFA and DFA, may have a declaration of alphabet starting with a
$followed by the symbols of the alphabeta line with a sigle name, decrares a state
FAdo ::= FA | FA CR FAdo FA ::= DFA | NFA | Transducer DFA ::= "@DFA" LsStates Alphabet CR dTrans NFA ::= "@NFA" LsStates Initials Alphabet CR nTrans Transducer ::= "@Transducer" LsStates Initials Alphabet Output CR tTrans Initials ::= "*" LsStates | /CEpsilon Alphabet ::= "$" LsSymbols | /CEpsilon Output ::= "$" LsSymbols | /CEpsilon nSymbol ::= symbol | "@epsilon" LsStates ::= stateid | stateid , LsStates LsSymbols ::= symbol | symbol , LsSymbols dTrans ::= stateid symbol stateid | | stateid symbol stateid CR dTrans nTrans ::= stateid nSymbol stateid | | stateid nSymbol stateid CR nTrans tTrans ::= stateid nSymbol nSymbol stateid | | stateid nSymbol nSymbol stateid CR nTransNote
If an error occur, either syntactic or because of a violation of the declared automata type, an exception is raised
Changed in version 0.9.6.
Changed in version 1.0.
readOneFromFile¶
readOneFromString¶
saveToFile¶
saveToJson¶
saveToString¶
toJson¶
Constants¶
- const
FAdo.fio.FAdoGrammar