in reply to Creating a module with DFA::Simple

Are you familiar with FSA::Rules? It's a good state machine and it's fairly well-documented. Also, if you have GraphViz installed, you can use it to show what your state machine looks like. This makes debugging much simpler. (Disclaimer: I'm one of the authors of FSA::Rules and I'm the guy who hacked in the GraphViz stuff, so I may be biased).

Cheers,
Ovid

New address of my CGI Course.

Replies are listed 'Best First'.
Re^2: Creating a module with DFA::Simple
by adjohan (Novice) on Feb 26, 2005 at 17:46 UTC
    I will take a look at FSA::Rules

    Thanks for the suggestion!
    Adrianus

Re^2: Creating a module with DFA::Simple
by adjohan (Novice) on Feb 26, 2005 at 17:53 UTC
    Ovid,

    Do you know a good example using FSA::Rules for creating a parser?

    Thanks!
    Adrianus

      Regrettably, no, though it should be suitable for that. If I were you, I would define a very simple grammar (only two or three types of tokens) and try to build the parser from there. It should be relatively easy to port the state machine from this article to FSA::Rules. The nice thing is, if you have GraphViz installed, you can then print out the graph to see if it's equivalent to the diagram in the article:

      my $graph = $fsa->graph; print FH $graph->as_png;

      Cheers,
      Ovid

      New address of my CGI Course.