1: doctype public "-//IDN etl.sf.net//ETL//Grammar 0.2.1";
2:
3: grammar samples.Events {
4: namespace default e = "urn:x-etl:samples:events";
5: context default TopLevel {
6: statement Events {
7: % events;
8: @ events += block(DefList);
9: };
10: statement ResetEvents {
11: % resetEvents;
12: @ events += block(ResetEventList);
13: };
14: statement Commands {
15: % commands;
16: @ commands += block(DefList);
17: };
18: statement State {
19: % state;
20: @ name = identifier;
21: @ contents += block(StateContext);
22: };
23: };
24:
25: context ResetEventList {
26: statement ResetEvent {
27: @ name = identifier;
28: };
29: };
30:
31: context DefList {
32: statement Def {
33: @ name = identifier;
34: @ code = identifier;
35: };
36: };
37:
38: context StateContext {
39: statement Actions {
40: % actions;
41: @ commands = block(ActionContext);
42: };
43: statement Transtion {
44: % on;
45: @ event = identifier;
46: % =>;
47: @ target = identifier;
48: };
49: };
50:
51: context ActionContext {
52: statement Action {
53: @ name = identifier;
54: };
55: };
56: };