2019-07-31 19:38:40 +02:00
|
|
|
token cr = /\n/;
|
|
|
|
token eq = /=/;
|
|
|
|
token tabs = /\t+/;
|
|
|
|
token hash = /#/;
|
|
|
|
token at = /[@]/;
|
|
|
|
token dash = /-/;
|
2019-08-02 22:05:32 +02:00
|
|
|
token specialcharacters = /[_*+%"'^$`|&;]+/;
|
2019-07-31 19:38:40 +02:00
|
|
|
token space = / +/;
|
|
|
|
token point = /[.]/;
|
|
|
|
token numbers = /[0-9]+/;
|
|
|
|
token string = /[a-zA-Z]+/;
|
|
|
|
token colon = /[:]/;
|
|
|
|
token coma = /,/;
|
|
|
|
token open_squarebracket = /[[]/;
|
|
|
|
token closesquarebracket = /[]]/;
|
|
|
|
token open_curlybracket = /[{]/;
|
|
|
|
token closecurlybracket = /[}]/;
|
|
|
|
token open_anglebracket = /[<]/;
|
|
|
|
token closeanglebracket = /[>]/;
|
|
|
|
token slash = /\//;
|
|
|
|
|
|
|
|
rule S = lines;
|
|
|
|
rule lines = line cr lines | cr lines | line;
|
|
|
|
rule line = freetextblock | list | assignment | assignment comment | comment;
|
|
|
|
rule freetextblock = at multiplealphanum cr freetext;
|
|
|
|
rule freetext = tabs hashglob cr freetext?;
|
|
|
|
rule assignment = string colon glob;
|
|
|
|
rule list = string colon cr listitem;
|
|
|
|
rule listitem = tabs dash glob cr listitem? | tabs comment cr listitem;
|
|
|
|
rule multiplealphanum = alphanum multiplealphanum?;
|
|
|
|
rule comment = hash glob;
|
|
|
|
|
|
|
|
rule hashglob = hash hashglob | any hashglob | any | hash;
|
|
|
|
rule glob = any glob | any;
|
|
|
|
rule any = alphanum
|
|
|
|
| space | point | coma | colon | eq | at | slash | dash
|
|
|
|
| specialcharacters
|
|
|
|
| open_squarebracket | open_curlybracket | open_anglebracket
|
|
|
|
| closesquarebracket | closecurlybracket | closeanglebracket;
|
|
|
|
rule alphanum = string | numbers;
|