FSA file format

老子叫甜甜 提交于 2019-11-30 22:52:00


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

代做FSA file java编程语言程序
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

微信:codehelp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!