-
Notifications
You must be signed in to change notification settings - Fork 0
/
grammar
35 lines (27 loc) · 900 Bytes
/
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
27
28
29
30
31
32
33
34
document ::= header fulltext?
header ::= '___header___' statement_list
statement_list ::= empty | statement*
statement ::= constant ':' definition
definition ::= options (file_assignment | value (LPAREN statement_list RPAREN)?)
options ::= ( language mark? | mark language? )?
language ::= 'lang' value
mark ::= 'mark' value
file_assignment ::= 'file' value
value ::= '"' VALUE '"'
LPAREN ::= '('
RPAREN ::= ')'
EOF ::= 'end of file'
comment ::= '//*' 'any character'* '*//'
definition_value ::= (SHORTNAME ('(' LONGNAME ')')?)+
file_value ::= assignment statement_list EOF
mark_value ::= [0-9]+
placeholder ::= '{}'
escape ::= '\'
end_of_line ::= 'EOL'
tab ::= 'TAB'
/* add other spaces */
fulltext ::= '___text___' text
text ::= (sentence|expandable)*
sentence ::= 'any character'*
expandable ::= CONSTANT SPACE (text CLOSING_TAG)+
/* constant ::= long names can be separated by a dot */