aboutsummaryrefslogtreecommitdiff
path: root/README
blob: 07d3a9dc35d73332ab6003870c725fbd91760742 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
If an emulation of a machine is a virtual machine, then this is VFSM: the Virtual Finite State Machine.

Usage is: ruby vfsm.rb <machine description file> <input>

A Machine description must have:
 * A Start: line, followed by the starting node id
 * An Accept: line, followed by space separated node ids which may accept
 * An Edges: line, followed by edge definition lines and an End: line

An edge definition line must have:
 * The source node
 * The input to accept
 * The destination node

The VFSM syntax accepts the case insensitive special inputs epsilon: and lambda:, all of which represent a state transition on no input.

There may be any number of Comment: lines which are unsurprisingly ignored.
In the VFSM v2 syntax, you do not need a nodes line, the node ids are inferred from the start:, accept:, and edges:-end: lines. Nodes: lines are ignored for backwards compatability.

The input is a string of space separated input tokens.

See the examples.