首页 > > 详细

讲解FSA file java编程语言程序、java FSA辅导讲解辅导R语言编程|解析Haskell程序

FSA file format
The file describing an FSA is a series of records, structured as lines of text.
Records
There are 4 different type of records to specify states, transitions, initial-states, final-states, as
well as comments and empty lines.
1 State record
state stateName xPos yPos
Where:
state is the character string “state”.
stateName is the name of the state, a string of characters beginning with a letter, followed
by zero or more letter, digit, or underscore characters. (This is essentially the definition of
“identifier” in Java.)
xPos and yPos are integer values that gives the x- and y-position of the state on the
computer’s display screen. Although you will not need these values for this stage of the
project, you must store and reproduce them correctly.
2 Transition record
transition fromState event toState
Where:
transition is the character string “transition”.
fromState is the name of the state from which this transition begins.
event is the name of the event that causes this transition to occur.
An event name is either character string consisting only of letters, or the character “?” that
indicates an ε-transition.
toState is the name of the state where the transition terminates.
3 Initial record
initial stateName
Where:
stateName specifies an initial state of the FSA. stateName must comply with the rules
described earlier for state-names.
4 Final record
final stateName
Where:
stateName specifies a final state of the FSA. stateName must comply with the rules described
earlier for state-names.
5 Comment line
A line that begins with the character # is a comment, and is ignored.
6 Empty line
A line containing no data is ignored by the system.
Order of records
Records can appear in any order in the file, with one restriction: a state name must have been
defined via a state record before its name can be used in a transition record, initial record,
or final record.
Example
This input file has two states, q0 (initial) and q1 (final) and a transition ev between them
It is equivalent to the following FSA:
# States
state q0 10 10
state q1 20 10
# Transitions
transition q0 ev q1
# Initial
initial q0
# Final
final q1

联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!