Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RE -> FSM generator? [closed]

Given a regular expression, I'm looking for a package which will dynamically generate the code for a finite state machine that implements the RE.

C/C++ and Python preferred, but other languages are of interest as well.

like image 954
Mark Harrison Avatar asked Jan 18 '09 02:01

Mark Harrison


People also ask

How many types of FSM generate output?

6.3. The FSM can be of two types: Moore (where the output of the state machine is purely dependent on the state variables) and Mealy (where the output can depend on the current state variable values and the input values). The general structure of an FSM is shown in Figure 6.7.

What is the difference between EFSM and FSM?

In a conventional finite state machine, the transition is associated with a set of input Boolean conditions and a set of output Boolean functions. In an extended finite state machine (EFSM) model, the transition can be expressed by an “if statement” consisting of a set of trigger conditions.

What is state explosion of FSM?

As the number of state variables in the system increases, the size of the system state space grows exponentially. This is called the “state explosion problem”.

What happens if the input is low in FSM?

What happens if the input is low in FSM? Explanation: There is no transition in the state if the input is low. If the system is in a particular state, it remains in that state only until the input becomes high.


1 Answers

re2c generates C code. I'm not sure what you mean by 'dynamically' -- AFAIK you'd have to compile and dynamic-load the output, if you want to call on the generated code during the same run that you generated it.

like image 134
Darius Bacon Avatar answered Sep 30 '22 20:09

Darius Bacon