联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-23:00
  • 微信:codinghelp

您当前位置:首页 >> Java编程Java编程

日期:2019-10-08 07:22


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


版权所有:留学生编程辅导网 2020 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp