All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class javaParse.FSA

java.lang.Object
   |
   +----javaParse.Machine
           |
           +----javaParse.FSA

public class FSA
extends Machine
This class simulates the behavior of a (non)deterministic finite state automaton.


Variable Index

 o NO_UNREACHABLES_STR
 o trap
used to mark which state is the add3ed trap state in the minimize algorithm

Constructor Index

 o FSA(Desktop)
Creates FSA corresponding to its desktop image.
 o FSA(FSA)

Method Index

 o buildDfa(Vector)
Builds the DFA associated with the passed NFA into this Machine .
 o checkDfaDone(FSA)
returns true if the Desktop matches the given dfa Desktop Precondition: dfa is already a proper DFA.
 o expandState(FSA, State)
 o findFirstLambda(State)
returns the first lambda transition that elaves the passed State
 o findReachables()
returns a Vector of all the reachable States in the graph.
 o findTransition(State, char)
returns the first transition that leaves from the given State with the given character as its label.
 o getAlphabet()
returns a vector of Characters corresponding to the alphabet of this machine.
 o leadsTo(Vector, char)
Returns the list of all nodes this set of nodes can lead to with the given letter precondition: all nodes reachable from any of these nodes by a lambda transition are already part of nodes.
 o placeAllStates(Machine)
Places all the states for the solved DFA solution
 o showClosures(State, FSA)
sets the proper closures in the LRclosureswindow and the correct statelist provided the state is correctly placed
 o showUnreachables()
finds all unreachable States, highlights them, and returns a String corresponding to the message to be printed by the Environment Overrides Machine.showUnreachables()

Variables

 o NO_UNREACHABLES_STR
 public static final String NO_UNREACHABLES_STR
 o trap
 public State trap
used to mark which state is the add3ed trap state in the minimize algorithm

Constructors

 o FSA
 public FSA(Desktop d)
Creates FSA corresponding to its desktop image.

 o FSA
 public FSA(FSA f)

Methods

 o showUnreachables
 public String showUnreachables()
finds all unreachable States, highlights them, and returns a String corresponding to the message to be printed by the Environment Overrides Machine.showUnreachables()

Overrides:
showUnreachables in class Machine
 o findReachables
 public Vector findReachables()
returns a Vector of all the reachable States in the graph. Overrides Machine.findReachables()

Overrides:
findReachables in class Machine
 o getAlphabet
 public Vector getAlphabet()
returns a vector of Characters corresponding to the alphabet of this machine. the alphabet is in sorted order. works only for FSA's

Overrides:
getAlphabet in class Machine
 o buildDfa
 public void buildDfa(Vector theStates)
Builds the DFA associated with the passed NFA into this Machine .

 o leadsTo
 public Vector leadsTo(Vector nodes,
                       char letter)
Returns the list of all nodes this set of nodes can lead to with the given letter precondition: all nodes reachable from any of these nodes by a lambda transition are already part of nodes.

 o findTransition
 public Transition findTransition(State from,
                                  char trans)
returns the first transition that leaves from the given State with the given character as its label. Does not work for lambda transitions.

 o findFirstLambda
 public Transition findFirstLambda(State from)
returns the first lambda transition that elaves the passed State

 o checkDfaDone
 public String checkDfaDone(FSA dfa)
returns true if the Desktop matches the given dfa Desktop Precondition: dfa is already a proper DFA. Works only on FSA's

 o placeAllStates
 public void placeAllStates(Machine model)
Places all the states for the solved DFA solution

 o expandState
 public String expandState(FSA dfa,
                           State s)
 o showClosures
 public void showClosures(State s,
                          FSA model)
sets the proper closures in the LRclosureswindow and the correct statelist provided the state is correctly placed


All Packages  Class Hierarchy  This Package  Previous  Next  Index