1# This file is part of TagSoup and is Copyright 2002-2008 by John Cowan.
2#
3# TagSoup is licensed under the Apache License,
4# Version 2.0.  You may obtain a copy of this license at
5# http://www.apache.org/licenses/LICENSE-2.0 .  You may also have
6# additional legal rights not granted by this license.
7#
8# TagSoup is distributed in the hope that it will be useful, but
9# unless required by applicable law or agreed to in writing, TagSoup
10# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
11# OF ANY KIND, either express or implied; not even the implied warranty
12# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
14# State Table Markup Language
15default namespace = "http://www.ccil.org/~cowan/XML/tagsoup/stml"
16start = statetable
17
18## Root element
19statetable = element statetable {
20	attribute version {"1.0"},
21	attribute id {xsd:ID}?,
22	symbol*,
23	action+,
24	state+
25	}
26
27## A symbol specifies a non-character input to the state machine
28symbol = element symbol {
29	attribute id {xsd:ID}
30	}
31
32## An action is the name for what the state machine does
33action = element action {
34	attribute id {xsd:ID}
35	}
36
37## A state specifies an internal state of the machine
38state = element state {
39	attribute id {xsd:ID},
40	tr*
41	}
42
43## A tr specifies a state transition
44tr = element tr {
45	(attribute symbol {xsd:IDREF} |
46		attribute char {xsd:string {length = "1"}}),
47	attribute action {xsd:IDREF},
48	attribute newstate {xsd:IDREF}
49	}
50