You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
941 B
37 lines
941 B
whitespace = _{ " " | "\t" | "\r" | "\n" } |
|
multi_comment = { "/*" ~ (!"*/" ~ ANY)* ~ "*/" } |
|
single_comment = { "//" ~ (!NEWLINE ~ ANY)* } |
|
identifier = { ASCII_ALPHA+ ~ (ASCII_ALPHA | ASCII_DIGIT | "_")* } |
|
rvalue = { ('a'..'z' | 'A'..'Z' | '0'..'9' | "_" | "." | "-")+ } |
|
middle = { (whitespace | multi_comment)+ } |
|
|
|
include = { "#" ~ identifier ~ middle ~ "\"" ~ identifier ~ "\"" } |
|
attribution = { identifier ~ middle ~ rvalue ~ ";" } |
|
dictionary = { identifier ~ middle ~ "{" ~ ( |
|
dictionary |
|
| list |
|
| attribution |
|
| whitespace |
|
| multi_comment |
|
| single_comment |
|
| include |
|
)+ ~ "}" } |
|
list_size = _{ ASCII_DIGIT+ ~ whitespace+ } |
|
list_middle = { "(" ~ ( |
|
dictionary |
|
| rvalue |
|
| list_middle |
|
| whitespace |
|
| multi_comment |
|
| single_comment |
|
)+ ~ ")" } |
|
list = { identifier ~ middle ~ list_size? ~ list_middle ~ ";" } |
|
|
|
file = { SOI ~ ( |
|
whitespace |
|
| multi_comment |
|
| single_comment |
|
| dictionary |
|
| list |
|
| attribution)* |
|
~ EOI }
|
|
|