Skip to content

Commit d473b50

Browse files
committed
more grammar
1 parent 8b0e727 commit d473b50

File tree

1 file changed

+40
-13
lines changed

1 file changed

+40
-13
lines changed

docs/doc-plan.md

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,69 @@ Execution always starts on page 1. Before execution
33
starts, all variables are initialized to 0 and
44
the current value of all sensors is cached.
55

6-
A page consists of a sequence of rules (R), ordered from top to bottom.
6+
A page consists of a sequence of rules (R):
7+
8+
P := page-D R\*
9+
710
Each rule has an option when section W and an optional do section D.
11+
12+
R := when [W] do [D]
13+
814
The when section specifies an event of interest
915
and, optionally, a filter on that event.
1016
The do section specifies an action and, optionally,
1117
parameters to that action.
1218
Some actions can be repeated.
1319

14-
R := [W] [D]
15-
1620
W :=
1721
| page-start [TS]
1822
| timer [TS]
1923
| press [PK]
2024
| release [PK]
2125
| move [MK]
2226
| sound [loud | quiet | C]
23-
| temperature [up | down | C]
24-
| light [up | down | C]
25-
| magnet [up | down | C]
27+
| temperature [UD | C]
28+
| light [UD | C]
29+
| magnet [UD | C]
2630
| radio-receive [C]
2731
| variable-X-set [C]
2832
| variable-Y-set [C]
2933
| variable-Z-set [C]
3034

35+
UD := up | down
3136
TS := (1/4-second | 1-second | 1-random-second | 5-seconds)\*
3237
PK := button-A | button-B | logo | pin-0 | pin-1 | pin-2
3338
MK := shake | tilt-left | tilt-right | ...
39+
3440
C := CO V
3541

42+
CO :=
43+
| equals
44+
| not-equals
45+
| less-then
46+
| less-then-or-equal
47+
| greater-than
48+
| greater-than-or-equal
49+
50+
V :=
51+
| A
52+
| A + V
53+
| A / V
54+
| A - V
55+
| A \* V
56+
| random PV
57+
58+
A :=
59+
| <float>
60+
| var-X | var-Y | var-Z
61+
| light-value | sound-value | temp-value | magnet-value
62+
| radio-value
63+
64+
PV :=
65+
| int>0
66+
| int>0 + PV
67+
| int>0 \* PV
68+
3669
D :=
3770
| show-number [V]
3871
| show-image (image)_ [repeat [PV]]
@@ -45,10 +78,4 @@ D :=
4578
| set-variable-Z [V]
4679
| switch-page [PG]
4780

48-
CO :=
49-
| equals
50-
| not-equals
51-
| less-then
52-
| less-then-or-equal
53-
| greater-than
54-
| greater-than-or-equal
81+
PG := | page-1 | page-2 | page-3 | page-4 | page-5

0 commit comments

Comments
 (0)