Minetest-WorldEditAdditions/.docs/grammars/axes.bnf

41 lines
970 B
BNF
Raw Normal View History

2021-11-30 00:20:40 +01:00
{%
2021-11-30 20:10:45 +01:00
# Lists of axes
2023-07-11 01:39:48 +02:00
In various commands such as `//copy+`, `//move+`, and others lists of axes are used. These are all underpinned by a single grammar and a single parser (located in `worldeditadditions/utils/parse/axes.lua`). While the parser itself requires pre-split tokens (see `split_shell` for that), the grammar which it parses is documented here.
2021-11-30 00:20:40 +01:00
Examples:
```
front 3 left 10 y 77 x 30 back 99
```
%}
<axes> ::= <axis_part> *
<axes_part> ::= <axis_name> <number>
2021-11-30 20:10:45 +01:00
| <axis_name> <number> <reverse>
<reverse> ::= <number>
| <reverse_name>
<reverse_name> ::= sym | symmetrical | mirror | mir | rev | reverse | true
2021-11-30 00:20:40 +01:00
<axis_name> ::= <axis_name_absolute>
| <axis_name_relative>
<axis_name_absolute> ::= <axis_letters_absolute>
| "-" <axis_letters_absolute>
2021-12-01 21:02:53 +01:00
<axis_name_relative> ::= front | back | left | right | up | down | "?"
2021-11-30 00:20:40 +01:00
2021-12-01 21:02:53 +01:00
<axis_letters_absolute> ::= x | y | z | h | v
2021-11-30 00:20:40 +01:00
2021-11-30 20:10:45 +01:00
2021-11-30 00:20:40 +01:00
<number> ::= <digit> *
<digit> ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 0