31 lines
666 B
Plaintext
31 lines
666 B
Plaintext
<file> ::= elements
|
||
|
||
<elements> ::= ws? element ws? elements
|
||
| ws? ε
|
||
|
||
<element> ::= string
|
||
| list
|
||
| symbol
|
||
| integer
|
||
| property-string
|
||
|
||
string ::= <'"'> #'([^"\\]|\\.|\\\n)*' <'"'>
|
||
|
||
property-string
|
||
::= <'#('> ws? string text-property* ws? <')'>
|
||
|
||
text-property ::= ws? element ws? element ws? element
|
||
|
||
list ::= <'('> elements dot-cdr? <')'>
|
||
|
||
symbol ::= #'([^?#0-9 \n\s\f()\[\]"\'\\.]|\\.)([^ \n\s\f()\[\]"\'\\]|\\.)*'
|
||
| #'\.([^ \n\s\f()\[\]"\'\\]|\\.)+'
|
||
|
||
integer ::= #'[-+]?[0-9]+' <#'.'>?
|
||
|
||
dot-cdr ::= <'.'> ws? element
|
||
|
||
<text> ::= ws? (string | property-string) ws?
|
||
|
||
<ws> ::= <#'(\s||\n)'>+
|