Fistau is named after Finite State Automata. They are an abstract representation of machines that can be in only one state at a time and the manner in which the machine will switch from one state to another. They are used in a variety of applications including parsers and form the backbone of many control systems.
It is convenient to represent finite state automata or machines as a graph because this often allows a better comprehension of the process they represent. Fistau, as offered in fistau.com allows to create such a graph and convert it into a working program in the C computer language suitable for actual working processors.
The creation of a finite state automaton requires the enumeration of each state necessary to perform the tast at hand, as well as any state that may require special attention. It also requires specifying the manner in which states will connect to each other. These transitions are represented by arrows connecting each node.
Various problems will use different semantics for the transitions. In the world of state machines, the better known types are Moore machines, Mealy machines, and Markov chains. We will focus on Mealy machines, and in the context of aparser, also known as acceptor, an arrow will be used to indicate that if a given token is present, the transition will take place. In the case of a non-deterministic machine, like a Markov process, a probability will be associated with each transition.
In Fistau, we are working with a tool that allows to represent Mealy machines by default. The same machine can also be used to represent a Markov process by adding probabilities to each transition. Fistau also has certain notation shortcuts that make it convenient for the representation of processes. For example, Fistau represents a machine as a transition matrix, and presets all unused spaces in that matrix to automatically go to a predefined state that can trigger error processing, This means that the final program will cover all possible cases that can be handled by the system in a precise predictable manner.
The deliverable is primarily a function that will implement the desired finite state automaton. It is included in a bz2 file, and a zip file. The two contain the same information, and are there mostly for convenience. In these you will find a .c .h and a .fistau as well as a Makefile.tmp. The .c file is a C source file implementing the desired program. The .h file is a header file that contains various linkages to the target function.
In order to customize the state machine without havig to regenerate the whole code, the source allows including certain ".code" files that are referenced as #include in the source. Those can be left empty and will be created automatically using the command "make code". Check the Makefile content for details.
The source file can be compiled with the -D__TESTING__ compiler option to produce a unit test module that can be invoked from the bash command line. This is very convenient for demos as well. An options panel allows to specify if the command line will interpret arguments as a string to be parsed or as a file name of a file containing a string to be read for processing.
The current implementation of Fistau will cause the name of each arrow to represent a character that has to be present to cause a transition to be taken. In other words, an edge named "X" is translated into an "if" statement that will be true if the input is currently the letter "X". Also, Fistau does recognize a certain number of identifiers such as "alpha", "digit" and "eos" that are defined in the .h header file.
In a similar manner, giving a name to a node automatically defines a function that can be called from any other function, including itself.
The .fistau file contains the graph definition that can be loaded back into the editor in a subsequent session or kept in a git repo for archival. The .fistau file contains everything required to reconstruct the target finite state machine.
The resulting code is free of any encumbrance restricting your rights to your IP apart from those the you will decide to impose on it.