Finite Automaton

This is a drawing of a toy parser finite automaton, probably generated by Yacc.

The rankdir=LR attribute requests a left-to-right drawing, oriented in landscape mode. Note the use of text labels on edges.

Computation begins at node 0, and ends at “accept state” nodes, marked with double-circles.

[Input .gv File] [SVG] [Raster Image]

fsm.gv.txt
digraph finite_state_machine {
	rankdir=LR;
	size="8,5"
	node [shape = doublecircle]; 0 3 4 8;
	node [shape = circle];
	0 -> 2 [label = "SS(B)"];
	0 -> 1 [label = "SS(S)"];
	1 -> 3 [label = "S($end)"];
	2 -> 6 [label = "SS(b)"];
	2 -> 5 [label = "SS(a)"];
	2 -> 4 [label = "S(A)"];
	5 -> 7 [label = "S(b)"];
	5 -> 5 [label = "S(a)"];
	6 -> 6 [label = "S(b)"];
	6 -> 5 [label = "S(a)"];
	7 -> 8 [label = "S(b)"];
	7 -> 5 [label = "S(a)"];
	8 -> 6 [label = "S(b)"];
	8 -> 5 [label = "S(a)"];
}

Copyright © 1996-2004 AT&T. All rights reserved.

Last modified May 10, 2021: Move gallery to Docsy (164fb41)