-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfortigate.lark
41 lines (26 loc) · 911 Bytes
/
fortigate.lark
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
root : config+
?config : "config" config_branch subcommand* "end" _LINEEND+
?subcommand : subcommand_config
| subcommand_field_set
| subcommand_field_unset
| subcommand_table_edit
subcommand_config : config
config_branch : _config_branch_specifier _LINEEND+
_config_branch_specifier: NAME+ [ESCAPED_STRING]
FIELD: NAME
VALUE_CONTENT: (CONCATENATED_PRINTABLE|ESCAPED_STRING)
TABLE: (INT|ESCAPED_STRING)
subcommand_field_set : "set" FIELD value _LINEEND+
subcommand_field_unset : "unset" FIELD _LINEEND+
subcommand_table_edit: "edit" TABLE _LINEEND+ subcommand* "next" _LINEEND+
value : VALUE_CONTENT+
NAME: /[\w\-]+/
CONCATENATED_PRINTABLE : /[\w\-\.:\/\*]+/
COMMENT : /#.*/ _LINEEND+
_LINEEND : WS_INLINE* NEWLINE
ESCAPED_STRING : /"(.|\n)*?"/ | /'(.|\n)*?'/
%import common.WS_INLINE
%import common.NEWLINE
%import common.INT
%ignore WS_INLINE
%ignore COMMENT