1: doctype public "-//IDN etl.sf.net//ETL//Grammar 0.2.1";
2:
3: grammar net.sf.etl.samples.Plans {
4: import accounting="accounting.g.etl";
5: namespace default p = "http://etl.sf.net/2008/samples/plans";
6:
7: context default TopLevel {
8: statement Plan {
9: % plan;
10: @ name = identifier;
11: @ contents += block(PlanMembers);
12: };
13: };
14:
15: context PlanMembers {
16: statement Value {
17: % value;
18: @ name = identifier;
19: % : ;
20: @ type = identifier;
21: @ value += block(TimedExpressions);
22: };
23:
24: statement Event {
25: % event;
26: @ name = identifier;
27: @ value += block(TimedExpressions);
28: };
29: };
30:
31: context TimedExpressions {
32: import expressions = Expressions from accounting;
33: def MappingPart {
34: % =>;
35: @ value = expression(expressions);
36: };
37: statement After {
38: % after;
39: @ date = ^ p:Date {
40: @ year = integer;
41: % -;
42: @ month = integer;
43: % -;
44: @ day = integer;
45: };
46: ref(MappingPart);
47: };
48: statement Past {
49: % past;
50: ref(MappingPart);
51: };
52: };
53: };