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.
-
NO_UNREACHABLES_STR
-
-
trap
-
used to mark which state is the add3ed trap state in the minimize algorithm
-
FSA(Desktop)
- Creates FSA corresponding to its desktop image.
-
FSA(FSA)
-
-
buildDfa(Vector)
-
Builds the DFA associated with the passed NFA into this Machine .
-
checkDfaDone(FSA)
- returns true if the Desktop matches the given dfa Desktop
Precondition: dfa is already a proper DFA.
-
expandState(FSA, State)
-
-
findFirstLambda(State)
-
returns the first lambda transition that elaves the passed State
-
findReachables()
- returns a Vector of all the reachable States in the graph.
-
findTransition(State, char)
-
returns the first transition that leaves from the given State with the given character
as its label.
-
getAlphabet()
- returns a vector of Characters corresponding to the alphabet of this machine.
-
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.
-
placeAllStates(Machine)
- Places all the states for the solved DFA solution
-
showClosures(State, FSA)
- sets the proper closures in the LRclosureswindow and the correct statelist
provided the state is correctly placed
-
showUnreachables()
-
finds all unreachable States, highlights them, and returns a String
corresponding to the message to be printed by the Environment
Overrides Machine.showUnreachables()
NO_UNREACHABLES_STR
public static final String NO_UNREACHABLES_STR
trap
public State trap
- used to mark which state is the add3ed trap state in the minimize algorithm
FSA
public FSA(Desktop d)
- Creates FSA corresponding to its desktop image.
FSA
public FSA(FSA f)
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
findReachables
public Vector findReachables()
- returns a Vector of all the reachable States in the graph.
Overrides Machine.findReachables()
- Overrides:
- findReachables in class Machine
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
buildDfa
public void buildDfa(Vector theStates)
- Builds the DFA associated with the passed NFA into this Machine .
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.
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.
findFirstLambda
public Transition findFirstLambda(State from)
- returns the first lambda transition that elaves the passed State
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
placeAllStates
public void placeAllStates(Machine model)
- Places all the states for the solved DFA solution
expandState
public String expandState(FSA dfa,
State s)
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