Click here to Skip to main content
15,884,597 members
Articles / Programming Languages / C#

XML Finite State Machine in C#

Rate me:
Please Sign up or sign in to vote.
4.59/5 (15 votes)
31 Mar 2002MIT2 min read 146.1K   4.2K   74  
An article on implementing a table-driven finite state machine using XML and C#
<?xml version="1.0"?>
<doc>
    <assembly>
        <name>xmlfsm</name>
    </assembly>
    <members>
        <member name="T:workingcode.util.XMLStateMachine">
            <remarks>
            This class implements a table-driven finite state machine.
            The table is defined by an XML document. The System.Xml.XmlTextReader 
            class is used for fast scanning of the table and allows larger tables 
            to be used as opposed to System.Xml.XmlDocument.
            </remarks>
        </member>
        <member name="M:workingcode.util.XMLStateMachine.Next(System.String)">
            <summary>
            The Next method gets the next valid state given
            the current state and the supplied input.
            </summary>
            <param name="inputArg">The input used to trigger a state transition.</param>
            <returns>A string that identifies the next state</returns>
        </member>
        <member name="P:workingcode.util.XMLStateMachine.CurrentState">
            <summary>
            The CurrentState property contains the current state in the table.
            </summary>
        </member>
        <member name="P:workingcode.util.XMLStateMachine.Action">
            <summary>
            The Action property contains a user-defined string
            that indicates an action to be performed on the current transition.
            </summary>
        </member>
        <member name="P:workingcode.util.XMLStateMachine.StateTable">
            <summary>
            The StateTable property contains the state table file name.
            </summary>
        </member>
    </members>
</doc>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The MIT License


Written By
Web Developer
United States United States
Kevin is a software development manager for a small consumer-oriented company in SoHo, NY. He is technology and platform agnostic having worked on PCs, Macintosh and various forms of Unix and Linux. His programming knowledge includes several languages, including C/C++, Java and C#. In the rare moments when his head is not buried in the latest tech book purchase from Amazon, Kevin enjoys spending time with his wife Donna and their dog Kirby.

Comments and Discussions