-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheu4_parse.grammar
26 lines (22 loc) · 940 Bytes
/
eu4_parse.grammar
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
savefile: varlist {coalesce};
/* A savefile can be empty (even though a varlist can't).
This will often cause problems, but parse_config_dir is okay
with it, since this can be used for all-comment examples. */
savefile: ;
/* Note that a varlist can't be empty */
varlist: name "=" value {makemapping};
varlist: varlist name "=" value {addmapping};
varlist: value {makearray};
varlist: varlist value {addarray};
varlist: scripted_trigger {makemapping_st};
varlist: varlist scripted_trigger {addmapping_st};
name: "string";
value: "number";
value: "string";
value: "boolean";
value: "{" varlist "}" {coalesce};
value: "{" "}" {emptymaparray};
/* Inside a scripted trigger, some weird conditionals can be found.
I don't understand them so I'm just hanging onto them fairly raw. */
scripted_trigger: "[" "[" "string" "]" "string" "]" {makescripted_value};
scripted_trigger: "[" "[" "string" "]" name "=" value "]" {makescripted_namevalue};