Skip to content

Commit 269a520

Browse files
committed
update grammar; change the snapshot
1 parent e299352 commit 269a520

2 files changed

Lines changed: 29 additions & 22 deletions

File tree

snapshot.png

-238 Bytes
Loading

tvkl/grammar/tvkl.gram

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,32 @@
1616
# FORMAL GRAMMAR
1717
# =============================================================================
1818

19-
tvkl ::= { declaration } EOF ;
20-
declaration ::= assign
21-
| line ;
22-
assign ::= ident "=" value ;
23-
ident ::= "#" name ;
24-
value ::= number
25-
| color ;
26-
color ::= "@" "(" number "," number "," number ")" ;
27-
line ::= ":" "|" { item "|" } "-" ;
28-
item ::= key_name [ attr_decl ] ;
29-
key_name ::= quoted_name
30-
| name ;
31-
quoted_name ::= "'" name "'"
32-
| '"' name '"' ;
33-
attr_decl ::= "[" attr { "," attr } "]" ;
34-
attr ::= number
35-
name ::= name_char { name_char } ;
36-
name_char ::= ? any character except whitespace,
37-
number ::= "$" num ;
38-
num ::= digit { digit } ;
39-
digit ::= "0" | "1" | "2" | "3" | "4"
40-
| "5" | "6" | "7" | "8" | "9" ;
19+
tvkl ::= { declaration } EOF ;
20+
declaration ::= assign
21+
| line ;
22+
assign ::= ident "=" value ;
23+
ident ::= "#" name ;
24+
value ::= number
25+
| color
26+
| ident ;
27+
color ::= "@" "(" color_param "," color_param "," color_param ")" ;
28+
color_param ::= number | ident ;
29+
line ::= ":" "|" { item "|" } "-" ;
30+
item ::= bind_list [ attr_decl ] ;
31+
bind_list ::= bind { "," bind } ;
32+
bind ::= key_name [ metadata ] ;
33+
metadata ::= "{" quoted_name "}" ;
34+
attr_decl ::= "[" [ attr ] { "," [ attr ] } "]" ;
35+
attr ::= number
36+
| color
37+
| ident ;
38+
key_name ::= quoted_name
39+
| name ;
40+
quoted_name ::= "'" name_char2 "'"
41+
| '"' name_char2 '"' ;
42+
number ::= "$" num ;
43+
name ::= name_char { name_char } ;
44+
name_char ::= ? any character except whitespace, "|", ":", "-", "[", "]", "{", "}", ",", "=", "#", "@" ? ;
45+
name_char2 ::= ? any chararcter except corresponding quotation marks ? ;
46+
num ::= digit { digit } ;
47+
digit ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ;

0 commit comments

Comments
 (0)